2
$\begingroup$

How to unify the direction (Tangent direction) of a curve, so that the size and face orientation of each window frame are the same after the curve is converted to mesh?

After the mesh is converted to a curve, the direction of the curve is chaotic. How can I unify the direction of all the curves. All curves are rotated counterclockwise relative to the mesh face normal.

enter image description here

enter image description here

enter image description here

$\endgroup$
0

1 Answer 1

3
$\begingroup$

Basically, you did everything right, but since the indices of your mesh are pretty messed up, the alignment of your curves is also messed up.

However, you can use a trick to straighten everything out:

enter image description here

  1. Use the node Extrude Mesh with an offset of $0$. This will create additional faces.
  2. Split the edges of the top faces with the node Split Edges.
  3. Remove the superfluous faces created by the extrusion with the node Delete Geometry.
  4. And then you can apply the remaining nodes as before, because with this all curves have a correct orientation.

Depending on the direction of your profile curve, you may need to add the Flip Faces node at the end to correct the direction.


Update

In your particular case, however, everything is obviously messed up, which is why the above solution doesn't work (as you yourself noted).

Therefore, you really need to correct the alignment of the curves beforehand.

To solve this you have to take the more complicated route and look more closely at the alignment of the individual segments of the curves, and then make the appropriate corrections.

In principle, you could solve part of the problem here with the node Reverse Curve, but unfortunately this simply reverses the direction of the points.

So to actually get a correct alignment of the curves, you would have to affect the Curve Tilt, and then correct the alignment of the normals on the generated mesh.

Variant 1

(This variant would be the exact answer to your question)

With this solution, I first look at the alignment of the individual segments of the splines, and use that to decide whether or not to rotate the Curve Tilt:

enter image description here

enter image description here

All in all, however, this is rather unnecessary work, because as I could now see in your file, you wanted to do something completely different anyway.

At least it is obvious in the file that you somehow wanted to create an extruded window frame.

If that's the case, you can actually solve this much easier, and the whole question as well as this extensive answer was totally superfluous.

So here are the simple solutions to your actual problem:

Variant 2

Simple extrusion of the mesh:

enter image description here

enter image description here

Variant 3

Solid extrusion of the mesh:

enter image description here

enter image description here

Variant 4

Curve to mesh with a closed profile (Thanks to @RobinBetts):

enter image description here

enter image description here

Here is the blend file you provided, which includes all four variants. ...choose the one that suits you best:

PS: ...and please share your blend file right from the start with your next question to make it easier for the lovely people here to answer your questions. Thank you!

$\endgroup$
6
  • 1
    $\begingroup$ Curiously, If you use a Curve Primitive > Quad profile in your Curve to Mesh, there's no problem. You would have thought that Mesh to Curve would use anticlockwise-around-the-underlying-face-normal to decide the direction of the curve. I wonder if this is reportable. $\endgroup$
    – Robin Betts
    Jun 29, 2022 at 10:52
  • $\begingroup$ @RobinBetts Thank you for pointing this out! I have updated the answer accordingly. $\endgroup$
    – quellenform
    Jun 29, 2022 at 11:12
  • $\begingroup$ Thank you for answered my question, maybe I didn't describe the problem clearly, I uploaded the blender file and added it. The direction of the curve of my file is not uniform. The problem I need to solve is that the curves are uniformly oriented counter-clockwise. $\endgroup$ Jun 30, 2022 at 3:39
  • 1
    $\begingroup$ @tallien1212 OK, that really looks like a bug though, and I honestly don't know why it works on my mesh and not yours. If I were you, I would just use my mesh. The curves in your example really do what they want, and don't follow any logical pattern. And aligning the curves on the basis of their tangents is also not enough, because Mesh to Curve also sets arbitrary starting points here. $\endgroup$
    – quellenform
    Jun 30, 2022 at 8:33
  • $\begingroup$ @ quellenform,Thank you very much, you solved the problem perfectly, your first answer, by keeping the first and second segment of the curve to determine the direction of the curve is really clever. As you said, the direction of the unification curve is superfluous, your 4th answer can simply solve this problem, I'm too stupid. Ha ha. Thank you very much, your answer is perfect. $\endgroup$ Jul 1, 2022 at 4:02

You must log in to answer this question.

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