-
-
Save acamilo/6ee1d65844b51eb3486c6f09ed80148c to your computer and use it in GitHub Desktop.
JavaCadExample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eu.mihosoft.vrl.v3d.STL; | |
import eu.mihosoft.vrl.v3d.RoundedCube; | |
import com.neuronrobotics.bowlerstudio.vitamins.*; | |
import eu.mihosoft.vrl.v3d.parametrics.*; | |
float len = 68; | |
float width = 70; | |
float height = 42; | |
float thickness = 6.35; | |
float dia = 15; | |
CSG cavity = new Cube(len,width,height).toCSG(); | |
CSG shell = new Cube(len+(thickness*2),width+(thickness*2),height+(thickness*2)).toCSG(); | |
CSG neck = new Cylinder( dia/2, // Radius at the top | |
dia/2, // Radius at the bottom | |
thickness+2, // Height | |
(int)80 //resolution | |
).toCSG().movez(height/2); | |
CSG box = shell.difference(cavity); | |
CSG box2 = box.difference(neck); | |
return box2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment