Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active June 19, 2023 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 33 You must be signed in to fork a gist
  • Save madhephaestus/b6ebfe4bb8210bb61c8a to your computer and use it in GitHub Desktop.
Save madhephaestus/b6ebfe4bb8210bb61c8a to your computer and use it in GitHub Desktop.
/.project
/.classpath
/.cproject
/cache/
/*.class/.settings
/.project
/.classpath
/.cproject
/cache/
/*.class
/.settings
/.project
/.classpath
/.cproject
/cache/
/*.class
import eu.mihosoft.vrl.v3d.CSG
import eu.mihosoft.vrl.v3d.Cylinder
import eu.mihosoft.vrl.v3d.Hexagon
CSG simpleSyntax =new Cylinder(10,40).toCSG() // a one line Cylinder
//create a Cylinder
CSG myCylinder = new Cylinder(10, // Radius at the bottom
20, // Radius at the top
40, // Height
(int)30 //resolution
).toCSG()//convert to CSG to display ).toCSG()//convert to CSG to display
.movey(50)
//create a Cylinder
CSG pyramid = new Cylinder( 20, // Radius at the bottom
0, // Radius at the top
40, // Height
(int)4 //resolution
).toCSG()//convert to CSG to display
.movex(50)
//create a Cylinder
CSG hex = new Hexagon( 20, // Flat to flat radius
40 // Height
).toCSG()//convert to CSG to display
.movex(50)
.movey(50)
hex.setName("hex")
simpleSyntax.setName("simpleSyntax")
myCylinder.setName("myCylinder")
pyramid.setName("pyramid")
return [simpleSyntax,myCylinder ,pyramid,hex]
{
"locations": {
"simpleSyntax": {
"x": 10.0,
"y": 10.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
},
"myCylinder": {
"x": 104.29302412163052,
"y": 0.14330036795878698,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
},
"pyramid": {
"x": 3.5189981795381264,
"y": 20.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
},
"hex": {
"x": 89.52709725151706,
"y": -40.0,
"z": 0.0,
"rotation": {
"storage": {
"q0": 1.0,
"q1": 0.0,
"q2": 0.0,
"q3": 0.0
}
}
}
},
"bedX": 250.0,
"bedY": 250.0
}
@axiorare
Copy link

sympa csg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment