Attached is a test file I use for detecting drillable locations in a model. I have a library that evaluates faces to determine if they are features that could be drilled on a cnc machine. Part the routine looks at edge counts.
I regenerated the model recently and started seeing faces that should pass the test being rejected. When I dug into it, I found that many of the faces no longer have 3 edges (two circles and a seam). Now they have anywhere between 3 and 5. I don't see any pattern to it. For example, in the attached model the farthest hole on the '3' face has four edges in the tip but 3 edges in all prior steps.
I've tested prior to a few likely commits but I haven't done a thorough bisect to try to find when the change occurred. Anyone have a clue?
Did something change?
Edge counts in cylindrical holes.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Edge counts in cylindrical holes.
- Attachments
-
- parametricdie.FCStd
- (76.62 KiB) Downloaded 45 times
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Edge counts in cylindrical holes.
What version of OCC?
Re: Edge counts in cylindrical holes.
As @TheMarkster pointed out, this is generated because holes are touching each other.
Here the edges randomly colored for the hole you mentioned and the touching one (one you mentioned is the vertical one). FWIW, the macro I use to do this (just select the faces you want to analyze, it will create one group per face with face+each edge as objects).
Code: Select all
from random import random
def run():
sel = [it for obj in Gui.Selection.getSelectionEx() for it in obj.SubObjects if isinstance(it, Part.Face)]
if not sel:
return
doc = App.ActiveDocument
for face in sel:
grp = doc.addObject('App::DocumentObjectGroup','Face')
fac = doc.addObject('Part::Feature', 'Face')
grp.addObject(fac)
fac.Shape = face.copy()
fac.ViewObject.LineWidth = 1
for edge in face.Edges:
edg = doc.addObject('Part::Feature', 'Edge')
grp.addObject(edg)
edg.Shape = edge.copy()
edg.ViewObject.LineWidth = 3
edg.ViewObject.OnTopWhenSelected = True
edg.ViewObject.LineColor = (random(), random(), random())
run()
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Edge counts in cylindrical holes.
openBrain, TheMarkster, Thanks you!
I inspected several of the holes that were causing problems but not at the same time. Great catch.
The fact that edge counts changed between steps should have been a clue to me. Sorry for the distraction.
I inspected several of the holes that were causing problems but not at the same time. Great catch.
The fact that edge counts changed between steps should have been a clue to me. Sorry for the distraction.