Boolean Operation in 2d

Technical discussions
Post Reply
Ensar
Posts: 1
Joined: Fri Oct 22, 2021 12:11 am

Boolean Operation in 2d

Post 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

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Boolean Operation in 2d

Post 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

Post Reply