[REQ] Select all connected faces with same orientation
-
Is it possible to select all connected faces with same orientation?
Either, you select one face with the desired orientation, (Front/Back) and run the script and the script selects all faces connected with the same orientation.
Or, you choose the plugin and triple click on a face (which selects all connected) and the script unselects all faces that don't have the same orientation as the first clicked one.
Am I making any sense?
Usage would be to speed up face reversing. -
Selection toys
Right Click -> Select -> Connected Coplanar Faces -
hmmm... you didn't mean for coplanar faces, did you?
-
Not coplanar. I mean connected faces that are the same, frontside or backside.
So the tool would select all connected faces that have the "same"* normal direction as the first selected face.- Same, meaning either the font or back side.
Sorry for beeing a bit vague. I hope it's a bit clearer now.
-
Can one assume that each edge only connects to max 2 faces?
-
This one liner will do it, but you might want to check that f is a face?
m=Sketchup.active_model;s=m.selection;f=s[0];a=[f];f.all_connected.each{|e|a<<e if e.class==Sketchup;;Face and e.normal==f.normal};s.clear;s.add(a)
-
@unknownuser said:
Is it possible to select all connected faces with same orientation?
or not connected will be very fine
Asked for a while, but seems that is not very easy to make!
All existing plugs give partial result -
For all faces with same normal try this (again you can add a check etc that f is a face)
m=Sketchup.active_model;s=m.selection;f=s[0];a=[f];m.active_entities.to_a.each{|e|a<<e if e.class==Sketchup;;Face and e.normal==f.normal};s.clear;s.add(a)
-
My impression was a selection tools more in the way that Orient Faces works out how faces in a surface is oriented. (Sans the actual orienting.)
-
If you want to check/match face 'orientations' rather than the faces' 'normals' there are always the methods used in my
orient_faces.rb
- that mimics the built in 'orient' other faces tool for a face. The test to reverse faces uses the edge-reversed-in-face etc, that returns a certain way if the pairs of faces are oriented [in]consistently... It only works with two faces per edge as three means one is always 'wrong'...
Here is the fileorient_faces.rb -
@thomthom said:
My impression was a selection tools more in the way that Orient Faces works out how faces in a surface is oriented. (Sans the actual orienting.)
Yes that was what I was thinking also.
Advertisement