Skip to content

Instantly share code, notes, and snippets.

@acamilo
Forked from madhephaestus/.gitignore
Last active June 3, 2016 01:30
Show Gist options
  • Save acamilo/6ee1d65844b51eb3486c6f09ed80148c to your computer and use it in GitHub Desktop.
Save acamilo/6ee1d65844b51eb3486c6f09ed80148c to your computer and use it in GitHub Desktop.
JavaCadExample
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