Milling an outline of lines and arcs

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
blank
Posts: 10
Joined: Sat Oct 22, 2022 12:22 pm

Milling an outline of lines and arcs

Post by blank »

I got some dxf files for cnc machining which consist entirely of connected lines and arcs, without any solid parts. As the filetype suggests, they are usually used with Fusion360 and the operations are as simple as they can be: cut once along every line in the figure.
Since I don't like Fusion360s licensing model, and Fusion360 doesn't like Linux, I wanted to create a machining operation with FreeCAD. However, I have absolutely no idea how to do it. After creating a job, I tried using a profile operation, but in the base geometry tab, the add button is greyed out everytime I select multiple lines and when I click ok, the console outputs

Code: Select all

xx:xx:xx  PathProfile.ERROR: Failed to identify top faces of cut area.
xx:xx:xx  PathProfile.ERROR: The selected edge(s) are inaccessible. If multiple, re-ordering selection might work. 
not to mention that the simulation isn't doing anything.

I'm starting to think that I get FreeCADs machining concept wrong and that FreeCAD is unable to machine anything that isn't a closed solid. But maybe there is yet hope...

My system:

Code: Select all

OS: Ubuntu 22.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
I can't provide the files in question, but feel free to use the example files at https://coyotex.de/en/dxf-example-files/ which have exactly the same problems.

...and, you might have guessed it already, I have little experience in cnc machining and even less in FreeCAD.

Thanks in advance
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Milling an outline of lines and arcs

Post by chrisb »

Hi and welcome to the forum!

Instead of leaving the work to the helpers, provide a minimal file showing your issue. That means that the work has only to be done once and not by everyone who wants to help you.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
blank
Posts: 10
Joined: Sat Oct 22, 2022 12:22 pm

Re: Milling an outline of lines and arcs

Post by blank »

Like I said, when I open a dxf file and define a path operation, it happens. There isn't too much I can prepare. I have saved the project after I defined the path operation, does this help?

But thinking about it now with a little more experience, the behaviour is completely logical. If a milling bit traces a line, it will not only cut the material at the line, it will also cut additional material equal to the radius of the bit. The resulting form is smaller than the designed part. Therefore the the path operation has to cut along the lines on the outside of the form.
When you import a dxf file in FreeCAD, it consists of free floating lines with a separate part for every line. Therefore FreeCAD doesn't know how the final form looks and therefore has no concept of "outside" or "inside".

So the new question is, how to import a dxf file so it is represented as a proper form or at least a drawing that can be build into a form. But that's problably a question for another thread.
Attachments
dxf_path_milling.FCStd
(50.04 KiB) Downloaded 19 times
jescombe
Posts: 90
Joined: Tue Mar 09, 2021 4:19 pm

Re: Milling an outline of lines and arcs

Post by jescombe »

@blank If you just want to follow the lines (to engrave for example).

Once you have your DXF imported, you can open the Draft workbench, select all the shapes and "Modification->Draft to Sketch".

That will create a sketch with all the lines, which can then be used in Path for an engraving operation. You'll need to give the stock some depth when you create the Path Job object (I just let it extend the Z in the setup page).

There's other things you can do that are useful with engravings, like compounding all the shapes into a single object, then creating a clone that can then be scaled etc.. But hopefully the above should get you going in the right direction.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Milling an outline of lines and arcs

Post by chrisb »

blank wrote: Sat Nov 26, 2022 5:04 pm So the new question is, how to import a dxf file so it is represented as a proper form or at least a drawing that can be build into a form.
You can configure the import to join geometry. Then you can pad it to get a 3D model which you can mill.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
blank
Posts: 10
Joined: Sat Oct 22, 2022 12:22 pm

Re: Milling an outline of lines and arcs

Post by blank »

chrisb wrote: Sat Nov 26, 2022 6:50 pm
blank wrote: Sat Nov 26, 2022 5:04 pm So the new question is, how to import a dxf file so it is represented as a proper form or at least a drawing that can be build into a form.
You can configure the import to join geometry. Then you can pad it to get a 3D model which you can mill.
Under "Preferences->Import/Export", there is a tab "DXF", which has the option "Join Geometries" under "Import options". I assume you were referring to that?
Unfortunately, activating this option didn't change anything for me. Importing e.g. https://coyotex.de/wp-content/uploads/2 ... _gross.dxf, I still get a collection of loose lines and vertices.
blank
Posts: 10
Joined: Sat Oct 22, 2022 12:22 pm

Re: Milling an outline of lines and arcs

Post by blank »

jescombe wrote: Sat Nov 26, 2022 6:17 pm @blank If you just want to follow the lines (to engrave for example).
Once you have your DXF imported, you can open the Draft workbench, select all the shapes and "Modification->Draft to Sketch".
Thanks, using this, I came up with the following workflow:
Open the dxf like any normal file. Now, as jescombe said, open the draft workbench, select all single dxf parts in the model window (usually labelled shapexx), and select "Modification->Draft to Sketch". Now you should have the all geometry as one sketch. Feel free to delete all other parts you just selected, you won't need them anymore.
The sketch is completely unconstrained and the lines are not connected to each other, so you don't have a complete part yet. I didn't find a way to merge touching lines or overlapping dots, so I can only offer this workaround:
Switch to the part design workbench, select the sketch and select "Part Design->Create Body". Now select the body and create a Shapebinder on it, which can connect loose geometry to a complete shape. Note that you seemingly cannot add overlapping geometries together. If you have e.g. a plate with holes in it, you need to add the outer geometry and then the inner hole geometries one after another.
The resulting Shapebinder object in the Model view should now be paddable ad millable just like any other part.

In conclusion, I think, redoing a dxf shape in FreeCAD by hand is almost the better option. Provided nobody has any improvements to my way, of course.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Milling an outline of lines and arcs

Post by chrisb »

To connect well placed but unconnected lines, use Sketcher ValidateSketch and use the automatic repair function.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Milling an outline of lines and arcs

Post by GeneFC »

blank wrote: Sun Nov 27, 2022 12:14 pm In conclusion, I think, redoing a dxf shape in FreeCAD by hand is almost the better option.
This a recurring theme on the forum. Lots of people import and use svg files, dxf files, and stl files, but it is seldom casual. Those input formats have many variations, and lots of them have errors.

It can be done, but in many cases starting from scratch in FC will be faster and more reliable.

I tend to avoid that sort of conversion. I import the foreign format and visually trace over it using the FC sketcher.

Gene
Post Reply