Edge counts in cylindrical holes.

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Edge counts in cylindrical holes.

Post by sliptonic »

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?
2022-02-15_17-42.png
2022-02-15_17-42.png (17.38 KiB) Viewed 1347 times
Attachments
parametricdie.FCStd
(76.62 KiB) Downloaded 45 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Edge counts in cylindrical holes.

Post by TheMarkster »

Some are intersecting other holes.
Snip macro screenshot-7e3083.png
Snip macro screenshot-7e3083.png (90.3 KiB) Viewed 1255 times
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Edge counts in cylindrical holes.

Post by chennes »

What version of OCC?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Edge counts in cylindrical holes.

Post by openBrain »

sliptonic wrote: Tue Feb 15, 2022 11:55 pm 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?
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).
dice.png
dice.png (23.2 KiB) Viewed 1198 times
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()
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Edge counts in cylindrical holes.

Post by sliptonic »

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.
Post Reply