Inkscape to OpenSCAD converter needs attention

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

Inkscape to OpenSCAD converter needs attention

boxcarmib
Inkscape is soon to release version 1.0 and as I understand it existing extensions will not work without some modifications. I applied the instructions of the very brief upgrade instructions that are currently available for the upcoming new version to their current beta release and found no joy.

For Mac users this is problematic in that the current Inkscape Mac compatible version (0.92) won’t work on Catalina, and so if you move to Catalina you just won’t be able to use the Inkscape to OpenSCAD converter at all.

I’m hoping there’s some kind generous soul out who knows python who might turn their attention to what I hope is a relatively straightforward refactoring so that this Inkscape extension will work with the new 1.0 version of Inkscape.

I don’t use it a lot, but it’s super handy when I need it.


Here’s the thingiverse link to the most useful current version of this extension….

https://www.thingiverse.com/thing:1065500
_______________________________________________
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: Inkscape to OpenSCAD converter needs attention

tp3
Does it have any special features that are not working
with the SVG import?

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: Inkscape to OpenSCAD converter needs attention

boxcarmib
As it stands, it just doesn’t install on the Inkscape beta… and doesn’t even show up in menu.

Here are the guidelines I followed in trying to install it on the latest beta…

http://wiki.inkscape.org/wiki/index.php/Updating_your_Extension_for_1.0

> On Oct 28, 2019, at 7:16 PM, Torsten Paul <[hidden email]> wrote:
>
> Does it have any special features that are not working
> with the SVG import?
>
> ciao,
>  Torsten.
>
> _______________________________________________
> 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: Inkscape to OpenSCAD converter needs attention

tp3
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Inkscape to OpenSCAD converter needs attention

nophead
The plugin generates a vertex list, so you can get at the points. If you import an SVG presumably you lose the dimensions, etc, just like STL.

Somewhere there is an STL to polyhedron converter to avoid STL import as well.

On Tue, 29 Oct 2019 at 14:48, Torsten Paul <[hidden email]> 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
[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: Inkscape to OpenSCAD converter needs attention

tp3
On 29.10.19 16:14, nop head wrote:
> The plugin generates a vertex list, so you can get at
> the points. If you import an SVG presumably you lose
> the dimensions, etc, just like STL.

That should be possible, the most interesting question
is probably how to present that information.

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: Inkscape to OpenSCAD converter needs attention

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

On Tue, 29 Oct 2019 at 15:31, Torsten Paul <[hidden email]> wrote:
On 29.10.19 16:14, nop head wrote:
> The plugin generates a vertex list, so you can get at
> the points. If you import an SVG presumably you lose
> the dimensions, etc, just like STL.

That should be possible, the most interesting question
is probably how to present that information.

ciao,
  Torsten.


_______________________________________________
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: Inkscape to OpenSCAD converter needs attention

tp3
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Inkscape to OpenSCAD converter needs attention

nophead
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 <[hidden email]> 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
[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: Inkscape to OpenSCAD converter needs attention

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

A terça, 29/10/2019, 16:18, nop head <[hidden email]> escreveu:
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.



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

Re: Inkscape to OpenSCAD converter needs attention

boxcarmib
In reply to this post by tp3
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 <[hidden email]> 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
> [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: Inkscape to OpenSCAD converter needs attention

tp3
In reply to this post by Ronaldo
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Inkscape to OpenSCAD converter needs attention

nophead
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 <[hidden email]> 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
[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: Inkscape to OpenSCAD converter needs attention

gasstationwithoutpumps
In reply to this post by tp3
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Inkscape to OpenSCAD converter needs attention

nophead
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 <[hidden email]> 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
[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: Inkscape to OpenSCAD converter needs attention

gasstationwithoutpumps
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/

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

Re: Inkscape to OpenSCAD converter needs attention

thehans
In reply to this post by nophead
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 <[hidden email]> 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 <[hidden email]> 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
>> [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

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

Re: Inkscape to OpenSCAD converter needs attention

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

_______________________________________________
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