Hi,
While troubleshooting holes not included in Drill Ops, I found two causes. One seems like an easy fix.
First, when Path.Base.Drillable.getDrillableTargets() checks the Op's base objects' faces to evaluate whether each is drillable, the for-range loop only includes faces 1..<n-1>. Valid candidate faces (holes in the model) that happen to be the last in the list aren't considered, even though they may be drillable. Changing this to loop 1..<n> avoids missing those potentially drillable faces due to their position in the list. This is submitted in PR #8846 https://github.com/FreeCAD/FreeCAD/pull/8846.
The screenshots below show before/after this fix. Many more of the drillable holes that should be included are included.
The second cause of missing drill positions is that checkForBlindHole() returns a "bottom face" for through-holes where there actually is no bottom face. This causes isDrillableCylinder() to check if that face's normal vector exactly matches the default (0,0,1) and excludes it if the vector angle is 180. But for through-holes, both 0 and 180 vector angles should be acceptable.
I suspect the fix will be to change checkForBlindHole() to not return a bottom face when there is one. But I haven't figured out how that works yet. Any suggestions or other ideas are welcome.
Hope this helps!
Found Why Some Holes Don't Get Drilled
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
Re: Found Why Some Holes Don't Get Drilled
Figured out the second cause: checkForBlindHole() needs to check whether the edge (circle) it's evaluating has a face. If there's no face, it's a through-hole rather than a blind hole, so None should be returned. By reporting when it's a through-hole, isDrillableCylinder() accepts 0 and 180 vector angles for the through-hole orientation, and allows the cylinder to be drilled.
The result is that all appropriate holes are included for Drilling/Helix Ops.
Both of these fixes are submitted in PR # 9038 https://github.com/FreeCAD/FreeCAD/pull/9038
The result is that all appropriate holes are included for Drilling/Helix Ops.
Both of these fixes are submitted in PR # 9038 https://github.com/FreeCAD/FreeCAD/pull/9038