discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Creating DXF file with round shapes

EB
Eric Buijs
Wed, Jun 29, 2016 11:49 AM

Hello,

I use OpenSCAD to export dxf files that I need for laser cutting. When I
create circles a dxf file with multiple line segments per circle is
generated by OpenSCAD. This causes problems on the laser cutter that
"perceives" this a multiple independent lines.

As an example: projection() cylinder(h=12, r=80); generates 30 line
segments.

Is there a way around this within OpenSCAD or is it just the way that
OpenSCAD generates dxf files?

I use OpenSCAD version 2015.03-3 on OSX (10.10).

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hello, I use OpenSCAD to export dxf files that I need for laser cutting. When I create circles a dxf file with multiple line segments per circle is generated by OpenSCAD. This causes problems on the laser cutter that "perceives" this a multiple independent lines. As an example: projection() cylinder(h=12, r=80); generates 30 line segments. Is there a way around this within OpenSCAD or is it just the way that OpenSCAD generates dxf files? I use OpenSCAD version 2015.03-3 on OSX (10.10). -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Wed, Jun 29, 2016 12:56 PM

OpenSCAD represents 2D shapes as polygons. That's just the way it works. So
circles are represented by regular polygons.

If you write
projection() cylinder(h=12, r=80, $fn=100);
then you have direct control over the number of line segments used to
approximate the circle (in this case, 100). You can pick a $fn value that's
high enough so that the circle looks good in laser cutter output.

More information here:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#.24fa.2C_.24fs_and_.24fn

On 29 June 2016 at 07:49, Eric Buijs ebuijs@mac.com wrote:

Hello,

I use OpenSCAD to export dxf files that I need for laser cutting. When I
create circles a dxf file with multiple line segments per circle is
generated by OpenSCAD. This causes problems on the laser cutter that
"perceives" this a multiple independent lines.

As an example: projection() cylinder(h=12, r=80); generates 30 line
segments.

Is there a way around this within OpenSCAD or is it just the way that
OpenSCAD generates dxf files?

I use OpenSCAD version 2015.03-3 on OSX (10.10).

--
View this message in context:
http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

OpenSCAD represents 2D shapes as polygons. That's just the way it works. So circles are represented by regular polygons. If you write projection() cylinder(h=12, r=80, $fn=100); then you have direct control over the number of line segments used to approximate the circle (in this case, 100). You can pick a $fn value that's high enough so that the circle looks good in laser cutter output. More information here: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#.24fa.2C_.24fs_and_.24fn On 29 June 2016 at 07:49, Eric Buijs <ebuijs@mac.com> wrote: > Hello, > > I use OpenSCAD to export dxf files that I need for laser cutting. When I > create circles a dxf file with multiple line segments per circle is > generated by OpenSCAD. This causes problems on the laser cutter that > "perceives" this a multiple independent lines. > > As an example: projection() cylinder(h=12, r=80); generates 30 line > segments. > > Is there a way around this within OpenSCAD or is it just the way that > OpenSCAD generates dxf files? > > I use OpenSCAD version 2015.03-3 on OSX (10.10). > > > > -- > View this message in context: > http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > >
EB
Eric Buijs
Wed, Jun 29, 2016 2:33 PM

Thanks for the reply. I understand your point. However increasing $fn would
only worsen the problem. Your example would probably result in 100 different
lines in the DFX file. The software on the laser cutter (Coreldraw)
interprets the polygons as separate lines forcing the laser cutter to jump
up and down through the circle, an unwanted situation of course.

