# Mesh Edge Sorting

After some searching, I learned this is somewhat of a well-worn topic. Alas, I wasn’t able to formulate a solution from my findings - perhaps some fresh eyes could point me in the right direction or confirm whether this is doable or if I need a different approach.

I’d like to unify the order of the 4 edges along each mesh face. I’ve tried to sort them radially on the plane upon which they are drawn, but _

sort edges_sandbox_v3.gh (778.5 KB)

The form is tricky, making it tough to find a rule that can apply to all of the faces that would help with the sorting. Sorting radially doesn’t go far enough - a polyline drawn through the sorted mid-points completes the square properly, but the starting point varies which is not desirable. Grateful of any insight!

Maybe you could use the direction & angle (in relation to plane x/y axis) of a vector from plane origin to edge mid point or vice versa for sorting?

You gave up on making it isothermic? that’s a shame! the faces are quite rectangular now.

What do you need the edge sorting for?
Kangaroo’s ‘MeshDirection’ component sorts them so that edges 0 and 1 are in the warp direction and 2 and 3 are in the weft direction. For things like breaking into strips this is all that’s needed.

However, it doesn’t distinguish between ‘up’ and ‘down’ along the warp/weft direction. The same approach used could be updated so it does though (for meshes where it is possible).

Note though that the meshes where it is possible for the directions to be fully matched (not just warp/weft, but also direction along each warp/weft strip) are even more limited.
Only valence 4n saddles are permitted, while this model has valence 6, so there’s no possible way for the directions to match around these.

You can split quad meshes into regions though and match fully within each 4 sided patch.

2 Likes

Absolutely not! I want to make you proud Just need to get some connection details worked out to advance the fabrication part of this project. My hope was to circle back to the isothermic attempts once that was underway. Believe me, I’ve given it my best shot thus far!

This will be fabricated using a 5-axis waterjet. We’re testing some edge-to-edge connections that require a bit of swarf cutting to prevent rotation in the parts once assembled.

1 Like

… curious about your patching strategy. I ended up with 36 of them, which seems to allow enough manual control over the face directions to get some good flow along the surface.

Something tells me your version above was probably more efficient, especially since I’ve resorted to using a string of MeshDirection and MeshTurn components to get this to work (each patch needs its own custom chain – eeek!) Maybe a modification to this component that allows for control over the number of turns could be useful though?

No matter how it’s broken down though, there will always be several seams that have opposing directions. Makes sense, but still interesting.
the harlequin:

Related - I love how the directions start horizontal on one end, and end up vertical on the other - lovely! Thinking the strip “patches” may be a nicer way to reveal this.

This process reminds me that there is still much more work to be done on the base topology. In the harlequin above, the top is broken into 8 patches with the bottom into 4 (fine, but not great). Still working on the version that brings 8 congruent patches into a single valence 8 at the center of the saddle.

Helpful info. But how does something like the below happen? MeshDirection seems to reconcile some instances like this within a single mesh, but not others … (the darker areas shows the result of passing the cyan mesh through the Stripper for further reference).

2 Likes

Thanks danielbent. I think this is what I tried originally, if I’m following you correctly. I think one of the issues is that the plane axes are not the same throughout - so the x vector for example, flips around for many of the faces.

I didn’t check the file and didn’t know that this was still about the costa surface, from the image I thought it could be some kind of cone and the problem was to find the right starting edge after radial sorting. Your are right if the planes start flipping this wouldn’t work anymore. My apoligies.
Looks great by the way hope you post the fabricated result

Ah yes, I’m wondering now if it was in poor form to post this as a separate thread. I hadn’t expected the issue to be so related to the costa and Kangaroo specific, but perhaps it is …
No apologies necessary, and thanks!

Yes, it’s fascinating isn’t it. This was actually one of the examples I used when I first introduced the warp/weft sorting component:

I also like the way the diagonals look, as it doesn’t make the top/bottom ends so different:

When I said patches though, I actually meant something much simpler - just dividing it into quarters is enough to allow consistent strip directions (shown on the left is the flattened map):

For patches like this without any interior irregular vertices it should be possible to get everything consistently oriented and ordered (both face order and vertex order within faces). I’ll see about adding a script or component for this.

For now though, you could get a face ordering for each strip by joining its naked edges, splitting that (with the SplitAtCorners component), taking the longest side, and sorting the faces by their parameter along that.

3 Likes

Thank you, Daniel. As ever, I really appreciate and enjoy the exchange!
I hadn’t seen that old post introducing the warp/weft component until today! I also played around a bit with the diagonals a ways back - so nice!

The quarters is so much simpler - I see now how this works to make consistent strips. But with my mesh (perhaps this is different for yours), I’m getting inconsistent directions / vertex ordering out of MeshTurn.

*maybe this is to be expected?

While painfully manual and horribly clunky, the patchwork above did allow for a decent idea to emerge in terms of how panel orientation can reveal something about this surface. The locations of the opposing directions are where you’d expect them to be. Maybe it’s possible to automate this within the quarters, but I haven’t gotten past the inconsistent vertex ordering within the larger chunks.

Tried an alternate technique for sorting the face edges which seems to work nicely - slightly adjusting the seam of a circle normal to the plane.
Daniel, your suggestion to order the strip faces based on the the longest naked edge gave me the idea to use the individual segments to align the planes according to whichever direction is desired.

Not sure how robust it is, but here’s the file for anyone interested.
sort edges_sandbox_v6.gh (33.4 KB)

2 Likes

Hi @Nick_Bruscia,
Sorry for being indiscreet again
You may get some inspiration for the mesh directions from the NURBS topology.
Please find attached the UV Curves of a Costa Iso Mesh
Costa Iso_UVcrvs.3dm (3.1 MB)

2 Likes

Thanks, @Jess!