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.
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: