# Variable distance contour

Good morning,
Today I’m trying to create a variable contour for multiple non-planar surfaces. Because of I wasn’t able to manage only the “distance” parameter to reach my scope, I generated a more complicated algorithm that almost achieved my desired outcome: obtaining a single continuous line of ‘infill’ for each surface (IMG1a and IMG1b). However, as can be seen from the attached image (IMG2), the polylines do not all travel the same route. The problem seems to be related to the order in which the points are chosen, but I don’t know how to fix it.

Variable Distance Contour.gh (19.0 KB)

This troublesome pointy shape looks familiar

I can see the problem but don’t know how to fix it either, other than changing the angle of the projected lines to avoid it. See this image:

Due to the shape of the layers, there two areas (bottom right) where the colored lines “leave the building” so to speak, cutting across the curved shape. This leaves short sections of those lines at both ends, which is one of the problems. The other problem is that some of these are flipped, probably in the Project step, which messes things up in a different way.

I’ll post the file with my inspection tools, which you might find useful, especially ‘Tree/List Viewer’.

Also note two pink groups that appear to do the same thing. Connect Curves is simpler, eh.

See these two “leave the building” areas:

Please consider this model. It tries to fix two problems, though I realized at the last moment that it still has an “outside the building” issue. Can’t believe I didn’t notice that

It mainly does two things:

• Rotates and extends the projected lines.

• Flips alternate curves after Project.

Variable Distance Contour_2024Jan9b.gh (38.9 KB)

P.S. The “outside the building” issue is less serious in this case because it happens only with connecting segments instead of splitting the “primary” lines being connected.

2 Likes

because all the patches have the very same XY projection, instead of solving the problem for each patch surface, I would solve the problem for the case of your infill curve projected on XY plane, creating a sort of “perfect projected infill trajectory”, and only then I would give it a 3rd dimension projecting that again on each of the (untrimmed) patches

from this:

to this:

the only thing is, you had some shorter segments here:

they will be merged (still somehow identifiable, but merged)

Variable Distance Contour_Re.gh (23.4 KB)

2 Likes

Bravo! Very nice. It seems that Trim with Region is more well-behaved than Project with regard to preserving curve direction?

Sorry guys, it took me so long to answer, but I’m here now! Yes, @Joseph_Oster, you remember very well that problematic shape . However, it’s convenient to use it because it is the most difficult case. Once I solve it here, I can use the algorithm on other figures I’ve drawn (I hope) .

Thank you both for your help. From a first test on my entire algorithm, it is convenient to apply @Joseph_Oster 's solution, however, it is not excluded that the variants applied in @inno 's solution, as “trim with region” may be useful later.

I didn’t address the issue in the title of this thread: Variable distance contour

This model does that using Graph Mapper in a very flexible way. I also tried to use @inno’s method of completing the connected lines before they are projected to the untrimmed patch surfaces. The rotation feature remains in place but a bounding box is used around the projected outline that determines length of lines and distance between them. Much better

Variable Distance Contour_2024Jan11a.gh (31.8 KB)

1 Like

I’ve just finished my model adding the graph mapper as you did😎
However, thank you very much for all the other suggestions!!!

Funny that we ignored that, given the thread title.