miho / JCSG

Java implementation of BSP based CSG (Constructive Solid Geometry)
Other
176 stars 52 forks source link

Creating pyramids #19

Open aghasemi opened 8 years ago

aghasemi commented 8 years ago

Hi, Do you have any examples of creating pyramids and intersecting them with each other? Thanks Best

madhephaestus commented 8 years ago

the simplest way would be to use the Cylinder primitive, set the top radius to 0, and the bottom to your pyramid side length, then set the number of faces to 3 or 4 depending on what sort of pyramid you want.

CSG pyramid = new Cylinder( 20, // Radius at the bottom 0.001, // Radius at the top 40, // Height (int)4 //resolution ).toCSG()//convert to CSG to display