1
$\begingroup$

Problem Description

After splitting edges and scaling elements, when the 4 edges of a face are converted to individual curves, it seems that almost always one curve will have a tangent in the opposite direction.

For example, looking at the factor value from 0 to 1 from point "4" on the top face, it can be seen that:

4-5: clockwise
5-6: clockwise
6-7: clockwise
7-4: counter-clockwise

enter image description here

It can also be seen that when the tangent value is viewed, one curve is black while the others are white or vise versa.

enter image description here

Application Goal

Ideally, in this proof of concept, each instance would have:

  1. An axis pointing in the same direction as the curve (all uniform either clockwise or counter-clockwise)
  2. An axis pointed towards the opposite edge
  3. An axis pointing in the same direction as the original face's z-normal:

enter image description here

If this is accomplished, then, should the instances have an additional line rotated 135° from the line pointing towards the opposite edge, they should be parallel and point in the same direction:

enter image description here

enter image description here

I have referenced many questions, but these two seemed to be the most relevant (the first of which provided a node group that is in the blend file below thanks to quellenform):

How to correct curve tilt, tangents and normals of a curve?

Geometry Nodes: Whether the curve rotates clockwise or counter-clockwise?

Any help would be very much appreciated.

$\endgroup$

1 Answer 1

2
$\begingroup$

This group takes a different approach to yours. The strategy:

  • Create a Curve Line for every face-corner on the mesh
  • Set endpoint 0 of each spline on the sampled position of each corner of the mesh
  • Set endpoint 1 of each spline on the sampled position of each corner, offset by 1, in its face
  • Tilt each spline through the signed angle between its own Normal, and the underlying face normal

enter image description here

The result is 1 spline for each edge of the mesh, with its Tangent (Z) down the edge (anticlockwise to face-normal), and its Normal (X) set to the normal of the underlying face-corner. ( Y is constrained )

Here, shown with arrows instanced on the curves, aligned to the curves' 'Ŕotations'

enter image description here

In the case of rectilinear quads, -Y is the direction towards the opposite edge.

$\endgroup$
3
  • $\begingroup$ Wow. This setup even covers n-gons. What a brilliant idea to eschew trying to manipulate the original edges and just arrange new curves. As someone who is trying to learn more math for GN I really appreciate your explanations. Thank you very much. $\endgroup$ Jun 17 at 15:36
  • $\begingroup$ @bobhasajetpack Cheers! Forgive me for not going a bit further, with your 135° thing, but I didn't fully understand that, and figured step 1 might be enough. $\endgroup$
    – Robin Betts
    Jun 17 at 15:46
  • 1
    $\begingroup$ It absolutely was enough. The occurance of parallel 135° line alignment (assuming 90° corners) was just my hypothesis should the xyz of the curves have "correct" orientation. Sure enough, your answer was perfect imgur.com/a/MyuhoMB $\endgroup$ Jun 17 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .