Yeah, it is crucial to put question in right manner. The boundary of surface is always periodic. In the present situation, the surface is always coplanar. Only the polygon vertices are changing in terms of location and quantity. So nothing can be more straight forward than this.
The example surfaces should at least be skewed at various angles to prevent HFrames from working. The Rhino 7 file (which I won’t be able to access in a few more days) has both surfaces and some edge curves (blue in image below), which further confuses the issue, because without the surfaces, it isn’t obvious which way the vectors should be directed…
Geometry rotated like this would be a better test:
Like this:
Vector_2020Dec17c.gh (16.7 KB)
Adjacent curves are always coplanar with corresponding surfaces with vectors not going the same manner.
The coplanar surface with linear edges is the constant here. The border of this surface is always periodic. So, either of your solution is going to work, so does the offset method, provided the surface is coplaner.
So far the method with offset edges is working best in all of my cases (ca. 200 of them) but Jiseph method with feeding surface as a guide is also great or even better.
The HFrames solution will not work with the skewed surfaces in my last post.
If some edges are to be ignored, that can be easily arranged.
I am trying to rewrite part of my def to see if your solution applies here,
Yeah, right. I think that Piotr is dealing with only coplaner surfaces it seems.
Ok, I had misunderstood, I thought he was looking to order all the segments of a polygon in the same direction. Anyway, t’s much simpler and efficient than all this, take a tangent vector of the polygon in the position you want and compute the cross product with the normal direction (perpendicular to the surface). The cross product of two vectors is another vector perpendicular to both, if you want the other direction, just swap the inputs.
Going back to the begining of the thread it shows:
ONLY SOME EDEGES OF THE SURFACES - thicker lines
RANDOM DIRECTION OF THOSE CURVES - red arrows
This is were I was thinking of solution and where the offset works best.
In my attached example I was looking for perp vector of blue curves towards surfaces.
Above file works on any surface and it uses seperate edges. You can remove certain edges from this list and it will work as you expect. You need to add that part to cull some edges.
Clearly you are not matching the branches. Replace Merge with Entwine and delete the graft in the curve inputs.
Sorry, my bad, wired to quickly
There must be graph on
without it is a mess
still no desired result with this def
If you want to understand the problem then you have to work with my example. Working on a single surface by extracting it’s edges isn’t the best fit here.
Remove the graft from the CURVE inputs to match branches.
Dude, upload the fucking files! I stop wasting my time. 
Geez, the file has been ulpoaded quite early.
Blue curves, white surfaces, once again.perp vector test.3dm (55.2 KB)










