Smart Circular Loop Face Select
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Smart Circular Loop Face Select
I attempted searching for similar threads and came across something that mentioned holding down shift and selecting faces.
It doesn't seem to work. I want to basically be able to somehow easily select all those faces/triangles that are part of that same array.
The goal is to be able to easily add them to the defeaturing workbench list for further processing.
What would be the right way to do that?
It doesn't seem to work. I want to basically be able to somehow easily select all those faces/triangles that are part of that same array.
The goal is to be able to easily add them to the defeaturing workbench list for further processing.
What would be the right way to do that?
- Attachments
-
- Screenshot from 2021-06-14 00-42-54.png (20.05 KiB) Viewed 1080 times
Last edited by duckmug on Mon Jun 14, 2021 12:40 am, edited 1 time in total.
Re: Smart Face Select
Like in Blender...an actual native mesh modeler?
Have you tried the Mesh or Defeaturing workbenches?
Have you tried the Mesh or Defeaturing workbenches?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: Smart Face Select
Yes, in the defeaturing workbench, there is a list that I can press the add button and have the selected faces be added there.
My issue is how to quickly select all those triangle faces that are part of that same circular array so that I can get them in there.
If GUI can't help with this, a scripting workaround would also work.
My issue is how to quickly select all those triangle faces that are part of that same circular array so that I can get them in there.
If GUI can't help with this, a scripting workaround would also work.
Re: Smart Face Select
Ok, I think I traced something that works very close, which is box selection, still not totally precise.
Would love to hear in case there's anything better that is particularly suited to circular loops of faces.
Would love to hear in case there's anything better that is particularly suited to circular loops of faces.
Re: Smart Circular Loop Face Select
I wanted to check, but FreeCAD crashes on two of the meshers, and the default looked quite different, so my question is, if defeaturing works after all. Does it create a conical shape, even if everything around is flat?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Smart Circular Loop Face Select
Yes defeaturing works fine here.
Re: Smart Circular Loop Face Select
fc is probably the best cad system around to script in,
and a bit of python should really be possible for most people,
combine that with an ounce of determination to get things done...
an example of a slow and naive algo...
and a bit of python should really be possible for most people,
combine that with an ounce of determination to get things done...
an example of a slow and naive algo...
Code: Select all
# select a face on a refined solid, originating from a mesh
# run macro, adds all adjecent faces to selection
from itertools import chain, combinations
s, = Gui.Selection.getSelectionEx()
obj = s.Object
selface, = s.SubObjects
selfacename, = s.SubElementNames
selfaceid = int(selfacename.replace('Face', ''))
print('Selected face: {} in {}'.format(s.ObjectName, selfacename))
Gui.Selection.clearSelection()
def xyz(vert):
return vert.X, vert.Y, vert.Z
def face_verts(face):
return (xyz(v) for v in face.Vertexes)
def common_vert(fa, fsv):
pairs = combinations(chain(face_verts(fa), fsv), 2)
return sum(i == j for i, j in pairs)
faces = obj.Shape.Faces
selfaceverts = tuple(face_verts(selface))
hits = list()
for i, face in enumerate(faces, start=1):
if i == selfaceid: continue
found = common_vert(face, selfaceverts)
if found:
hits.append('Face{}'.format(i))
Gui.Selection.addSelection(obj, hits)
print('ready')
Re: Smart Circular Loop Face Select
Thank you so much, that is pretty handy!
Update: I tested it and it doesn't seem to select them in my case.
Update: I tested it and it doesn't seem to select them in my case.
Re: Smart Circular Loop Face Select
well, the code does what it does, not necessarily what you are after
it is just one example intended to illustrate that it is not that hard to script in fc,
it simply is one way to select adjacent faces.
could be coded differently, like using vector distances and still do the same.
feel free to tweak it to your own needs.
it is just one example intended to illustrate that it is not that hard to script in fc,
it simply is one way to select adjacent faces.
could be coded differently, like using vector distances and still do the same.
feel free to tweak it to your own needs.
Re: Smart Circular Loop Face Select
Yes I understand and appreciate your effort regardless, will try to play with it.