Changing Curves Corner Start points

Curves.gh (7.4 KB)

I’m working on a project where users import orthogonal curves made with polylines into CAD. For now users must draw the polylines starting at the marked red point and following a counter-clockwise direction. My question is how can I tell Grasshopper to read any polyline and set the origin point at the marked red point? This red point is always located at the upper leftmost point of the region.

A bit unclear what you’re after. Your start point is already where you want it.

1 Like

Yes, but this will not always be the case. Users will draw polylines starting at random points.
Thanks

There is a Pufferfish component that can partially solve the problem.
The origin point setting depends on the position of point A.
seam.gh (23.1 KB)

1 Like

this example here makes me understand leftmost wins over topmost:

the top part of the definition just takes your original curves -which are mostly already correct- and shuffles the points so they are all incorrect
this way we have a “wrong starting point scenario” to adjust (mind: you don’t need that part of definition, as your curves already comes -eventually- shuffled)

the second part of the definition (that is the one you might be interested in) takes the two leftmost points (the ones with minimum X coordinate in each curve) and of those two points finds the one with highest Y coordinate: that point must be the starting point of your polylines, so the definition Shifts the point list in such a way it becomes the index=zero of your list, from which Polylines are recreated:

Curves_inno.gh (20.1 KB)

[this definition does not use any 3rd party plugin -or at least not that I’m aware of- ]

1 Like