Path tool/workpiece contact detection [macro]

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
mickgalt
Posts: 3
Joined: Sun Sep 11, 2022 2:24 am

Path tool/workpiece contact detection [macro]

Post by mickgalt »

Hi, I've written a macro to generate a grind path for a specific application I have on a 5 axis machine.
2 of the axes are fixed, 2 move at fixed increments along the workpiece which leave 1 axis which I need to solve based on the tool/workpeice contact.

I'm not using path at the moment, it's just a macro that moves the tool around and writes the axis positions to a file.

for the contact detection I am using a intersection boolean which returns the intersection volume.
I have a loop which is moving the tool in and out of contact with reduced steps each time until i reach a minimum step tolerance
(when the volume returns 0 I am not in contact, when not 0 the tool is in contact)

while this is working it's very slow, multipled by 100,000's of points it can take many hours.

my question is, how does path detect the tool and workpeice? I there an inbuilt function I can use?

I have looked at using assembly constraints, but the workpiece is a coplex curved surface and I can't find a constraint in any of the assembly options that will work.

Thanks
Last edited by mickgalt on Sun Sep 11, 2022 9:37 am, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Path tool/workpiece contact detection [marco]

Post by Kunda1 »

Do you mind providing the macro code ? Is it on github ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mickgalt
Posts: 3
Joined: Sun Sep 11, 2022 2:24 am

Re: Path tool/workpiece contact detection [macro]

Post by mickgalt »

I only have the local copy at the moment.
i there anything in particular you wanted to see in it? its a bit of a hot mess.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Path tool/workpiece contact detection [macro]

Post by GeneFC »

mickgalt wrote: Sun Sep 11, 2022 2:44 am my question is, how does path detect the tool and workpeice? I there an inbuilt function I can use?
For a 3D operation, which sounds like what you need, FreeCAD uses Open Cam Lib to detect the surface.

https://github.com/aewallin/opencamlib

Open Cam Lib is currently distributed with FreeCAD as a library, ocl.pyd

Gene
mickgalt
Posts: 3
Joined: Sun Sep 11, 2022 2:24 am

Re: Path tool/workpiece contact detection [macro]

Post by mickgalt »

GeneFC wrote: Sun Sep 11, 2022 2:06 pm For a 3D operation, which sounds like what you need, FreeCAD uses Open Cam Lib to detect the surface.
Thanks. the PathWaterline py might be a good stating point for what I need, I'm reading through py file now.
Post Reply