Polychemy's Model Generator API.
The modelGEN API allows anyone to create and customize any of the available Polychemy Jewelry.
This API requires an USER KEY, for access. If you are intrested in implimenting our apps on your site. Do contact us at [email protected].
For an Example of this app in action:http://www.polychemy.com/AppExample1/index.php
For the full API Refrnece guide, see here:
http://www.polychemy.com/php/PolychemyAPI.php
1)Authenticate your self with your [USER KEY]
2)Send a request to customize Polychemy Jewerly. (material, size, custom text, Jewlery type etc)
3)Our system will create a 3D Model of the Jewlery you requested. A link to download a low res OBJ file will be returned to you. (alternatively you can request a turntable render instead)
5)Display your custom 3D Jewelry Design on a browser with WEBGL, or just show still images.
4)Place order on our Orde Que.
5)After payment has been cleared, we will manufacture and drop ship your Item.
Let's create a Polychemy Roman Ring in Sterling Silver with the name "Charles".
1) Authenticate your self.
Use your USER KEY to genrate a acess token that you can use on our apps.
Send a GET request to the following URL to recieve a 2 hour acess token:
http://polychemy3d.com/ModelDATABASE.php?getaccessKey=[USER KEY]
Where [USER KEY] is your user key.
*Keep your user key safe! It's best to request for Access tokens only on serverside scripts like PHP. DO NOT expose your USER KEY to the world wide web!.*
If Authentication is sucessful, you will recieve a numerical ACCESS TOKEN.
434234365
1) An Example request to the Polychemy Model Gen Server.
Next step is to customize the jewelry
Send a GET Request to our modelGEN server :
http://polychemy3d.com/modelGEN.php?TOKEN=3846283&script=RomanRing.py&turntable=false&material=Sterling_Silver&arg0=2&arg1=grace&arg2=grace
TOKEN- Your Uniqie access token. (See previous step)
script - The jwelry design type.
turnatble - option to render turntable.
Material Jewelry Material.
arg0 - unique variables required for this jewelry design. See API refrence Guide: here.
arg2 - unique variables required for this jewelry design. See API refrence Guide: here.
arg3 - unique variables required for this jewelry design. See API refrence Guide: here.
The JSNOP Response:
create3DModel(
{
"Output": "SUCESS",
"file": "DONE",
"material": "DONE",
"StillRender": "http://54.191.4.213/ModelDATABASE.php?getfile=PNG&ID=584351",
"FolderNumber": "584351",
"AppCallID": "108523",
"boundingX": "19.795589447021484",
"boundingY": "7.932041168212891",
"boundingZ": "19.830873489379883",
"volume": "0.3737025921655804",
"GoldPlateWholesale": "83",
"GoldPlateRetail": "109.99",
"SilverWholesale": "99",
"SilverRetail": "129.99"
}
);
Important Variables:
file - The URL to download the 3d OBJ file.
material - the material file assosiatd with this OBJ.
StillRender - A single still render of the genrated design in PNG with alpha.
Bounding X,Y,Z - The width, height and depth of the jwelry in mm.
Volume - The total volume ammount of this design.
WholeSalePrice - The wholesale price for this design.
Recommened Retail Price. - The recommened retail price for this design.
FolderNumber - Used to identify the model. Also known as the Model ID.
2)Downloading 3D Model File.
In the next step, we would want to download the 3d model file or stream it to a webGL viewer.
To Download the obj file send GET Request too:
http://54.191.4.213/ModelDATABASE.php?getfile=PNG&ID=584351
getfile - File type.
ID - The FolderNumber you recieve from the JSNOP response.
This will return the OBJ file for download.
And now you're done! All you need to do now is build a WEBGL viewer to view the 3D file, and a simple interface to customizae tthe jwelry
2b)Rendering a Turntable.
Rendering a still image turntable is especially useful if the user does not support WebGL.
set turntable variable too "True" (Case Sensitive) and our system will render 6 images of the jewelry design in different rotations (1 full revolution).
You can then download these PNG images (with alpha) and display it on your borwser if nessary.
Here's an example GET request that will trigger a turntable render:
http://polychemy3d.com/modelGEN.php?TOKEN=3846283&script=NameNecklace.py&turntable=True&material=Sterling_Silver&arg0=2&arg1=grace&arg2=grace
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=0
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=1
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=2
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=3
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=4
http://polychemy3d.com/ModelDATABASE.php?getfile=PNG&ID=700695&num=5
Where "ID" Is the FolderNumber you recive from the JSNOP response and "num" is the image number.
Coming Soon..