discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Importing a DXF containing arcs and circles

JB
Jordan Brown
Thu, Aug 17, 2023 8:47 PM

On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote:

I also use AutoCAD to create my DXFs. But during importation, the arcs
are converted to segments.

Then I read in the documentation (sorry, I forgot where) that this
isreally a limitation.

Ah!

OpenSCAD supports importing DXF arcs and circles.

But OpenSCAD does not itself support arcs, circles, or other curves.  It
supports only polygons and polyhedra.

Everything that looks like a curve, including the native circle, sphere,
cylinder, and rotate_extrude modules, and any others I'm forgetting,
turns into straight lines.  Maybe lots of straight lines, but if you
look close enough they are always there.

On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote: > > I also use AutoCAD to create my DXFs. But during importation, the arcs > are converted to segments. > > Then I read in the documentation (sorry, I forgot where) that this > isreally a limitation. > Ah! OpenSCAD supports importing DXF arcs and circles. But OpenSCAD does not itself support arcs, circles, or other curves.  It supports only polygons and polyhedra. Everything that looks like a curve, including the native circle, sphere, cylinder, and rotate_extrude modules, and any others I'm forgetting, turns into straight lines.  Maybe lots of straight lines, but if you look close enough they are always there.
DP
David Phillip Oster
Thu, Aug 17, 2023 9:10 PM

If you eventually use your .scad files for 3D printing, there is an open
source tool, ArcWelder https://github.com/FormerLurker/ArcWelderLib, that
will pre-process the gcode files and turn the sequence of short segments
back into proper arcs, for 3D printers that support arcs in their gcode.

On Thu, Aug 17, 2023 at 1:48 PM Jordan Brown openscad@jordan.maileater.net
wrote:

On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote:

I also use AutoCAD to create my DXFs. But during importation, the arcs are
converted to segments.

Then I read in the documentation (sorry, I forgot where) that this
isreally a limitation.

Ah!

OpenSCAD supports importing DXF arcs and circles.

But OpenSCAD does not itself support arcs, circles, or other curves.  It
supports only polygons and polyhedra.

Everything that looks like a curve, including the native circle, sphere,
cylinder, and rotate_extrude modules, and any others I'm forgetting, turns
into straight lines.  Maybe lots of straight lines, but if you look close
enough they are always there.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

If you eventually use your .scad files for 3D printing, there is an open source tool, ArcWelder <https://github.com/FormerLurker/ArcWelderLib>, that will pre-process the gcode files and turn the sequence of short segments back into proper arcs, for 3D printers that support arcs in their gcode. On Thu, Aug 17, 2023 at 1:48 PM Jordan Brown <openscad@jordan.maileater.net> wrote: > On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote: > > I also use AutoCAD to create my DXFs. But during importation, the arcs are > converted to segments. > > Then I read in the documentation (sorry, I forgot where) that this > isreally a limitation. > > > Ah! > > OpenSCAD supports importing DXF arcs and circles. > > But OpenSCAD does not itself support arcs, circles, or other curves. It > supports only polygons and polyhedra. > > Everything that looks like a curve, including the native circle, sphere, > cylinder, and rotate_extrude modules, and any others I'm forgetting, turns > into straight lines. Maybe lots of straight lines, but if you look close > enough they are always there. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AG
andrew goh
Thu, Aug 24, 2023 5:09 AM

It has been a while, but I remember that OpenSCAD seemed to have issues
with splines and bezier curves.

Accordingly, if you use R12 formats for DXF files, your CAD s/w would
likely convert those splines and beizer curves into polylines, and those
can be imported into OpenSCAD.

There is also a well developed python ezdxf app/library

https://github.com/mozman/ezdxf/tree/master

https://ezdxf.readthedocs.io/en/stable/index.html

I've not played much with that, but that it has an r12 writer addon

https://ezdxf.readthedocs.io/en/stable/addons/r12writer.html

I'm not too sure if that can be used to convert files from formats later
than R12 into R12 formats which would likely import with less troubles
than the later DXF formats.

On 18/08/2023 05:10, David Phillip Oster wrote:

If you eventually use your .scad files for 3D printing, there is an
open source tool, ArcWelder
https://github.com/FormerLurker/ArcWelderLib, that will pre-process
the gcode files and turn the sequence of short segments back into
proper arcs, for 3D printers that support arcs in their gcode.

On Thu, Aug 17, 2023 at 1:48 PM Jordan Brown
<openscad@jordan.maileater.net mailto:openscad@jordan.maileater.net>
wrote:

 On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote:
 I also use AutoCAD to create my DXFs. But during importation, the
 arcs are converted to segments.

 Then I read in the documentation (sorry, I forgot where) that
 this isreally a limitation.
 Ah!

 OpenSCAD supports importing DXF arcs and circles.

 But OpenSCAD does not itself support arcs, circles, or other
 curves.  It supports only polygons and polyhedra.

 Everything that looks like a curve, including the native circle,
 sphere, cylinder, and rotate_extrude modules, and any others I'm
 forgetting, turns into straight lines.  Maybe lots of straight
 lines, but if you look close enough they are always there.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

It has been a while, but I remember that OpenSCAD seemed to have issues with splines and bezier curves. Accordingly, if you use R12 formats for DXF files, your CAD s/w would likely convert those splines and beizer curves into polylines, and those can be imported into OpenSCAD. There is also a well developed python ezdxf app/library https://github.com/mozman/ezdxf/tree/master https://ezdxf.readthedocs.io/en/stable/index.html I've not played much with that, but that it has an r12 writer addon https://ezdxf.readthedocs.io/en/stable/addons/r12writer.html I'm not too sure if that can be used to convert files from formats later than R12 into R12 formats which would likely import with less troubles than the later DXF formats. On 18/08/2023 05:10, David Phillip Oster wrote: > If you eventually use your .scad files for 3D printing, there is an > open source tool, ArcWelder > <https://github.com/FormerLurker/ArcWelderLib>, that will pre-process > the gcode files and turn the sequence of short segments back into > proper arcs, for 3D printers that support arcs in their gcode. > > On Thu, Aug 17, 2023 at 1:48 PM Jordan Brown > <openscad@jordan.maileater.net <mailto:openscad@jordan.maileater.net>> > wrote: > > On 8/17/2023 11:46 AM, jpm2nice-tech--- via Discuss wrote: >> >> I also use AutoCAD to create my DXFs. But during importation, the >> arcs are converted to segments. >> >> Then I read in the documentation (sorry, I forgot where) that >> this isreally a limitation. >> > > Ah! > > OpenSCAD supports importing DXF arcs and circles. > > But OpenSCAD does not itself support arcs, circles, or other > curves.  It supports only polygons and polyhedra. > > Everything that looks like a curve, including the native circle, > sphere, cylinder, and rotate_extrude modules, and any others I'm > forgetting, turns into straight lines.  Maybe lots of straight > lines, but if you look close enough they are always there. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > <mailto:discuss-leave@lists.openscad.org> > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org