discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Is there a way to get the points from an object?

A
adrian
Wed, Jan 28, 2015 3:38 AM

Specifically a 2D one, but any object would be good.

A

--
View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Specifically a 2D one, but any object would be good. A -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 28, 2015 3:50 AM

I don't believe so, not programmatically in a .scad, you could export to stl
and look in the stl. or dxf??


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11269.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I don't believe so, not programmatically in a .scad, you could export to stl and look in the stl. or dxf?? ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11269.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 28, 2015 3:55 AM

If your going to do that, have a look at  dxf_dim() etc
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General  (down the
bottom). I have never used it.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11271.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

If your going to do that, have a look at dxf_dim() etc <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General> (down the bottom). I have never used it. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11271.html Sent from the OpenSCAD mailing list archive at Nabble.com.
PF
Peter Falke
Wed, Jan 28, 2015 10:10 PM

If you need access to the points of a 2d (or 3d) object than write your own
routines that create e.g. the points of a circle and write your  own
plotting routine as well.

Somewhat like this:

fn=16;

// create 2d vector shape: circle

function circv(r=1,fn=32)=

[for(i=[0:fn-1])

[rcos(360i/fn),rsin(360i/fn)]

];

// create 2d vector shape: star

function starv(r1=1,r2=2,fn=32)=

[for(i=[0:(2*fn-1)])

(i%2==0)?

[r1cos(180i/fn),r1sin(180i/fn)]:

[r2cos(180i/fn),r2sin(180i/fn)]

];

// display a 2d vector shape

module dispv(v){

indi=[[for(i=[0:len(v)-1])i]];

polygon(points=v,paths=indi);

}

v0=starv(10,20,fn);

dispv(v0);

echo("circle",v0);

v1=circv(10,fn);

translate([40,0,0])dispv(v1);

echo("star",v1);

2015-01-28 4:55 GMT+01:00 MichaelAtOz oz.at.michael@gmail.com:

If your going to do that, have a look at  dxf_dim() etc
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General  (down the
bottom). I have never used it.


Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :) Inclusion of works of previous
authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it!
http://www.ourfairdeal.org/

View this message in context:
http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11271.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

If you need access to the points of a 2d (or 3d) object than write your own routines that create e.g. the points of a circle and write your own plotting routine as well. Somewhat like this: fn=16; // create 2d vector shape: circle function circv(r=1,fn=32)= [for(i=[0:fn-1]) [r*cos(360*i/fn),r*sin(360*i/fn)] ]; // create 2d vector shape: star function starv(r1=1,r2=2,fn=32)= [for(i=[0:(2*fn-1)]) (i%2==0)? [r1*cos(180*i/fn),r1*sin(180*i/fn)]: [r2*cos(180*i/fn),r2*sin(180*i/fn)] ]; // display a 2d vector shape module dispv(v){ indi=[[for(i=[0:len(v)-1])i]]; polygon(points=v,paths=indi); } v0=starv(10,20,fn); dispv(v0); echo("circle",v0); v1=circv(10,fn); translate([40,0,0])dispv(v1); echo("star",v1); 2015-01-28 4:55 GMT+01:00 MichaelAtOz <oz.at.michael@gmail.com>: > If your going to do that, have a look at dxf_dim() etc > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General> (down the > bottom). I have never used it. > > > > ----- > Unless specifically shown otherwise above, my contribution is in the > Public Domain; To the extent possible under law, I have waived all > copyright and related or neighbouring rights to this work. This work is > published globally via the internet. :) Inclusion of works of previous > authors is not included in the above. > > The TPP is no simple “trade agreement.” Fight it! > http://www.ourfairdeal.org/ > -- > View this message in context: > http://forum.openscad.org/Is-there-a-way-to-get-the-points-from-an-object-tp11267p11271.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
MK
Marius Kintel
Thu, Jan 29, 2015 12:48 AM
See also: o https://github.com/openscad/scad-utils/blob/master/shapes.scad o https://github.com/openscad/openscad/issues/630 -Marius