discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Is there a possibility to get a path out of a 2D object?

D
dpa
Sat, Sep 19, 2020 7:49 PM

Is there any possibility to get a path out of 2D a module?

Asked the other way round: how do I use 2D objects as paths in scripts like
dotSCAD?
I know I could create my own paths, but this is only for basic elements.
Using e.g. difference or offset it's so handy to use OpenSCAD's functions
and at the other side it becomes so far more difficult to do it myself via
paths..

Am Sa., 19. Sept. 2020 um 21:46 Uhr schrieb D.Pank <dietrich.pank@gmail.com

:

Is there any possibility to get a path out of 2D a module?

Asked the other way round: how do I use 2D objects as paths in scripts
like dotSCAD?
I know I could create my own paths, but this is only for basic elements.
Using e.g. difference or offset it's so handy to use OpenSCAD's functions
and at the other side it becomes so far more difficult to do it myself via
paths..

Is there any possibility to get a path out of 2D a module? Asked the other way round: how do I use 2D objects as paths in scripts like dotSCAD? I know I could create my own paths, but this is only for basic elements. Using e.g. difference or offset it's so handy to use OpenSCAD's functions and at the other side it becomes so far more difficult to do it myself via paths.. Am Sa., 19. Sept. 2020 um 21:46 Uhr schrieb D.Pank <dietrich.pank@gmail.com >: > Is there any possibility to get a path out of 2D a module? > > Asked the other way round: how do I use 2D objects as paths in scripts > like dotSCAD? > I know I could create my own paths, but this is only for basic elements. > Using e.g. difference or offset it's so handy to use OpenSCAD's functions > and at the other side it becomes so far more difficult to do it myself via > paths.. >
A
adrianv
Sat, Sep 19, 2020 8:12 PM

No, it is impossible to extract information about coordinates from geometry.
If you want to use functions that operate on paths you need to build up the
paths as coordinate lists.  Note that the BOSL2 library supports offset and
difference operating on paths, though these are difficult to implement and
may not work for odd cases.

https://github.com/revarbat/BOSL2/wiki/regions.scad

dpa wrote

Is there any possibility to get a path out of 2D a module?

Asked the other way round: how do I use 2D objects as paths in scripts
like
dotSCAD?
I know I could create my own paths, but this is only for basic elements.
Using e.g. difference or offset it's so handy to use OpenSCAD's functions
and at the other side it becomes so far more difficult to do it myself via
paths..

No, it is impossible to extract information about coordinates from geometry. If you want to use functions that operate on paths you need to build up the paths as coordinate lists. Note that the BOSL2 library supports offset and difference operating on paths, though these are difficult to implement and may not work for odd cases. https://github.com/revarbat/BOSL2/wiki/regions.scad dpa wrote > Is there any possibility to get a path out of 2D a module? > > Asked the other way round: how do I use 2D objects as paths in scripts > like > dotSCAD? > I know I could create my own paths, but this is only for basic elements. > Using e.g. difference or offset it's so handy to use OpenSCAD's functions > and at the other side it becomes so far more difficult to do it myself via > paths.. -- Sent from: http://forum.openscad.org/
D
dpa
Sat, Sep 19, 2020 10:40 PM

Am Sa., 19. Sept. 2020 um 22:13 Uhr schrieb adrianv avm4@cornell.edu:

[..]

Note that the BOSL2 library supports offset and

difference operating on paths, though these are difficult to implement and
may not work for odd cases.

https://github.com/revarbat/BOSL2/wiki/regions.scad

Wow, that's a lot!
Now I have to read, read, learn how it works and learn how to use and learn
about the functions and names and it's arguments..
But OK. I asked :)
Thank you

Am Sa., 19. Sept. 2020 um 22:13 Uhr schrieb adrianv <avm4@cornell.edu>: > [..] Note that the BOSL2 library supports offset and > difference operating on paths, though these are difficult to implement and > may not work for odd cases. > > https://github.com/revarbat/BOSL2/wiki/regions.scad Wow, that's a lot! Now I have to read, read, learn how it works and learn how to use and learn about the functions and names and it's arguments.. But OK. I asked :) Thank you
C
caterpillar
Sun, Sep 20, 2020 3:10 AM

I was wondering if OpenSCAD could merge this PR?

https://github.com/openscad/openscad/pull/3288


https://openhome.cc

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

I was wondering if OpenSCAD could merge this PR? https://github.com/openscad/openscad/pull/3288 ----- https://openhome.cc -- Sent from: http://forum.openscad.org/
NH
nop head
Sun, Sep 20, 2020 8:29 AM

+1

On Sun, 20 Sep 2020 at 04:11, caterpillar caterpillar@openhome.cc wrote:

+1 On Sun, 20 Sep 2020 at 04:11, caterpillar <caterpillar@openhome.cc> wrote: > I was wondering if OpenSCAD could merge this PR? > > https://github.com/openscad/openscad/pull/3288 > > > > ----- > https://openhome.cc > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
DE
David Eccles (gringer)
Mon, Sep 21, 2020 11:21 PM

adrianv wrote

No, it is impossible to extract information about coordinates from
geometry.

What about a rendered 2D object?

Something like...

function getPath(renderedObject obj){
if(!isRendered(obj)){
printWarning("Object is not rendered, needs to be wrapped in a
'render()' operation");
return ValuePtr::undefined;
}
Polygon2d *outpoly;
// copy rendered points from obj to outpoly
return(outpoly);
}

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

adrianv wrote > No, it is impossible to extract information about coordinates from > geometry. What about a rendered 2D object? Something like... function getPath(renderedObject obj){ if(!isRendered(obj)){ printWarning("Object is not rendered, needs to be wrapped in a 'render()' operation"); return ValuePtr::undefined; } Polygon2d *outpoly; // copy rendered points from obj to outpoly return(outpoly); } -- Sent from: http://forum.openscad.org/