discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Inkscape to OpenSCAD converter needs attention

HJ
Hugo Jackson
Tue, Oct 29, 2019 5:09 PM

Well this is embarrassing…. Kind of like getting in a lather looking for my glasses only to discover I’m wearing them.
I do remember the inclusion in the last release the inclusion of the ability to import some new file types but it never twigged.
<sigh>
Thanks for straightening me out.

On Oct 29, 2019, at 7:47 AM, Torsten Paul Torsten.Paul@gmx.de wrote:

What my question meant was: What are the features of that
plugin that can't be substituted by exporting as SVG and
importing the SVG file directly into OpenSCAD via import()?

ciao,
Torsten.


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

Well this is embarrassing…. Kind of like getting in a lather looking for my glasses only to discover I’m wearing them. I do remember the inclusion in the last release the inclusion of the ability to import some new file types but it never twigged. <sigh> Thanks for straightening me out. > On Oct 29, 2019, at 7:47 AM, Torsten Paul <Torsten.Paul@gmx.de> wrote: > > What my question meant was: What are the features of that > plugin that can't be substituted by exporting as SVG and > importing the SVG file directly into OpenSCAD via import()? > > ciao, > Torsten. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
TP
Torsten Paul
Tue, Oct 29, 2019 5:16 PM

On 29.10.19 18:02, Ronaldo Persiano wrote:

This was already proposed a long time ago by Parkinbot and
forgotten who knows why.

No, it was/is not forgotten.

On 29.10.19 17:17, nop head wrote:

It can just be a two element vector which are the arguments
for polygon or polyhedron. I.e. the points list and edge list.
Why would that not cover all bases? You can do anything you
want with the lists.

That might be enough for STL, SVG has element IDs and also
non-standard layers and maybe more structure. One option could
be to push all those to the import() statement and leave the
data access as simple as possible. But maybe it could be
useful to not parse the file many times with various filters.

ciao,
Torsten.

On 29.10.19 18:02, Ronaldo Persiano wrote: > This was already proposed a long time ago by Parkinbot and > forgotten who knows why. No, it was/is not forgotten. On 29.10.19 17:17, nop head wrote: > It can just be a two element vector which are the arguments > for polygon or polyhedron. I.e. the points list and edge list. > Why would that not cover all bases? You can do anything you > want with the lists. That might be enough for STL, SVG has element IDs and also non-standard layers and maybe more structure. One option could be to push all those to the import() statement and leave the data access as simple as possible. But maybe it could be useful to not parse the file many times with various filters. ciao, Torsten.
NH
nop head
Tue, Oct 29, 2019 5:32 PM

Perhaps just return more elements in the vector with additional info as
requested. It should be backwards compatible if the first two are fixed.

On Tue, 29 Oct 2019 at 17:16, Torsten Paul Torsten.Paul@gmx.de wrote:

On 29.10.19 18:02, Ronaldo Persiano wrote:

This was already proposed a long time ago by Parkinbot and
forgotten who knows why.

No, it was/is not forgotten.

On 29.10.19 17:17, nop head wrote:

It can just be a two element vector which are the arguments
for polygon or polyhedron. I.e. the points list and edge list.
Why would that not cover all bases? You can do anything you
want with the lists.

That might be enough for STL, SVG has element IDs and also
non-standard layers and maybe more structure. One option could
be to push all those to the import() statement and leave the
data access as simple as possible. But maybe it could be
useful to not parse the file many times with various filters.

ciao,
Torsten.


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

Perhaps just return more elements in the vector with additional info as requested. It should be backwards compatible if the first two are fixed. On Tue, 29 Oct 2019 at 17:16, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 29.10.19 18:02, Ronaldo Persiano wrote: > > This was already proposed a long time ago by Parkinbot and > > forgotten who knows why. > > No, it was/is not forgotten. > > On 29.10.19 17:17, nop head wrote: > > It can just be a two element vector which are the arguments > > for polygon or polyhedron. I.e. the points list and edge list. > > Why would that not cover all bases? You can do anything you > > want with the lists. > > That might be enough for STL, SVG has element IDs and also > non-standard layers and maybe more structure. One option could > be to push all those to the import() statement and leave the > data access as simple as possible. But maybe it could be > useful to not parse the file many times with various filters. > > ciao, > Torsten. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
G
gasstationwithoutpumps
Fri, Nov 1, 2019 3:54 AM

The converter produced a list of Bezier curves for each object in the SVG
file, and the resulting file could be edited to manipulate those lists.  I
used it to create separate lists of curves for a cookie-cutter design (which
I could not finish, because I couldn't get any of the extrude-along-curves
approaches to handle tight concave curves).

But the idea of getting the SVG file not as a single object, but as a set of
named curves that are individually accessible is a valuable one.  Either the
Inkscape plugin should be fixed or a powerful API added for svg import.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

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

The converter produced a list of Bezier curves for each object in the SVG file, and the resulting file could be edited to manipulate those lists. I used it to create separate lists of curves for a cookie-cutter design (which I could not finish, because I couldn't get any of the extrude-along-curves approaches to handle tight concave curves). But the idea of getting the SVG file not as a single object, but as a set of named curves that are individually accessible is a valuable one. Either the Inkscape plugin should be fixed or a powerful API added for svg import. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
NH
nop head
Fri, Nov 1, 2019 8:14 AM

Which converter is that? The plugin I use creates a many sided polygon,
which make sense in OpenSCAD because Beziers aren't native.

On Fri, 1 Nov 2019 at 03:43, gasstationwithoutpumps karplus@soe.ucsc.edu
wrote:

The converter produced a list of Bezier curves for each object in the SVG
file, and the resulting file could be edited to manipulate those lists.  I
used it to create separate lists of curves for a cookie-cutter design
(which
I could not finish, because I couldn't get any of the extrude-along-curves
approaches to handle tight concave curves).

But the idea of getting the SVG file not as a single object, but as a set
of
named curves that are individually accessible is a valuable one.  Either
the
Inkscape plugin should be fixed or a powerful API added for svg import.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

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


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

Which converter is that? The plugin I use creates a many sided polygon, which make sense in OpenSCAD because Beziers aren't native. On Fri, 1 Nov 2019 at 03:43, gasstationwithoutpumps <karplus@soe.ucsc.edu> wrote: > The converter produced a list of Bezier curves for each object in the SVG > file, and the resulting file could be edited to manipulate those lists. I > used it to create separate lists of curves for a cookie-cutter design > (which > I could not finish, because I couldn't get any of the extrude-along-curves > approaches to handle tight concave curves). > > But the idea of getting the SVG file not as a single object, but as a set > of > named curves that are individually accessible is a valuable one. Either > the > Inkscape plugin should be fixed or a powerful API added for svg import. > > > > ----- > gasstationwithoutpumps.wordpress.com > www.thingiverse.com/gasstationwithoutpumps/things > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
G
gasstationwithoutpumps
Fri, Nov 8, 2019 4:32 AM

nophead wrote

Which converter is that? The plugin I use creates a many sided polygon,
which make sense in OpenSCAD because Beziers aren't native.

I was using the Inkscape plugin from
https://www.thingiverse.com/thing:2805184
https://www.thingiverse.com/thing:2805184  which produced Beziér curves,
then converted them to polygons within OpenSCAD.  I was editing the output
of the plugin, so that I could name the curves and pass them around.  I used
the provided method for converting the curves to polygons.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

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

nophead wrote > Which converter is that? The plugin I use creates a many sided polygon, > which make sense in OpenSCAD because Beziers aren't native. I was using the Inkscape plugin from https://www.thingiverse.com/thing:2805184 <https://www.thingiverse.com/thing:2805184> which produced Beziér curves, then converted them to polygons within OpenSCAD. I was editing the output of the plugin, so that I could name the curves and pass them around. I used the provided method for converting the curves to polygons. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
HL
Hans L
Sat, Nov 16, 2019 4:32 AM

Since an imported file could have multiple geometries, I would suggest
more like a vector of two element vectors.  Which is what I did for my
FunctionOpenSCAD library:
https://github.com/thehans/FunctionalOpenSCAD#the-poly-datatype
The library allows many variations for convenience.  But to have a
single standard for such an import I would go with always returning a
"poly vector" described towards the bottom.

Another crazy idea specific to SVG, or maybe other markup-based
formats, would be to allow an optional CSS-selector parameter to
import specific elements.  svg = import("file.svg", selector="#id");

On Tue, Oct 29, 2019 at 11:18 AM nop head nop.head@gmail.com wrote:

It can just be a two element vector which are the arguments for polygon or polyhedron. I.e. the points list and edge list.

so

polygon(svg[0], svg[1]) or polyhedron(svg[0], svg[1])

Why would that not cover all bases? You can do anything you want with the lists.

On Tue, 29 Oct 2019 at 16:05, Torsten Paul Torsten.Paul@gmx.de wrote:

On 29.10.19 16:49, nop head wrote:

Add an import_vertices operation that returns polygon or
polyhedron format data depending if it is 2D or 3D.

That's not needed, we can just use

svg = import("file.svg");

The details of how to access the data is critical as it's
going to be an API which is almost impossible to change
once it's out.

But I guess that's going a bit off-topic for this thread.

ciao,
Torsten.


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

Since an imported file could have multiple geometries, I would suggest more like a vector of two element vectors. Which is what I did for my FunctionOpenSCAD library: https://github.com/thehans/FunctionalOpenSCAD#the-poly-datatype The library allows many variations for convenience. But to have a single standard for such an import I would go with always returning a "poly vector" described towards the bottom. Another crazy idea specific to SVG, or maybe other markup-based formats, would be to allow an optional CSS-selector parameter to import specific elements. svg = import("file.svg", selector="#id"); On Tue, Oct 29, 2019 at 11:18 AM nop head <nop.head@gmail.com> wrote: > > It can just be a two element vector which are the arguments for polygon or polyhedron. I.e. the points list and edge list. > > so > > polygon(svg[0], svg[1]) or polyhedron(svg[0], svg[1]) > > Why would that not cover all bases? You can do anything you want with the lists. > > > > > On Tue, 29 Oct 2019 at 16:05, Torsten Paul <Torsten.Paul@gmx.de> wrote: >> >> On 29.10.19 16:49, nop head wrote: >> > Add an import_vertices operation that returns polygon or >> > polyhedron format data depending if it is 2D or 3D. >> >> That's not needed, we can just use >> >> svg = import("file.svg"); >> >> The details of how to access the data is critical as it's >> going to be an API which is almost impossible to change >> once it's out. >> >> But I guess that's going a bit off-topic for this thread. >> >> ciao, >> Torsten. >> >> _______________________________________________ >> 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
MP
Mark Peeters
Mon, Nov 18, 2019 11:13 AM

I use the converter a lot and find that V6 (
https://www.thingiverse.com/thing:25036  ) is much more useful to me. I
often want to edit the outputted openscad files to split out the shapes for
multi-material printing. V6 makes walls using a difference of individual
polygons. V7 makes a single polygon where the inside and outside points are
all together and the wall order command creates the hollowness. V7 with the
“force line” command uses a loop to hull consecutive cylinders at the
points.

I doubt I can help with programming but the output and methodology of V6
creates more useful openscad files.

On Fri, Nov 15, 2019 at 11:33 PM Hans L thehans@gmail.com wrote:

Since an imported file could have multiple geometries, I would suggest
more like a vector of two element vectors.  Which is what I did for my
FunctionOpenSCAD library:
https://github.com/thehans/FunctionalOpenSCAD#the-poly-datatype
The library allows many variations for convenience.  But to have a
single standard for such an import I would go with always returning a
"poly vector" described towards the bottom.

Another crazy idea specific to SVG, or maybe other markup-based
formats, would be to allow an optional CSS-selector parameter to
import specific elements.  svg = import("file.svg", selector="#id");

On Tue, Oct 29, 2019 at 11:18 AM nop head nop.head@gmail.com wrote:

It can just be a two element vector which are the arguments for polygon

or polyhedron. I.e. the points list and edge list.

so

polygon(svg[0], svg[1]) or polyhedron(svg[0], svg[1])

Why would that not cover all bases? You can do anything you want with

the lists.

On Tue, 29 Oct 2019 at 16:05, Torsten Paul Torsten.Paul@gmx.de wrote:

On 29.10.19 16:49, nop head wrote:

Add an import_vertices operation that returns polygon or
polyhedron format data depending if it is 2D or 3D.

That's not needed, we can just use

svg = import("file.svg");

The details of how to access the data is critical as it's
going to be an API which is almost impossible to change
once it's out.

But I guess that's going a bit off-topic for this thread.

ciao,
Torsten.


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

I use the converter a lot and find that V6 ( https://www.thingiverse.com/thing:25036 ) is much more useful to me. I often want to edit the outputted openscad files to split out the shapes for multi-material printing. V6 makes walls using a difference of individual polygons. V7 makes a single polygon where the inside and outside points are all together and the wall order command creates the hollowness. V7 with the “force line” command uses a loop to hull consecutive cylinders at the points. I doubt I can help with programming but the output and methodology of V6 creates more useful openscad files. On Fri, Nov 15, 2019 at 11:33 PM Hans L <thehans@gmail.com> wrote: > Since an imported file could have multiple geometries, I would suggest > more like a vector of two element vectors. Which is what I did for my > FunctionOpenSCAD library: > https://github.com/thehans/FunctionalOpenSCAD#the-poly-datatype > The library allows many variations for convenience. But to have a > single standard for such an import I would go with always returning a > "poly vector" described towards the bottom. > > Another crazy idea specific to SVG, or maybe other markup-based > formats, would be to allow an optional CSS-selector parameter to > import specific elements. svg = import("file.svg", selector="#id"); > > On Tue, Oct 29, 2019 at 11:18 AM nop head <nop.head@gmail.com> wrote: > > > > It can just be a two element vector which are the arguments for polygon > or polyhedron. I.e. the points list and edge list. > > > > so > > > > polygon(svg[0], svg[1]) or polyhedron(svg[0], svg[1]) > > > > Why would that not cover all bases? You can do anything you want with > the lists. > > > > > > > > > > On Tue, 29 Oct 2019 at 16:05, Torsten Paul <Torsten.Paul@gmx.de> wrote: > >> > >> On 29.10.19 16:49, nop head wrote: > >> > Add an import_vertices operation that returns polygon or > >> > polyhedron format data depending if it is 2D or 3D. > >> > >> That's not needed, we can just use > >> > >> svg = import("file.svg"); > >> > >> The details of how to access the data is critical as it's > >> going to be an API which is almost impossible to change > >> once it's out. > >> > >> But I guess that's going a bit off-topic for this thread. > >> > >> ciao, > >> Torsten. > >> > >> _______________________________________________ > >> 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 > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >