GH tool needed: sel bad object and sel self-intersecting curve

Hi, I need the “sel_bad_object” tool for grashopper.
I want to set up a GH file that highlights problematic lines, so I can repair them in Rhino.

I often need to repair imported Illustrator drawings (AI). These can have 1000 lines in one document. I cannot attach a file, but you can imagine a designers handdrawing with tons of curves.

I do not know why, but Illustrator often produced dublicated lines (that are not recognized by sel dubliyted though). If you join two (almost) dubilicated curves they get closed what causes bad objects in the further process. If I can quickly dispatch them within Grasshopper it will be a great help.

2nd tool: sel_self_intersecting_curve: When a curve makes a loop and ends on itself it is self-intersecting that can cause problems in the further process. Any ides how I can quickly find out that one end of the curve touches itself in the middle?
I can imagine to devide the curves and measure the distance to the end points, but maybe there is ssomething much easier.

Thank you for ideas. Regards, Stefan


I’d select few lines of your work and share it if I’d expect a good solution :slight_smile:

Not sure I get you first tool right, but I’d test out coordinates of the points with tolerance and the remove the line if all the points coordinates fall into the tolerance. But there might be better solutions depending on the actual situation.

Second tool : Use Curve|Slef. If a list of point is empty, it’s fine. If not empty, the curve/pline self intersects. Use larger than 0, rather than equals to 0 (general tip :slight_smile: )

Hi Antoine

1st tool: I just need a grasshopper transcription of the Rhino tool: SelBadObject.
Just take a simple line, duplicate it and join both. Now insert into Grasshopper and extrude. You will get an invalid object.
Like this I identify dubpilcated lines from a bigger list of lines, but I do not find a Grasshopper tool to dispatch them from the list. (For sure I can dispatch closed curves and check maually if they are supposed to be closed, but that is not yet 100% what I want)

2nd tool: Exactly what I need. It was too close to find it… Thank you.

I went a bit deeper, so let me share the result:
Illustrator Curve (36.1 KB)

At the end it was easier than expected. I have 3 types of curves that I want to identify:

  1. When a curve is duplicated and the joined it gets closed
  2. I do not like self-intersecting curves
  3. You cannot bake an invalid object (bake tool from Human). So if you cannot bake there is a problem with the curve.

With this small file I can help my designing friends easily checking their files on problems.
So: Question solved! Thanks.

1 Like