Edge Orientation on a Rectangle
-
Hello all,
I have a script that i have been running quite frequently for quite a few months. It seemed to work nicely and consistently, but now it has suddenly changed and I'm wondering if it has something to do with the start and end positions of edges on rectangle faces being changed. I'll explain a bit more...
So, my plug-in would require the user to draw a rectangle and select the two edges between the point/vertex where the rectangle was initiated (after some time I found the convention of how the edge vectors were oriented). But since mid-January this convention has suddenly changed (I think) and the layout that is drawn on top of this rectangle and depends on this orientation has changed.Am I imagining this?
Does anyone have any insights on this?laura
-
I'm not sure you can make any assumptions about edge direction. Perhaps when first creating the rectangle.
But once geometry has started intersecting, there is no way to guess what SketchUp has done.
The bottom line is if your plugin requires a certain order, you must check and correct the geometry; or write the plugin so it is not dependent on the order.
-
And I've found that if you draw a line and test it's vertex order, then copy and paste the line, the new line will not always keep the same direction. Same for more complex shapes such as a rectangle, etc. The copied shape will often get all dis-organized. Recreating the order of the edges endpoints, in order, is how I generally tackle this.
Chris
-
If the rectangle has a face then
face.outer_loop.vertices
are always listed counterclockwise [right-hand rule].
You can test if a face and its edge are 'reversed?' too...
Advertisement