Tool library really messed up

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!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Tool library really messed up

Post by GeneFC »

I am sure I am in over my head, but in that prior example the troublesome shapes were cylinders with 2 circular "mouse bites" on the edges of the central cylinder. It is possible that instead of ignoring that shape it was detected as 3 overlapping circles.

Just a SWAG.

Gene
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Tool library really messed up

Post by sliptonic »

Like this?
Here's the macro and a run selecting a face in the central feature.
It correctly detects the circular hole and rejects the central feature. No errors in the console.

2022-09-06_09-53.png
2022-09-06_09-53.png (8.98 KiB) Viewed 732 times

Code: Select all

09:50:11  1 targets found
09:50:11  -->Face9
09:50:11  Face5 is not drillable

Code: Select all

from PathScripts import drillableLib as dl

# Select an object from the tree or subelements in the 3D window
# This gets the selection.
sel = FreeCADGui.Selection.getSelectionEx()[0]
obj = sel.Object

# Find all the drillable targets in the object
results = dl.getDrillableTargets(obj)
print(f"{len(results)} targets found")
for result in results:
    print(f"-->{result[1]}")

if sel.HasSubObjects:
    for elementname in sel.SubElementNames:
        subobj = obj.getSubObject(elementname)
        if dl.isDrillable(obj.Shape, subobj):
            print(f"{elementname} is drillable")
        else:
            print(f"{elementname} is not drillable")   
   
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Tool library really messed up

Post by GeneFC »

If you look at the first image in the post I mentioned, it appears that there was an attempt to drill those complex hole structures. That is also what I saw when I downloaded and analyzed the FCStd file in that post.

I do not know any more, except that when I manually deselected those shapes the drilling worked.

https://forum.freecadweb.org/viewtopic. ... 62#p622362

I just used the automatic selection, and I believe the OP did as well. I did not try directly selecting the sidewall surface of the large cylinder as you show above.

Gene
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

Sorry, I should have posted a response a bit sooner.

The issue with the "Unknown exception while reading attribute 'Curve' of object 'TopoShape'" error, is because the start depth was set to 0. I almost always leave the start depth set to 0 for most operations since Z is covered by the safe height. So the behavior in Freecad has changed a bit because not the fore mentioned error occurred. I haven't seen the problem since I started adding an arbitrary start height greater than zero.
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

GeneFC wrote: Tue Sep 06, 2022 4:32 pm If you look at the first image in the post I mentioned, it appears that there was an attempt to drill those complex hole structures. That is also what I saw when I downloaded and analyzed the FCStd file in that post.

I do not know any more, except that when I manually deselected those shapes the drilling worked.

https://forum.freecadweb.org/viewtopic. ... 62#p622362

I just used the automatic selection, and I believe the OP did as well. I did not try directly selecting the sidewall surface of the large cylinder as you show above.

Gene
I never use automatic selection and the holes were not complex at all, they were just simple holes. As I said above, the error occurs when the start depth is 0.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Tool library really messed up

Post by sliptonic »

blazini36 wrote: Wed Sep 07, 2022 10:32 pm Sorry, I should have posted a response a bit sooner.

The issue with the "Unknown exception while reading attribute 'Curve' of object 'TopoShape'" error, is because the start depth was set to 0. I almost always leave the start depth set to 0 for most operations since Z is covered by the safe height. So the behavior in Freecad has changed a bit because not the fore mentioned error occurred. I haven't seen the problem since I started adding an arbitrary start height greater than zero.
That might be the trigger but the root cause was that we were comparing two vectors for equality instead of checking with an appropriate tolerance. Rounding and floating point errors again.
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

I got ya, I didn't really follow all the responses in the thread.....

So theoretically if this issue were not there, a start depth of 0 should be permissible right? Now that I think about it, there's alot of cases where you would want to actually start an operation at a negative depth so 0 shouldn't actually be a problem.
Post Reply