I have been struggling with the new drilling function for a couple of days, and I think I have uncovered a small bug.
I have a simple block with 42 identical holes to be drilled into the top surface. No matter how I changed the hole size or the tool, 4 of the 42 holes simply refused to be selected. I tried deleting some of holes and various other changes, but in no case would any of the holes at those 4 locations behave properly.
I finally tracked the problem down to the following comparison in the new PathUtils.py module
Under the "isDrillable" routine there is a comparison
if obj.isInside(lsp, 0, False) or obj.isInside(lep, 0, False)
This apparently checks to see if the seam of the cylinder to be drilled is vertical. I found the test was failing for the 4 bad candidates.
I changed the comparison to
if obj.isInside(lsp, PathGeom.Tolerance, False) or obj.isInside(lep, PathGeom.Tolerance, False)
I also added to the header section
from PathScripts.PathGeom import PathGeom
Now everything works as should. I would guess that the seams are not *exactly* vertical due to FC internal numerical precision.
I can file a bug report if desired.
Gene
Drilling Bug
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:
Re: Drilling Bug
Looks like a good fix to me. Do you want to do a PR or would you like me to implement it?
Re: Drilling Bug
I would prefer that you either do the PR or simply include the fix as part of the ongoing improvements you are making. I suspect it is quite a rare problem, since nobody else seems to have reported it. I would probably be seriously challenged at this time to try a PR.sliptonic wrote:Looks like a good fix to me. Do you want to do a PR or would you like me to implement it?
My python-fu is essentially non-existent. I found the solution by studying the holding tag procedure made by mlampert a couple of months back.
Gene