I import .SVG files from Inkscape but the curves appear to be split into
straight lines. It doesn't seem to be an export issue in Inkscape because if
I reopen the files in Inkscape the curves are displayed as such.
On Sun, Sep 6, 2020, at 6:28 AM, amundsen wrote:
> I import .SVG files from Inkscape but the curves appear to be split into
> straight lines. It doesn't seem to be an export issue in Inkscape because if
> I reopen the files in Inkscape the curves are displayed as such.
> How can I avoid this?
Fundamentally, you can't avoid this, it is how OpenSCAD works. Internally, OpenSCAD represents curved 2D shapes as polygons.
I have drawn curves in PostScript and used the /setflat/, /flattenpath/,
/pathforall/, and /print/ operators to output polygons of the accuracy I
want for OpenSCAD using GhostScript (gs). It's a crude solution, but I've
also done it with two levels of accuracy so I can use a parameter to choose
one for viewing (less accuraste) and the other for rendering (more
accurate). The procedures given to /pathforall/ do the string composition
(using the /cvs/ operator) and printing producing output which can be
included directly in the OpenSCAD file.
I undestand that but how can I increase the resolution? Should I make my
drawings bigger in Inkscape and then scale them down after import in
OpenSCAD? The picture displayed is an arc with a length of approximately
On 06.09.20 15:28, amundsen wrote:
> I undestand that but how can I increase the resolution?
The proper way would be by using $fa/$fs/$fn but I think
that's not fully implemented at this point. So what might
always work is converting path to straight line segments
in Inkscape. In this case the segment resolution can be
specified in the "flatten curves" operation.
In the process of exploring this issue, I discovered that 0.92 Inkscape has a
Extensions, Modify Path, Flatten Beziers
Doing so provides for a dialog box of resolution, which defaulted to 0.1 in
my test. That's a relatively high resolution if that's what's desired.
I've just tried the Flatten Bezier option from Inkscape but the length of the
segments resulting from the operation depend on the size of the curve. For
instance, with my original file I could only divide the curve into 8
segments using the lowest possible value (0.1). However by scaling the
drawing 10,000% prior to the flattening, I got a lot more segments for the
same curve. I can then scale back the drawing to its original size.