Making parametric curves is fairly easy in OpenSCAD now that it supports list
comprehesions and concatenation:
http://forum.openscad.org/file/n15743/parametric_spiral.png
--
View this message in context: http://forum.openscad.org/2dgraph-equation-based-2-D-shapes-in-openSCAD-tp15722p15743.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On 18. jan. 2016 01:16, David Eccles (gringer) wrote:
Making parametric curves is fairly easy in OpenSCAD now that it supports list
comprehesions and concatenation:
What does the code to create the spiral look like?
Carsten Arnholm
Carsten, have a look at this github repo:
https://github.com/openscad/list-comprehension-demos
At the bottom is a 2d sprial example.
On Mon, Jan 18, 2016 at 11:36 AM, Carsten Arnholm arnholm@arnholm.org
wrote:
On 18. jan. 2016 01:16, David Eccles (gringer) wrote:
Making parametric curves is fairly easy in OpenSCAD now that it supports
list
comprehesions and concatenation:
What does the code to create the spiral look like?
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Interesting, I normally view this mailing list through my gmail account.
David Eccles' post does not show any code here. However I just viewed this
thread through nabble, and there is openscad code in his post.
Any ideas why the mailing list cuts that out?
On Mon, Jan 18, 2016 at 7:13 PM, Hans L thehans@gmail.com wrote:
Carsten, have a look at this github repo:
https://github.com/openscad/list-comprehension-demos
At the bottom is a 2d sprial example.
On Mon, Jan 18, 2016 at 11:36 AM, Carsten Arnholm arnholm@arnholm.org
wrote:
On 18. jan. 2016 01:16, David Eccles (gringer) wrote:
Making parametric curves is fairly easy in OpenSCAD now that it supports
list
comprehesions and concatenation:
What does the code to create the spiral look like?
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
thehans wrote
Any ideas why the mailing list cuts that out?
I believe that the code uses <raw> tag, which will not be sent to
mailing list.
$ Runsun Pan, PhD
$ libs:
doctest ,
faces ( git ),
offline doc ( git ),
runscad.py( 1 , 2 , git ),
synwrite( 1 , 2 );
$ tips:
hash( 1 , 2 ),
sweep ,
var( 1 , 2 ),
lerp ,
animGif ,
precision( 1 , 2 ),
xl-control
--
View this message in context: http://forum.openscad.org/2dgraph-equation-based-2-D-shapes-in-openSCAD-tp15722p15756.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
If you use the < code > tags (under More button), that gets cut by nabble, a
supposed security feature I think.
Best to use < quote > ...code... < / quote >, that gets thru.
DO NOT CLICK the Quote button, that will insert the previous post.
If you didn't get the graphic, it is the plain v's MIME setting on the
mailing list.
Go here <http:// discuss@lists.openscad.org> login (email in field at
bottom) to change your options. Or ask me to (PM).
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
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. Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/2dgraph-equation-based-2-D-shapes-in-openSCAD-tp15722p15757.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
oops...yes < raw >< /raw > not < code >
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
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. Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/2dgraph-equation-based-2-D-shapes-in-openSCAD-tp15722p15758.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Reproduced here for completeness (without any special tags):
r=1;
thickness=2;
loops=3;
linear_extrude(height=1) polygon(points= concat(
[for(t = [90:360*loops])
[(r-thickness+t/90)*sin(t),(r-thickness+t/90)cos(t)]],
[for(t = [360loops:-1:90])
[(r+t/90)*sin(t),(r+t/90)*cos(t)]]
));
--
View this message in context: http://forum.openscad.org/2dgraph-equation-based-2-D-shapes-in-openSCAD-tp15722p15759.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On 19. jan. 2016 11:06, David Eccles (gringer) wrote:
Reproduced here for completeness (without any special tags):
r=1;
thickness=2;
loops=3;
linear_extrude(height=1) polygon(points= concat(
[for(t = [90:360*loops])
[(r-thickness+t/90)*sin(t),(r-thickness+t/90)cos(t)]],
[for(t = [360loops:-1:90])
[(r+t/90)*sin(t),(r+t/90)*cos(t)]]
));
Thank you for sharing! It is rather "dense" syntax, I find it hard to
follow.
Before you posted it, I tried the spiral using AngelScript CSG, here is
the code for comparison
http://arnholm.org/software/as_csg/sweep_spiral.as
OpenSCAD csg file generated
http://arnholm.org/software/as_csg/sweep_spiral.csg
OpenSCAD view
http://arnholm.org/software/as_csg/sweep_spiral.png
The two include files:
http://arnholm.org/software/as_csg/lib_sweep.as
http://arnholm.org/software/as_csg/lib_degrees.as
Carsten Arnholm
Is this easier to follow?
r = 1;
thickness = 2;
loops = 3;
start_angle = 90;
end_angle = 360 * loops;
function spiral(r, t) = let(r = (r + t / 90)) [r * sin(t), r * cos(t)];
inner = [for(t = [start_angle : end_angle]) spiral(r - thickness, t) ];
outer = [for(t = [end_angle : -1 : start_angle]) spiral(r, t) ];
polygon(concat(inner, outer));
On 19 January 2016 at 17:23, Carsten Arnholm arnholm@arnholm.org wrote:
On 19. jan. 2016 11:06, David Eccles (gringer) wrote:
Reproduced here for completeness (without any special tags):
r=1;
thickness=2;
loops=3;
linear_extrude(height=1) polygon(points= concat(
[for(t = [90:360*loops])
[(r-thickness+t/90)*sin(t),(r-thickness+t/90)cos(t)]],
[for(t = [360loops:-1:90])
[(r+t/90)*sin(t),(r+t/90)*cos(t)]]
));
Thank you for sharing! It is rather "dense" syntax, I find it hard to
follow.
Before you posted it, I tried the spiral using AngelScript CSG, here is
the code for comparison
http://arnholm.org/software/as_csg/sweep_spiral.as
OpenSCAD csg file generated
http://arnholm.org/software/as_csg/sweep_spiral.csg
OpenSCAD view
http://arnholm.org/software/as_csg/sweep_spiral.png
The two include files:
http://arnholm.org/software/as_csg/lib_sweep.as
http://arnholm.org/software/as_csg/lib_degrees.as
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org