Found Why Some Holes Don't Get Drilled

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Found Why Some Holes Don't Get Drilled

Post by freecader2 »

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!
a.png
a.png (102.96 KiB) Viewed 356 times
b.png
b.png (109.54 KiB) Viewed 356 times
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Re: Found Why Some Holes Don't Get Drilled

Post by freecader2 »

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
Screenshot from 2023-03-24 17-55-28.png
Screenshot from 2023-03-24 17-55-28.png (112.69 KiB) Viewed 265 times
Post Reply