[Solved] How to draw a photomask with FreeCAD
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
- miniellipse
- Posts: 101
- Joined: Tue Apr 24, 2018 9:09 pm
Re: How to draw a photomask with FreeCAD
You might also want to try Openscad. It allows 2d shapes to be drawn programmatically and then has a dxf export. Most photomask manufacturers will be very sensitive to how the dxf lines are formed to create enclosed polygons. Problems may arise if you have a donut like shape.
Re: How to draw a photomask with FreeCAD
It turned out that I can draw a sketch, then use Draft Array to make an array of the sketch.
I can can select the draft objects as well as Sketches together, the export a DXF. This works fine and in free programs like:
https://www.opencascade.com/products/cad-assistant/
The DXF looks perfect.
But the mark producers either use old DXF libraries that cannot handle splines in DXF or they require Gerber format.
Since I need letters in the mask I use Draft's ShapeString tool to create them. These letter-like Structures are in fact splines, so they get lost with many DXF libraries.
OK, so I thought, my DXF is valid anyway, no matter if some outdated libraries think it is not. So there must be a way to make a Gerber out of it. But I cannot find a way. I thought at least I make a kind of drawing our of the DXF, fill all polygons and then create a Gerber file, but also failed.
So does anybody know how to convert the DXF I get from FreeCAD to Gerber?
I can can select the draft objects as well as Sketches together, the export a DXF. This works fine and in free programs like:
https://www.opencascade.com/products/cad-assistant/
The DXF looks perfect.
But the mark producers either use old DXF libraries that cannot handle splines in DXF or they require Gerber format.
Since I need letters in the mask I use Draft's ShapeString tool to create them. These letter-like Structures are in fact splines, so they get lost with many DXF libraries.
OK, so I thought, my DXF is valid anyway, no matter if some outdated libraries think it is not. So there must be a way to make a Gerber out of it. But I cannot find a way. I thought at least I make a kind of drawing our of the DXF, fill all polygons and then create a Gerber file, but also failed.
So does anybody know how to convert the DXF I get from FreeCAD to Gerber?
Last edited by uwestoehr on Wed Jul 14, 2021 3:17 pm, edited 1 time in total.
Re: How to draw a photomask with FreeCAD
QCAD has some functions to explode DXF's texts and bsplines to simple arcs and lines.
https://ribbonsoft.com/en/download
https://github.com/qcad/qcad
LibreCAD can recode those files to lower level DXF versions, i.e. R12
https://sourceforge.net/projects/librec ... ds/master/
https://ribbonsoft.com/en/download
https://github.com/qcad/qcad
LibreCAD can recode those files to lower level DXF versions, i.e. R12
https://sourceforge.net/projects/librec ... ds/master/
[Solution] Re: How to draw a photomask with FreeCAD
It turned out that this was already the solution:
The issue I encountered was that old DXF libraries that cannot handle splines in DXF. But OK, programs that cannot handle splines should simply not be used anymore.
(Every outline (TrueType, OpenType) font is based on Bézier curves and therefore using the Shapesting tool (https://wiki.freecadweb.org/Draft_ShapeString) gives you Splines (https://wiki.freecadweb.org/B-Splines) as resulting shape.)
In my case the mask producing company uses a program to create Gerber with a few clicks out of the DXF I sent them. They only had to say that all closed polygons in the DXF should be filled.
To assure that this works, I assured that every sketch and array object I created in FreeCAD could be extruded. Then I know that the resulting DXF polygon is a closed polygon.
The nice thing is hereby that every sketch and array object appears in the resulting DXF as separate layer.uwestoehr wrote: ↑Wed Jul 14, 2021 12:43 pm It turned out that I can draw a sketch, then use Draft Array to make an array of the sketch.
I can can select the draft objects as well as Sketches together, the export a DXF. This works fine and in free programs like:
https://www.opencascade.com/products/cad-assistant/
The DXF looks perfect.
The issue I encountered was that old DXF libraries that cannot handle splines in DXF. But OK, programs that cannot handle splines should simply not be used anymore.
(Every outline (TrueType, OpenType) font is based on Bézier curves and therefore using the Shapesting tool (https://wiki.freecadweb.org/Draft_ShapeString) gives you Splines (https://wiki.freecadweb.org/B-Splines) as resulting shape.)
In my case the mask producing company uses a program to create Gerber with a few clicks out of the DXF I sent them. They only had to say that all closed polygons in the DXF should be filled.
To assure that this works, I assured that every sketch and array object I created in FreeCAD could be extruded. Then I know that the resulting DXF polygon is a closed polygon.
Re: How to draw a photomask with FreeCAD
even if I've been late, it may help in the future:
1) export your bspline to dxf file
2) import your dxf bspline in kicad pcbnew using Edge.Cut as Layer (this will check closed outline(s)
(I suggest the daily build which handles better bspline and use millimiters if your dxf is in mm)
3) plot the gerber from kicad pcbnew to gerber format EDIT: I changed the kicad & gerber files with the right scale
Re: How to draw a photomask with FreeCAD
kicad 5.99 (daily) can import the text (which is a countour) dxf, but the splines are incorrectly imported.
There should be an issue to rise at gitlab kicad source.
Re: How to draw a photomask with FreeCAD
Since I used KiCAD yesterday for the first time could you please report the error to KiCAD.
Here is a better testcase with text and structures like in my real-life photomask:
and this is the DXF I created out of it and that cannot be imported to KiCAD: