Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active March 26, 2022 15:57
Show Gist options
  • Save madhephaestus/ca2cfbba52c848da45e7 to your computer and use it in GitHub Desktop.
Save madhephaestus/ca2cfbba52c848da45e7 to your computer and use it in GitHub Desktop.
/.settings
/.project
/.classpath
/.cproject
/cache/
/*.class
{
"under breast to waist": {
"name": "under breast to waist",
"options": [
"120.0",
"1.0"
],
"value": 101600
},
"waist high hip": {
"name": "waist high hip",
"options": [
"120.0",
"1.0"
],
"value": 101600
},
"high hip": {
"name": "high hip",
"options": [
"120.0",
"1.0"
],
"value": 990599
},
"low hip": {
"name": "low hip",
"options": [
"120.0",
"1.0"
],
"value": 1041399
},
"waist to top back": {
"name": "waist to top back",
"options": [
"120.0",
"1.0"
],
"value": 177799
},
"underbust": {
"name": "underbust",
"options": [
"120.0",
"1.0"
],
"value": 863599
},
"waist": {
"name": "waist",
"options": [
"120.0",
"1.0"
],
"value": 762000
},
"waist to pubic bone": {
"name": "waist to pubic bone",
"options": [
"120.0",
"1.0"
],
"value": 152399
},
"waist to bottom back": {
"name": "waist to bottom back",
"options": [
"120.0",
"1.0"
],
"value": 171450
},
"number rows or rivets": {
"name": "number rows or rivets",
"options": [
"1",
"2"
],
"value": 2000
},
"number of panels": {
"name": "number of panels",
"options": [
"12",
"4"
],
"value": 8000
}
}
CSG makeCube(){
//Set up som parameters to use
xkey = new LengthParameter("X dimention",30,[120.0,1.0])
ykey = new LengthParameter("Y dimention",30,[130.0,2.0])
zkey = new LengthParameter("Z dimention",30,[140.0,3.0])
sphereSize = new LengthParameter("Sphere Size",30,[150.0,4.0])
//you can also create parametrics that are not used in creating primitives
offset = new LengthParameter("Sphere Offset Distance",15,[20,-5])
//build geometry with them
def cube = new Cube(xkey,ykey,zkey).toCSG()
sphere = new Sphere(sphereSize).toCSG()
//apply moves based on the valeus in the parameters
distance = xkey.getMM()/2-offset.getMM()+sphereSize.getMM()
cube=cube.union(sphere.movex(distance))
return cube
.setParameter(offset)// add any parameters that are not used to create a primitive
.setRegenerate({ makeCube()})// add a regeneration function to the CSG being returrned to lonk a change event to a re-render
}
//CSGDatabase.clear()//set up the database to force only the default values in
return makeCube();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment