Import() of SVG files with "holes" in them

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

Import() of SVG files with "holes" in them

Troberg
I'm trying to import an SVG logo, and when I look at the result, any holes in
it are filled. For example, an 8 would look like two stacked solid circles,
not two rings.

Am I doing something wrong, or is this "behaviour by design" and I can stop
trying to find problems in my SVG file?



--
Sent from: http://forum.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: Import() of SVG files with "holes" in them

nophead
There are two ways of specifying holes in an SVG. One is winding order and the other is counting from the inside out. Perhaps OpenSCAD is expecting one and your file is using the other. It is specified by an attribute IIRC, so readers should work with both.

On Thu, 11 Jun 2020 at 20:11, Troberg <[hidden email]> wrote:
I'm trying to import an SVG logo, and when I look at the result, any holes in
it are filled. For example, an 8 would look like two stacked solid circles,
not two rings.

Am I doing something wrong, or is this "behaviour by design" and I can stop
trying to find problems in my SVG file?



--
Sent from: http://forum.openscad.org/

_______________________________________________
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
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Import() of SVG files with "holes" in them

tp3
In reply to this post by Troberg
On 11.06.20 21:10, Troberg wrote:
> Am I doing something wrong, or is this "behaviour by design" and
> I can stop trying to find problems in my SVG file?

It behaves just like circle() in OpenSCAD. If you only stack them
they will union and the smaller one will vanish.

For SVG to import with the inner circle cut out, the SVG file needs
to be a single path for the whole 8 shape. E.g. in Inkscape it's
possible to do Path->Difference.
This is also visible in Inkscape if the shape is filled. Just
overlapping will show the fill everywhere. Doing the difference
will show the background though the cut out.

ciao,
  Torsten.

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

Re: Import() of SVG files with "holes" in them

Troberg
Thanks, everybody. In the end, I solved it by cheating, I simply made two
SVGs, with the outer shapes removed in the second, and diffed them. I had to
put a dot in opposite corners to make them scale the same, but I suspect
that's an artifact of the export, not the import in OpenSCAD.



--
Sent from: http://forum.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: Import() of SVG files with "holes" in them

OpenSCAD mailing list-2
Another option is to use Inkscape extension "Paths to OpenSCAD" which also fills in the holes. the extension creates individual modules for each component of the build. This enables one to move the holes to a difference operation, providing the desired result.

On Friday, June 12, 2020, 1:17:20 AM EDT, Troberg <[hidden email]> wrote:


Thanks, everybody. In the end, I solved it by cheating, I simply made two
SVGs, with the outer shapes removed in the second, and diffed them. I had to
put a dot in opposite corners to make them scale the same, but I suspect
that's an artifact of the export, not the import in OpenSCAD.



--
Sent from: http://forum.openscad.org/


_______________________________________________
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