Making my own GrassHopepr components with VB.NET I will be gradually translating and tilting Brep boxes and cylinders “in blind code”, and need a way to determine their orientation when a number of iterations are done.
I’ve tried examining the orientation of Brep boxes and cylinders in different ways using surface Normals and corners, but it seems that neither Box corners nor surfaces comes in fixated order. For example, if I have a Box with the (bottom) corners in a certain order (say CCW around the bottom) and then generate a BoundingBox around the first Box and examine the corners of the BoundingBox, then it doesn’t nessecarily return the corners in the same order. (also, if exploding a Box and joining it again the corners and surfaces ends up in arbitrary order).
I had planned to use either the corners, or the surfaces (normals) to determine the inclination degrees of Boxes and Cylinders, but if both the surfaces and the corners are returned in arbitrary order (for example using
GetCorners()), how can I determine the oreintation of an object? **
I will need to know the orientation of Box relative to its start orientation** since the Box may have other objects associated with it, which means that even a perfect cube Box - if tilted 180 degrees - will be considered “upside down”. But how can I know that it’s upside down by examining the cube if it isn’t given which surface is considered being the original “top” surface?
I conclude that I will have to rethink the entire strategy for determining 3D orientation, so I am listening carefully to advice from experience.