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

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

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

dpa
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 <[hidden email]>:
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..

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

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

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

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

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

dpa

Am Sa., 19. Sept. 2020 um 22:13 Uhr schrieb adrianv <[hidden email]>:
[..] 
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

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

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

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

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

nophead
+1

On Sun, 20 Sep 2020 at 04:11, caterpillar <[hidden email]> 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
[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: Is there a possibility to get a path out of a 2D object?

David Eccles (gringer)
In reply to this post by adrianv
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org