Is there a way to make this simple shape bend into a circle? … and keep the render time under an hour… 😊
$fn=40;
radius=.5;
offset=radius*2;
for(i=[0:5]){
sign=(i%2==0) ? 1 : -1;
translate([offset*2*i,0,0])
rotate_extrude(angle=sign*180)
translate([offset,0])
circle(r=radius);
}
Is the circle in the x/y plane or the x/z plane?
--
Sent from: http://forum.openscad.org/
I would generate the path as a list of points and then sweep a circle along
the path. It would render almost instantly.
On Wed, 9 Dec 2020 at 15:43, fred_dot_u via Discuss <
discuss@lists.openscad.org> wrote:
Is the circle in the x/y plane or the x/z plane?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Any chance you could provide a simple example? I’ve never swept anything along a path…
From: nop head nop.head@gmail.com
Sent: Wednesday, December 9, 2020 8:47 AM
To: OpenSCAD general discussion discuss@lists.openscad.org
Subject: Re: [OpenSCAD] bending a shape that's only slightly complex
I would generate the path as a list of points and then sweep a circle along the path. It would render almost instantly.
On Wed, 9 Dec 2020 at 15:43, fred_dot_u via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org > wrote:
Is the circle in the x/y plane or the x/z plane?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org mailto:Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Here is a possible code. The module path_sweep() is part of BOSL2 and
sweep() is the classical one.
$fn=40;
radius=.5;
offset=radius*2;
*for(i=[0:5]){
sign=(i%2==0) ? 1 : -1;
translate([offset*2*i,0,0])
rotate_extrude(angle=sign*180)
translate([offset,0])
circle(r=radius);
}
path = [for(i=[0:5],s=(i%2==0)? 1 : -1, a=[0:360/$fn:180-360/$fn])
offset*[2i-cos(sa), sin(s*a),0] ];
function bend_xz(p) =
let( perim = abs(p[len(p)-1].x-p[0].x),
r = perim/PI/2 )
[for(pi=p) [rcos(360pi.x/perim), pi.y,rsin(360pi.x/perim)] ];
//path_sweep(circle(radius),bend_xz(path),closed=true);
sweep(circle(radius),bend_xz(path),closed=true);
[image: bend.PNG]
Em qua., 9 de dez. de 2020 às 20:32, ken@volksswitch.org escreveu:
Any chance you could provide a simple example? I’ve never swept anything
along a path…
From: nop head nop.head@gmail.com
Sent: Wednesday, December 9, 2020 8:47 AM
To: OpenSCAD general discussion discuss@lists.openscad.org
Subject: Re: [OpenSCAD] bending a shape that's only slightly complex
I would generate the path as a list of points and then sweep a circle
along the path. It would render almost instantly.
On Wed, 9 Dec 2020 at 15:43, fred_dot_u via Discuss <
discuss@lists.openscad.org> wrote:
Is the circle in the x/y plane or the x/z plane?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
khackbarth wrote
Is there a way to make this simple shape bend into a circle? … and keep
the render time under an hour… 😊
Since you haven't responded to the question of which plane you want the
circle on, and you have not responded to the suggestions, Untitled.png
http://forum.openscad.org/file/t2121/Untitled.png here's my take on it.
$fn=40;
radius=.5;
offset=radius*2;
rotate_extrude() {
translate ([10,10,0])
projection()
for(i=[0:5]){
sign=(i%2==0) ? 1 : -1;
translate([offset2i,0,0])
rotate_extrude(angle=sign*180)
translate([offset,0])
circle(r=radius);
}
}
--
Sent from: http://forum.openscad.org/
I received a reply, which apparently didn't make it to the list/forum that
the objective is to circle the wagons in the x/y plane. My interpretation in
2D is the image above. If I knew how to make it in 3D, I'd stuff the code in
here.
If the OP thinks my interpretation is incorrect, I hope it will be
corrected.
I'm looking forward to the solution.
http://forum.openscad.org/file/t824/squiggle.png
--
Sent from: http://forum.openscad.org/
Hi Larry,
I did reply but my email program inserted only the direct address to fred_dot_u. I told him X/Y.
Thanks for your input.
Ken
-----Original Message-----
From: lar3ry lar3ry@sasktel.net
Sent: Thursday, December 10, 2020 9:26 AM
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] bending a shape that's only slightly complex
khackbarth wrote
Is there a way to make this simple shape bend into a circle? … and
keep the render time under an hour… 😊
Since you haven't responded to the question of which plane you want the circle on, and you have not responded to the suggestions, Untitled.png http://forum.openscad.org/file/t2121/Untitled.png here's my take on it.
$fn=40;
radius=.5;
offset=radius*2;
rotate_extrude() {
translate ([10,10,0])
projection()
for(i=[0:5]){
sign=(i%2==0) ? 1 : -1;
translate([offset2i,0,0])
rotate_extrude(angle=sign*180)
translate([offset,0])
circle(r=radius);
}
}
--
Sent from: http://forum.openscad.org/
Running stock OpenSCAD version 2019.05 on Mac OS (Big Sur, M1, Rosetta2 Intel
emulation), there is no command sweep(), I get the error "WARNING: Ignoring
unknown module 'sweep', in file ./, line 22."
And what is BOSL2?
Yeah, 3 years using OpenSCAD, and I still call myself a newbie. Sorry.
Ronaldo wrote
Here is a possible code. The module path_sweep() is part of BOSL2 and
sweep() is the classical one.
$fn=40;
radius=.5;
offset=radius*2;
*for(i=[0:5]){
sign=(i%2==0) ? 1 : -1;
translate([offset*2*i,0,0])
rotate_extrude(angle=sign*180)
translate([offset,0])
circle(r=radius);
}
path = [for(i=[0:5],s=(i%2==0)? 1 : -1, a=[0:360/$fn:180-360/$fn])
offset*[2i-cos(sa), sin(s*a),0] ];
function bend_xz(p) =
let( perim = abs(p[len(p)-1].x-p[0].x),
r = perim/PI/2 )
[for(pi=p) [rcos(360pi.x/perim), pi.y,rsin(360pi.x/perim)] ];
//path_sweep(circle(radius),bend_xz(path),closed=true);
sweep(circle(radius),bend_xz(path),closed=true);
[image: bend.PNG]
Em qua., 9 de dez. de 2020 às 20:32, <
ken@
> escreveu:
Any chance you could provide a simple example? I’ve never swept anything
along a path…
From: nop head <
nop.head@
>
Sent: Wednesday, December 9, 2020 8:47 AM
To: OpenSCAD general discussion <
discuss@.openscad
>
Subject: Re: [OpenSCAD] bending a shape that's only slightly complex
I would generate the path as a list of points and then sweep a circle
along the path. It would render almost instantly.
On Wed, 9 Dec 2020 at 15:43, fred_dot_u via Discuss <
discuss@.openscad
wrote:
Is the circle in the x/y plane or the x/z plane?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
Discuss@.openscad
Discuss@.openscad
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
bend.PNG (29K)
<http://forum.openscad.org/attachment/31065/0/bend.PNG>
Answered "What is BOSL2?" for myself, disregard that question :D
Cheers
Sent from: http://forum.openscad.org/