Entities.add_face - does order matter
-
-
Hm... I'm curious, does edge order control the face winding, which side is the "back side" or the "front side"? I assumed so, but maybe SU just makes some assumptions based on the overall geometry...
-
@avariant said:
Hm... I'm curious, does edge order control the face winding, which side is the "back side" or the "front side"? I assumed so, but maybe SU just makes some assumptions based on the overall geometry...
i am pretty sure the order of points controls the front side of the face
-
The order definitely matters. And its not discussed in the Ruby docs, as far as I know. Its even more important if its followed by a pushpull. I seem to recall you want to enter your points clockwise when creating a face. If you enter your points anticlockwise then a pushpull will produce an object with the faces reversed.
-
If you visualize the face you are creating as being drawn CCW, then when the face is created, you'll be looking at the front.
If you visualize the face and you draw CW, you'll be looking at the back when the face is created.
Faces created on plane z=0 will always have their normal pointing towards -Z.
Todd
-
You can test this by hand too. Establish a front elevation, and with the line tool, draw a box. CCW you'll get white. CW you'll get blue.
-
So the order matters for what's side is being up or down?
But does it matter for the face being created? Should all edges be organised so that edges connected to each other comes after each other in the array passed?
-
@thomthom said:
So the order matters for what's side is being up or down?
Well, depending on if you care what the orientation of the face normal is, yes. An alternative approach is to just draw the face, and then figure out out if it has the normal you want, and if not, .reverse! it. And, remember it's not about "up or down". It's all about direction. On a typically drawn cube, you have 6 faces, each pointing in their own direction, having opposite faces pointing in opposite directions.
@thomthom said:
But does it matter for the face being created? Should all edges be organised so that edges connected to each other comes after each other in the array passed?
This is a most fundamental concept - it absolutely makes a difference. Trying to draw a four sided face with two points swapped will give you an hourglass shape with overlapping, non-intersecting lines, and possibly even an invalid face.
-
Ok, I had a feeling something like that happened. Just wasn't sure if SU sorted the edges before generating.
-
You are very welcome.
Advertisement