Extended curve ends elsewhere then it's trim?

I’m working on a street network script with offset street edges. I have trimmed the excess parts off with a region, for the building blocks (there is a lot of processing going on to make sure all curves meet and intersect). Though for the street outlines, I prefer to have clean curves, so I joined the trimmed-off ends back together, split them off and extended the original curves by the same length.

However, one of the more aggressively curved streets ends up elsewhere after the smooth extension, which I think is odd, because the curve that I am extending is basically the same curve as the part that was split off.


Any idea why this is happening and if there is a way to circumvent this?
Trim-Extend curve different endpoints.gh (14.2 KB)

being a Nurbs, the extension is based on the available/known control points

in black you see the original curve and its control points, which is trimmed to the sliding red point, and extended (white color)

the control point of the extended curve are in blue

extend_curve.gh (17.3 KB)

you will think that the curve in this example is much more complex than the one in your file :slight_smile: and I agree with that, but the core point is that you either know or not know where the next control point of a curve is :slight_smile:

as soon as the trimmed portion includes a new control point of the original curve, the extension part changes dramatically:

the only thing that comes to my mind is to simplify the curves, in such a way you end up with less control points that might create unexpected deviations after the trimming?

2 Likes

Inno, that explanation helps clarify what’s going on under the hood. Makes sense now why the extension behaves unexpectedly once a control point is involved in the trimmed section. I hadn’t considered how much impact those hidden control points could have after trimming. Simplifying the curves sounds like a good route to test, I’ll give that a try and see if it leads to more predictable extensions.

Thanks for the great explanation! I thought each curve followed a mathematic formula, meaning trimming wouldn’t affect the curve as the underlying formula would remain the same.
What I’ll be doing is compare the extended curve endpoints with the endpoint of the trimmed-off curve and when it’s within tolerance, I pick the extended curve. That way I get the cleanest curve whenever possible.

1 Like