Fast 2D Curve Booleans in Ordinary Rhino Workflows

I’d like to boolean two sets of complex curves. All curves are closed, disjoint, non self-intersecting, and co-planar. But there can be dozens of them. Is there a fast and automatic way to do this outside of grasshopper?

So far I’ve:

  • developed a workaround using extrusions and solid boolean operations, but haven’t turned it into a script yet.
  • I’ve found Clipper’s BooleanPolyline function - this showcases the functionality I’d like to have, but lacks full nurbs curve support.

Current Practice

For boolean union I can use _curveboolean _pause _allregions.

For boolean difference I do:

  1. Use _ExtrudeCrv _Solid=yes with distance 1 for set A, and 0.5 for set B. Creates two sets A’ and B’ of solids.*
  2. Use _BooleanDifference to create a set of solids C’ = A’ - B’.
  3. Create plane P in the construction plane, containing the projection o C’
  4. _Intersect P and C’. Gives result C = A - B.

Intersection is similar.

I think the intermediate shape is rather fun! However I’d like to make the technique less manual. This message is to check if it’s already done. Thanks!

*) I use a 0.5 extrusion height for B’ in order to avoid the boolean difference failed error, which happens if any solid in B’ fully contains some solid in A’.

Should be quite easy in Python You could even make it so you don’t even need to select your objects if they are sorted on the right layers.

Thanks @siemen! As always @Helvetosaur is a hero!

I’m working on adding support for internal holes in the profile sets, based on Helvetosaur’s code. I will publish the code when it’s done.