Reverse faces
-
Before i start to climb this particular hill i'd like to ask if you know of such a script already.
The point is that i have some acad models that include a staggering amount of faces which for some reason are facing in random directions. However the model should be always solid so it would be enough for me to just check the normals of the faces and compare those to the camera and if they are not opposite i could just reverse the face.
Can you spot a fatal flaw in the reasoning or provide a good starting point for this work ?
I guess it would involve selecting all faces in the FOV and doing some vector-magic on them?Br,
Janne Kotka -
Janne,
Reversed Faces...
Zoom out and select all faces that need turning around, then
Right Click - Reverse Faces
Do the bulk of your problem areas like this.
...
To reverse the remaining faces that are mixed in with "correct" faces (and therefore have to be selected individually):
Download
http://www.smustard.com/script/ReverseFaces
(Thank you Todd)
This Script Speeds things up considerably
A one click tool to reverse faces - really useful
...
Hope this helps
Howard L' -
Could be done automatically:
Don't know whether you can add material to the faces in the other program. If it is possible, do it. If the import in Sketchup also includes the materials on the faces AND the material is only on one side (i.e. outside of a cube), you can use the FFlipper plugin (see my website).
OR
It is possible to write an extension for doing it automatically. How to program?
- Ask the user to select a face which is in right direction.
- Get the normal of this face.
- Recursively get all faces which are connected to the chosen face and check their normals against the normal of the chosen face.
- (some more investigation on the "if" for flipping the face - YES, my knowledge in mathematics is a bit rusty)
azuby
-
ok thanks guys, i have to start looking into this.
i would transfer these faces manually but since the models are not originating from
sketchup it means that they are pretty high on polycount (30k-100k) and flipping even 1000 faces manually is bit, well, horrible -
@lekonna said:
However the model should be always solid so it would be enough for me to just check the normals of the faces and compare those to the camera and if they are not opposite i could just reverse the face.
If you imagine a box with 6 faces which are all aligned correctly, the 3 faces which are visible would have their normals match the camera and the three faces which are invisible would have their normals the opposite of the camera. So the "trick" is to determine which faces are visible, and which faces are obstructed by other faces.
Todd Burch was working of a script to solve this problem, but I never heard if he got it finished.
I don't know any easy way to determine if a face is visible or obscured in a particular view.
Advertisement