Skip to content

Polychemy's Model Generator API. Use this API to create and customize any of the available Polychemy Jewelry.

Notifications You must be signed in to change notification settings

Polychemy/modelGEN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 

Repository files navigation

modelGEN 2.01

Polychemy's Model Generator API.
The modelGEN API allows anyone to create and customize any of the available Polychemy Jewelry.

This API requires your IP to be white listed, 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

How Does it Work?

2)Send a request to customize Polychemy Jewelry. (material, size, custom text, Jewlery type etc)
3)Our system will create a 3D Model of the Jewelry you requested. A link to download a low res OBJ file will be returned to you. (alternatively you can request a turntable GIF render instead)
5)Display your custom 3D Jewelry Design on a browser with your WEBGL or any other display system of your choice.
4)Place order on our Order API. (Send us the Model ID as well)
5)After payment has been cleared, we will manufacture and drop ship your Item.

A Basic Example

Let's create a Polychemy Roman Ring in Sterling Silver with the name "Charles".

1) An Example request to the Polychemy Model Gen Server.
Next step is to customize the jewelry
Send a POST Request with variable "command", to our modelGEN server (http://polychemy3d.com/modelGEN3.php):

{
	"script":"RomanRing.py",
	"turntable":"false",
	"arguments":["Hellow","Sterling_Silver","6"]
}

And Example POST request in Javascript.

	//phase variables for post request.
				var Jewelry=new Object();
				Jewelry.script = "RomanRing.py";
				Jewelry.turntable = "false";
				Jewelry.arguments = ["Hello","Sterling_Silver","6"];
				
				//stringify jewelry object
				stringify = JSON.stringify(Jewelry);
				console.log(stringify);
				//this fucnction send a jsnop request to server. 
				//We will recieve the URL of the genrated model.
				
				  $.ajax({
						type:"POST",
						url: "http://polychemy3d.com/modelGEN3.php",
						dataType: "json",
						data:{command:stringify},
						success: function (response){
							//reponse is a JSON object with required information to download OBJ file.
							create3DModel(response)
							
						}
					});

script - The jwelry design type. See API refrence Guide: here.
turnatble - option to render turntable. "True" to render GIF animated turntable.
arguments[0] - unique variables required for this jewelry design. See API refrence Guide: here.
arguments[1] - unique variables required for this jewelry design. See API refrence Guide: here.
arguments[2] - unique variables required for this jewelry design. See API refrence Guide: here.

The JSON Response:

{

"Output":"3D CHACHED OUTPUT",
"file":"http://polychemy3d.com/ModelDATABASE.php?getfile=OBJ&ID=684923917",
"material":"http://polychemy3d.com/ModelDATABASE.php?getfile=MTL&ID=684923917",
"StillRender":"http://polychemy3d.com/ModelDATABASE.php?getfile=JPG&ID=684923917",
"FolderNumber":"684923917",
"GIFRender":"http://polychemy3d.com/ModelDATABASE.php?getfile=GIF&ID=684923917",
"AppCallID":64,
"ModelData":{
"offsetX":"0",
"offsetY":"0",
"offsetZ":"0",
"boundingX":"19.14330291748047",
"boundingY":"19.143306732177734",
"boundingZ":"7.820871353149414",
"volume":"0.369319277103568"
},
"MetalWholesale":{
"Sterling_Silver":73,
"Solid_Gold_14k":171,
"Solid_Gold_18k":514,
"White_Gold_18k":514,
"Rose_Gold_18k":514,
"Palladium900":266,
"Platinium999":534
},
"MetalRetail":{
"Sterling_Silver":99.99,
"Solid_Gold_14k":229.99,
"Solid_Gold_18k":669.99,
"White_Gold_18k":669.99,
"Rose_Gold_18k":669.99,
"Palladium900":349.99,
"Platinium999":699.99
},
"JemWholesale":{
"Diamond":76.5,
"Black_Diamond":30.6,
"Ruby":30.6,
"Blue_Sapphire":25.5,
"Yellow_Sapphire":51,
"Pink_Sapphire":51,
"Emerald":71.4,
"Aquamarine":15.3,
"Peridot":2.04,
"Amethyst":2.04,
"Fire_Opal":10.2
},
"JemRetail":{
"Diamond":78.03,
"Black_Diamond":31.212,
"Ruby":31.212,
"Blue_Sapphire":26.01,
"Yellow_Sapphire":52.02,
"Pink_Sapphire":52.02,
"Emerald":72.828,
"Aquamarine":15.606,
"Peridot":2.0808,
"Amethyst":2.0808,
"Fire_Opal":10.404
}
}

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.
GifRender - A rendered GIF turntable with a white BG.
Bounding X,Y,Z - The width, height and depth of the jwelry in mm.
Volume - The total volume ammount of this design.
MetalWholesale - The wholesale prices for the different aviable metals.
MetalRetail. - The recommened retail price for the different aviable prices.
FolderNumber - Used to identify the model. Also known as the Model ID.

With this information you should be abelto download the OBJ file to your display system.
During checkout, be sure to pass the FolderNumber to us, for manufacture.

About

Polychemy's Model Generator API. Use this API to create and customize any of the available Polychemy Jewelry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published