I saw in the past others struggled with a similar problem
(https://github.com/openscad/openscad/pull/448) and, as far as I understand
correctly, made changes to the OpenSCAD source code, creating a polyline
entity in the DFX file instead of the line entity. My guess is that a
(closed) polyline will solve the problem. What I can't figure out if this
change has been reverted or not.

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17835.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks for the reply. I understand your point. However increasing $fn would only worsen the problem. Your example would probably result in 100 different lines in the DFX file. The software on the laser cutter (Coreldraw) interprets the polygons as separate lines forcing the laser cutter to jump up and down through the circle, an unwanted situation of course. I saw in the past others struggled with a similar problem (https://github.com/openscad/openscad/pull/448) and, as far as I understand correctly, made changes to the OpenSCAD source code, creating a polyline entity in the DFX file instead of the line entity. My guess is that a (closed) polyline will solve the problem. What I can't figure out if this change has been reverted or not. -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17835.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RW
Rogier Wolff
Wed, Jun 29, 2016 4:12 PM

On Wed, Jun 29, 2016 at 08:56:20AM -0400, doug moen wrote:

OpenSCAD represents 2D shapes as polygons. That's just the way it works. So
circles are represented by regular polygons.

If you write

projection() cylinder(h=12, r=80, $fn=100);

then you have direct control over the number of line segments used to
approximate the circle (in this case, 100). You can pick a $fn value that's
high enough so that the circle looks good in laser cutter output.

I'm not sure that this is the problem Eric is having.

When there are SEPARATE line-pieces, the lasercutter will first cut
from say -1,0 to -0.99, 0.1 and then start cutting from +1,0 to
+0.99,0.1 and keep on alternating between the sides of the circle.

I always import the dxf into coreldraw and then run a macro called
"nodeclean2". This will fixup all the separate line-segments into
multiple segments of one object, so that the objects can be lasered in
one go without any moves inbetween. It also "closes" the object so
that "vectorsort = on" works. (if that's off or not working, the laser
may first decide to cut out your gear, and then later cut the hole in
the middle. But by then the gear has fallen out of the blank, so that
it's moved and out-of-focus...)

Roger. 

Hello,

I use OpenSCAD to export dxf files that I need for laser cutting. When I
create circles a dxf file with multiple line segments per circle is
generated by OpenSCAD. This causes problems on the laser cutter that
"perceives" this a multiple independent lines.

As an example: projection() cylinder(h=12, r=80); generates 30 line
segments.

Is there a way around this within OpenSCAD or is it just the way that
OpenSCAD generates dxf files?

I use OpenSCAD version 2015.03-3 on OSX (10.10).

--
View this message in context:
http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
-- BitWizard writes Linux device drivers for any device you may have! --
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

On Wed, Jun 29, 2016 at 08:56:20AM -0400, doug moen wrote: > OpenSCAD represents 2D shapes as polygons. That's just the way it works. So > circles are represented by regular polygons. > > If you write > projection() cylinder(h=12, r=80, $fn=100); > then you have direct control over the number of line segments used to > approximate the circle (in this case, 100). You can pick a $fn value that's > high enough so that the circle looks good in laser cutter output. I'm not sure that this is the problem Eric is having. When there are SEPARATE line-pieces, the lasercutter will first cut from say -1,0 to -0.99, 0.1 and then start cutting from +1,0 to +0.99,0.1 and keep on alternating between the sides of the circle. I always import the dxf into coreldraw and then run a macro called "nodeclean2". This will fixup all the separate line-segments into multiple segments of one object, so that the objects can be lasered in one go without any moves inbetween. It also "closes" the object so that "vectorsort = on" works. (if that's off or not working, the laser may first decide to cut out your gear, and then later cut the hole in the middle. But by then the gear has fallen out of the blank, so that it's moved and out-of-focus...) Roger. > > More information here: > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#.24fa.2C_.24fs_and_.24fn > > > On 29 June 2016 at 07:49, Eric Buijs <ebuijs@mac.com> wrote: > > > Hello, > > > > I use OpenSCAD to export dxf files that I need for laser cutting. When I > > create circles a dxf file with multiple line segments per circle is > > generated by OpenSCAD. This causes problems on the laser cutter that > > "perceives" this a multiple independent lines. > > > > As an example: projection() cylinder(h=12, r=80); generates 30 line > > segments. > > > > Is there a way around this within OpenSCAD or is it just the way that > > OpenSCAD generates dxf files? > > > > I use OpenSCAD version 2015.03-3 on OSX (10.10). > > > > > > > > -- > > View this message in context: > > http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833.html > > Sent from the OpenSCAD mailing list archive at Nabble.com. > > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 ** ** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 ** *-- BitWizard writes Linux device drivers for any device you may have! --* The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
EB
Eric Buijs
Wed, Jun 29, 2016 7:07 PM

Hi Roger,

this macro appears to be what I'm looking for. I use the laser cutter of a
local FabLab but I think the're ok if I use a macro. Do you now where I can
get it? Google wasn't very helpful in that respect. Much appreciated.

Eric.

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17838.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Roger, this macro appears to be what I'm looking for. I use the laser cutter of a local FabLab but I think the're ok if I use a macro. Do you now where I can get it? Google wasn't very helpful in that respect. Much appreciated. Eric. -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17838.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Thu, Jun 30, 2016 2:10 PM

On Jun 29, 2016, at 10:33 AM, Eric Buijs ebuijs@mac.com wrote:

I saw in the past others struggled with a similar problem
(https://github.com/openscad/openscad/pull/448) and, as far as I understand
correctly, made changes to the OpenSCAD source code, creating a polyline
entity in the DFX file instead of the line entity. My guess is that a
(closed) polyline will solve the problem. What I can't figure out if this
change has been reverted or not.

That particular pull request wasn’t accepted since it broke other workflows. To do this properly, we need to write some tests to make sure our DXF outputs remains compatible with various other software.

-Marius

> On Jun 29, 2016, at 10:33 AM, Eric Buijs <ebuijs@mac.com> wrote: > > I saw in the past others struggled with a similar problem > (https://github.com/openscad/openscad/pull/448) and, as far as I understand > correctly, made changes to the OpenSCAD source code, creating a polyline > entity in the DFX file instead of the line entity. My guess is that a > (closed) polyline will solve the problem. What I can't figure out if this > change has been reverted or not. > That particular pull request wasn’t accepted since it broke other workflows. To do this properly, we need to write some tests to make sure our DXF outputs remains compatible with various other software. -Marius
P
Parkinbot
Thu, Jun 30, 2016 3:22 PM

I am using this path sometimes to get hands on coordinates of OpenSCAD
2D-shapes, like subtractively generatated involute gears. For this I am also
missing a  LWPOLYLINE
http://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.htm
option, which you have e.g. in Inkscape.

While the full polyline information is derivable from simple LINE output -
by interpreting matching start and end points of the lines - it would be
nicer and more robust if a parser could go for a polyline.

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17843.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I am using this path sometimes to get hands on coordinates of OpenSCAD 2D-shapes, like subtractively generatated involute gears. For this I am also missing a LWPOLYLINE <http://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.htm> option, which you have e.g. in Inkscape. While the full polyline information is derivable from simple LINE output - by interpreting matching start and end points of the lines - it would be nicer and more robust if a parser could go for a polyline. -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17843.html Sent from the OpenSCAD mailing list archive at Nabble.com.
EB
Eric Buijs
Fri, Jul 1, 2016 11:14 AM

I see, thanks for clarifying that. I hope we'll an OpenSCAD update in the
future that takes care of this.

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17849.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I see, thanks for clarifying that. I hope we'll an OpenSCAD update in the future that takes care of this. -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17849.html Sent from the OpenSCAD mailing list archive at Nabble.com.
C
cbernhardt
Mon, Jul 4, 2016 12:23 PM

When you create a DXF file of a circle in OpenSCAD the line segments are
arranged in the correct order in a anti-clockwise direction, so why would
the the cutter be "jumping" between non adjacent line segments?

Will the laser cutter software interpret (and cut) a DXF LWPOLYLINE entity
correctly?

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17876.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

When you create a DXF file of a circle in OpenSCAD the line segments are arranged in the correct order in a anti-clockwise direction, so why would the the cutter be "jumping" between non adjacent line segments? Will the laser cutter software interpret (and cut) a DXF LWPOLYLINE entity correctly? -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17876.html Sent from the OpenSCAD mailing list archive at Nabble.com.
EB
Eric Buijs
Mon, Jul 4, 2016 2:19 PM

True, the line segments are arranged in the correct order. I don't know why
it jumps up and down, I just know that it does. I can only speculate that
the driver (CorelDraw) mixes up the file before sending it to the laser
cutter. The laser cutter is not mine, it's in a FabLab, so I don't have the
opportunaty to analyse what is happening (I pay per hour). However this
morning I discovered that a very simple "trick" eliminates my problem. When
select all objects and use the group command in CorelDraw all objects become
one and printed without problem.

About the DXF LWPOLYLINE. This solution was based on a older discussion
(https://github.com/openscad/openscad/pull/448). Since I create my dxf files
with OpenSCAD I didn't had the opportunaty to test POLYLINE and with the
group command I probably don't need to test it anymore.

--
View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17877.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

True, the line segments are arranged in the correct order. I don't know why it jumps up and down, I just know that it does. I can only speculate that the driver (CorelDraw) mixes up the file before sending it to the laser cutter. The laser cutter is not mine, it's in a FabLab, so I don't have the opportunaty to analyse what is happening (I pay per hour). However this morning I discovered that a very simple "trick" eliminates my problem. When select all objects and use the group command in CorelDraw all objects become one and printed without problem. About the DXF LWPOLYLINE. This solution was based on a older discussion (https://github.com/openscad/openscad/pull/448). Since I create my dxf files with OpenSCAD I didn't had the opportunaty to test POLYLINE and with the group command I probably don't need to test it anymore. -- View this message in context: http://forum.openscad.org/Creating-DXF-file-with-round-shapes-tp17833p17877.html Sent from the OpenSCAD mailing list archive at Nabble.com.