new CAM library and workbench

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
vfabro
Posts: 2
Joined: Sun Aug 17, 2014 11:03 am

new CAM library and workbench

Post by vfabro »

Hello

First thank you all for FreeCAD !

I'm implementing a CAM library and will include it in the CAM workbench.
It's a work in progress (I'm learning C++, algos needed ... along the way).
It's under MIT license (double license with LGPL if allowed and needed).
As soon as I'm familiar enough with Git, it will be posted online.
Right now it's very basic, it takes a bunch of triangles and generates a path for a "drop down" cutter (-> see ugly test screenshots)...
sphere.png
sphere.png (20.55 KiB) Viewed 3254 times
testCAM.png
testCAM.png (13.39 KiB) Viewed 3254 times
Under the hood:
- "Drop down" cutter algo
- Cylindrical and spherical cutter (bullnose cutter to come)
- Use of triangles (no elevation map) for collision detection
- KDTree to speed collision detection

To come:
- adaptive stepsize
- simulator (marching cubes for visualization, dual contouring if needed)
- "Waterline" cutter algo

If moderators are OK with it, I'd like to post my progress here.

Comments and suggestions are welcome !

Vincent
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: new CAM library and workbench

Post by jmaustpc »

Hi Vincent
Sounds good to me. :)

Since you are using a compatible licence, your code will have the possibility to be accepted as part of FreeCAD. :)

Jim
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: new CAM library and workbench

Post by yorik »

Very interesting! Yes, please keep us updated!
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: new CAM library and workbench

Post by quick61 »

Yes, very interesting indeed. I know your just getting started on this but a couple of questions if you don't mind.

I see your using a mesh approach at present. Do you have any plans to advance this to use BRep data?

With your current code, what kind of performance impact are you seeing with increasing poly count of your mesh objects? That is to say, for a more accurate part, one would use a finer mesh. Is the performance impact more linear than exponential, or the other way around?

Is your work being based on the frame work that DavidNicholls and others have been doing, or are you starting from scratch?

At any rate, having anything that would be a functioning CAM workbench, i.e., a CAM workbench that produced Gcode from a part, would be far better than no CAM workbench. Please keep it coming.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
vfabro
Posts: 2
Joined: Sun Aug 17, 2014 11:03 am

Re: new CAM library and workbench

Post by vfabro »

Tanks for the comments !

quick61:
BRep:
If I understand correctly, BRep is a high level representation of a geometry. I don't know of an algorithm using BRep for toolpath generation. That said, if you have pointers, I'm interested!
Performance:
No tests were performed yet. Performance for toolpath generation should be O(n) (with n # of triangles) with lots of "ifs". The best evaluation should be an actual test.
FreeCAD workbench:
Yes I intend to use what they have done as a basis. I was able to compile and execute their work but haven't done anything in FreeCAD itself yet.

Don't hesitate if you have more questions.

Vincent
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: new CAM library and workbench

Post by yorik »

brep geometry is the "native" geometry type of OpenCasCade, the geometry kernel beneath FreeCAD. Almost all of the interesting stuff in FreeCAD (Part, PartDesign, Arch, etc) uses it. The mesh workbench exists more to handle input and output geometry, before it is converted to/from brep, but is not much used for modeling. brep has many advantages, one of the major ones is curved surfaces.

Note that you can easily get a mesh from a brep shape by using its tessellate method. So I think in this case it shouldn't be hard to support both formats.
Post Reply