First things first !
sudo apt update
sudo apt upgradesudo apt-get install build-essential git| double size =40; | |
| CSG cube = new Cube( size,// X dimention | |
| size,// Y dimention | |
| size// Z dimention | |
| ).toCSG() | |
| //create a sphere | |
| CSG sphere = new Sphere(size/20*12.5).toCSG() | |
| // perform a union | |
| CSG cubePlusSphere = cube.union(sphere); |
| double size =40; | |
| CSG cube = new Cube( size,// X dimention | |
| size,// Y dimention | |
| size// Z dimention | |
| ).toCSG() | |
| //create a sphere | |
| CSG sphere = new Sphere(size/20*12.5).toCSG() | |
| // perform a union | |
| CSG cubePlusSphere = cube.difference(sphere); |
| //create an extruded polygon | |
| CSG polygon = Extrude.points(new Vector3d(0, 0, 40),// This is the extrusion depth | |
| new Vector3d(0,0),// All values after this are the points in the polygon | |
| new Vector3d(80,0),// Bottom right corner | |
| new Vector3d(60,40),// upper right corner | |
| new Vector3d(20,40)// upper left corner | |
| ); | |
| return polygon |
| //CSG simpleSyntax =new Cylinder(10,10,40,(int)30).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 |
| //create a sphere | |
| CSG sphere = new Sphere(40)// Spheres radius | |
| .toCSG()// convert to CSG to display | |
| return sphere |
| //create a rounded cube | |
| CSG roundedCube = new RoundedCube( 40,// X dimention | |
| 44,// Y dimention | |
| 50// Z dimention | |
| ) | |
| .cornerRadius(4)// sets the radius of the corner | |
| .toCSG()// converts it to a CSG tor display | |
| return roundedCube |
| return new Cube( 40,// X dimention | |
| 60,// Y dimention | |
| 200// Z dimention | |
| ).toCSG()// this converts from the geometry to an object we can work with |
| class SampleMaker implements IParameterChanged{//collection of parts | |
| ArrayList<CSG> parts = null; | |
| boolean loading=false; | |
| ArrayList<CSG> makeSamples(){ | |
| if(parts !=null){ | |
| return parts | |
| } | |
| loading=true; | |
| double myStartSize = 40; |