[OpenSCAD] Inkscape to OpenSCAD converter needs attention

Hans L thehans at gmail.com
Fri Nov 15 23:32:00 EST 2019


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 at 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 at 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 at lists.openscad.org
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



More information about the Discuss mailing list