How to Clean Self Intersecting Curves

Good Morning All,

We have a file which has numerous examples of self intersecting curves.

How would you go about cleaning up a file which has dozens of such curves?

I am very happy to script something I’d really like to learn which tools and methods you experts would recommend to find and correct these modelling mistakes?

(in case you are wonderering these geometeries are panels for boat sails and come (through many steps) from 1980’s era design software. I’d love to fix the issues at source but it is just not an option.)

self-intersecting.3dm (66.3 KB)

SelSelfIntersectingCrv

CurveBoolean will get the easy ones.

The tricky ones will need to be manually fixed.

SelSelfIntersectingCrv selects all in the file

IntersectSelf will put a point at the intersection

1 Like

Thank you @Japhy

CurveBoolean solves 4 / 5 of these examples.

On the first of the five examples it fails and deletes the whole shape - any idea why?

the first one is particularly troublesome.

Removing the controlpoint works but you will want to ensure that it’s within your tolerances after.

I have an idea but I am now not near to a computer to try: make a surface underneath the curve, and then split the surface with those curves, after splitting, delete the curves. Next is to extract surface edge- then it will be a curve without self intersecting.

Please give it a with Simplify Curve + Boundary Surface + Brep Wireframe, and for your reference.
SelfIntersecting.gh (11.9 KB)
SelfIntersecting

2 Likes

Thank you @jessesn this approach works well, It looks like the Boundary Surface component is doing the heavy lifting for us here.

Which methods in RhinoCommon would be the equivalent of `Boundary Surface` component ?

Please give it a try with CreatePlanarBreps
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/createplanarbreps

found this workflow on the forum a couple years ago for a similar problem, can’t find the thread again:

  • SelSelfIntersectingCrv
  • Explode
  • CrvBoolean (delete all, click outside the region[s], ie negative space)
  • Explode
  • CrvBoolean (delete all, click inside the region[s], ie positive space)

Thanks, I have tried `CreatePlanarBreps`, unfortunately it seems to pass the self-intersecting curve through unchanged.

I also tried Curve.CreateBooleanRegions which does succeed at the cleanup of all of these examples.

Many thanks all :grinning_face_with_smiling_eyes:

1 Like