Page 1 of 1

Boolean Operation in 2d

Posted: Fri Oct 22, 2021 12:16 am
by Ensar
Hi,

I am trying to do a simple boolean operation in 2d. Essentially, all I need is the common area between an ellipse and a polygon. I could not find a way do this directly in 2d. Does anyone know a method here?

Thanks for the help.
Cheers,
Ensar

Re: Boolean Operation in 2d

Posted: Mon Oct 25, 2021 5:15 am
by Prashant Kande
Hi Ensar

There are no specific 2D Boolean operations, but is is easy to do. You need to linearly extrude all objects along z. For that build a 3D wire first from your objects with z=0 in all input points. And do the extrusion. See the Surfaces sample. After the Boolean operation the result will also be the same kind of extruded object. So you need to find the top face(s) by its normal (0, 0, 1), discard all z coordinates and this will be your result.

I recommend making extrusion length different for all objects to avoid coplanar surfaces. Boolean ops do not like it.

You could whap this into a class for 2D bool ops.

Regards