miho / JCSG

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

Split in two objects after difference #58

Open iibPScheich opened 4 years ago

iibPScheich commented 4 years ago

Hello and thanks for your work, I am struggling with a little problem. Is it possible to split an object in two by building the difference with another object.

Screenshot from 2019-12-03 11-10-01 Screenshot from 2019-12-03 11-10-39

How can I split the green object in two CSGs? I want to keep the lower part.

Thanks.

madhephaestus commented 3 years ago

Make a much larger rectangle that encompases the upper section. Perform an intersection to make the upper shape and a difference to make the lower shape.