View Full Version : Measuring angles of edges of a polygon

01 January 2009, 11:12 PM
Say you have a trianglar polygon in 3D space, is there any way I can retrieve:

1) the angle of one edge of the polygon with respect to another edge of the polygon (effectively in 2D), and...
2) the angle of an edge (indeed any edge) with respect to the global angles of X, Y and Z?

Is it also possible to measure distances of edges?



01 January 2009, 04:41 AM
everything you need is in the XSIMath library and ActivePrimitive.Geometry ->

are you referring to the actual math process or example use of the api to achieve these?

01 January 2009, 07:32 PM
Hi Strang,

Unfortunately I'm completely new to XSI, indeed to any modern ray-tracer. The learning curve is perpendicular. I'm currently trialling it alongside Maya, but am liking XSI more.

I've already created my polygons, it's a geodesic sphere (triangulated poly-mesh sphere primitive). I just wanted to be able to obtain the angles of the edges (of the polygons) with respect to each other, and also against the global XYZ axes. And also the lengths of each edge.

I can't initially seem to find any dedicated measuring tools. Sadly I'm unfamiliar with the terms you mentioned. I understand API is regarding scripting but am currently unsure as to how to use it in this context, accessing the Help (F1) and searching specific terms proved unfruitful.

Any titbits would be of great help, thank you!

01 January 2009, 01:11 AM
More important would be to know what you need or want to do with the angles.
Single angles are seldom of any relevance since in 3D space they need to be part of a more complex system that takes into consideration other things as well.

For divergence usually dot products are a lot more telling and much faster to deal with (trig can be dog-slow to compute on massive data sets).

So, what do you want to ultimately do with them and how often do you need to do it? And are you after a script, writing one yourself for learning purposes, or just (no matter how laborious) a little rig to read those angles once in a while?

CGTalk Moderation
01 January 2009, 01:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.