Creating DXF file with round shapes

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating DXF file with round shapes

Eric Buijs
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).
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

doug.moen
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.



On 29 June 2016 at 07:49, Eric Buijs <[hidden email]> 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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

Eric Buijs
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.
rew
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

rew
In reply to this post by doug.moen
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 <[hidden email]> 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
> > [hidden email]
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >
> >
> >

> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
** [hidden email] ** 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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

Eric Buijs
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.
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

kintel
Administrator
In reply to this post by Eric Buijs
> On Jun 29, 2016, at 10:33 AM, Eric Buijs <[hidden email]> 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
 
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

Parkinbot
This post was updated on .
I am using this path sometimes to get hands on coordinates of OpenSCAD 2D-shapes, like subtractively generated involute gears. For this I am also missing a LWPOLYLINE 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.
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

Eric Buijs
This post was updated on .
In reply to this post by kintel
I see, thanks for clarifying that. I hope we'll see an OpenSCAD update in the future that takes care of this.
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

cbernhardt
In reply to this post by Eric Buijs
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?
Reply | Threaded
Open this post in threaded view
|

Re: Creating DXF file with round shapes

Eric Buijs
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.