Diagnosing data conversion issue

Hi, so I’m using Rooster to generate some paths/vectorize an image. I’ve gotten pretty far, but all of a sudden I end up getting a “1. Data conversion failed from Curve to Surface” error straight out of the Rooster component:
Screenshot 2021-06-15 123847

The data doesn’t show me what’s wrong, but when I internalise data, somehow it shows me more info:

Now I don’t understand why the data is displayed differently when I internalise it, but somehow it is so.

This error only happens sometimes. For example, when I change the amount of colors in the Rooster component, it sometimes doesn’t spit out erroneous data, like when setting the colors to 5:

Does anyone know how I can troubleshoot this data? I tried Clean Tree but it doesn’t want to work on my data:

Find the specific set of curves here:
nulltree.gh (441.9 KB)

I hope someone knows the answer. I’m so close to finishing this definition I’m working on (I can’t believe I already got this close!), everything else I created so far in my current project, I managed to get working, but this one is throwing me a curveball.

Thanks for your time,

The curve in path 0 has two self intersections. Easy fix: bake the curve and manually correct the intersections

self_intersections.gh (447.9 KB)

Thanks for your reply, would there be a way to fix this without baking? I’m doing quite a lot of complex operations on the curves after the initial generation. It would be quite a lot of work to manually fix these because I have to run a lot of simulations to know which images work with what comes after the generation of the initial paths.

I took some time to investigate if there is a good way of trimming the self-intersecting parts, but I didn’t manage to find a definitive answer.

The answers in here didn’t work:

I did try smoothing the curve a little:

This did get away some of the intersections, but the issue is that now the curves are too segmented. I really need them to be smooth curves. Also, this messed up the tree structure too much.

Plug the tree in Tree input not in Remove Nulls

1 Like

I don’t think there is a simple solution for an automatic elimination of self intersections.

1 Like

Awhhh, I was afraid of that.
Could it for example work if I offset the curves by a small amount and then offset them back?

I don’t specifically need simple, how complex could it be? Would it be possible to detect the intersection, add two points on the curve, remove the short part between those points and then join them somehow?

This will work in some situations…

self_intersections.gh (444.3 KB)

1 Like

Actually… try this:

self_intersections_region_intersection.gh (450.9 KB)

1 Like

When i work on script to find equal distance , the script accidentally find self intersection points and cull unnecessary points, i don’t know how this work or how to improve it , but maybe it help.

self inters.gh (12.5 KB)

1 Like

Thanks so much for your solution. Not sure if it works on the entire dataset. I am getting a spinning beachball (of death), can it be this setup should only be used on the curve that is self intersecting? It’s currently been about six minutes since I connected the snippet, but it’s still stuck. It’s not supposed to be going for this long right?

Meanwhile I’ll restart Rhino and see what Seghier Khaled’s solution provides.

Oh, it finished, but didn’t work, maybe I’m doing it wrong?

That looks great, how do you think this could work on a data tree? I tried implementing this, but it doesn’t work when plugging in the whole tree. I tried flattening it, but it didn’t work.

The input for one curve only , i will try to use list

I think it works if you separate the input in good curves and self intersecting curves.

self_intersections_region_intersection.gh (172.3 KB)

1 Like

Thanks a lot Martin, I will try this out. I think this is the definitive solution. I will have to reconstitute the tree again, but I already managed to do that within my current file:

I think I’ll manage from here. Once I get it all set up correctly I’ll share some of my artwork :slight_smile:

1 Like

Use Graft in Curve input