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Β° ...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement