Face Tilt and orientation
-
i'am new to Sketchup C/C++ SDK. I am creating a C/C++ program which gives me the geometry of a house model in Sketchup.I want to get the orientation of all the faces in the model and their Tilt. When I say the word 'Orientation' I mean to get the direction of every face relative to the N direction using the Axes in Sketchup and when i say Tilt i mean the degree of each face' tilt in the grey roof in this example.
Can anyone come up with a solution or a method to do that?
Thanks in advance
-
Using SUFaceGetNormal you get the face orientation in relationship to its parent entities container.
Not sure what you mean by "N direction" though..? -
i didn't quite understand how can i do get the orientation,as it's my first time using Sketchup C/C++ SDK.
i meant by "N direction" an axe, for example find faces orientation using one axe red one for example as reference, because i need the degree of orientation.
do u have an example of how to find the orientation ?
-
As you traverse the entities and you have a SUFaceRef:
// Assuming `face` is a SUFaceRef. SUVector3D vector = { 0.0, 0.0, 0.0 } SUFaceGetNormal(face, &vector);
You can then inspect the X, Y and Z values of the vector to see if it's facing the direction you are looking for.
-
What i'm looking for is the degree of the angle between the face (wall for example) and the red axe and have that angle degree for each face,for example face 1 20°, face 2 80° ...
Advertisement