Bending complex shapes, circle of a helix

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

Bending complex shapes, circle of a helix

gimba
This post has NOT been accepted by the mailing list yet.
This is what i try to produce:



I construct a helix like this:

f = 10;
h = 1;
length = 180;

module bar(r, x1, y1, z1, x2, y2, z2) {
        hull() {
    translate([x1, y1, z1]) sphere(r=r);
    translate([x2, y2, z2]) sphere(r=r);
        }
}


for( i = [0 : length] ) {
        bar(2,
        i/h,
        cos(i*f)*10,
        sin(i*f)*10,
    (i+1)/h,
        cos((i+1)*f)*10,
        sin((i+1)*f)*10);
}

The way I tried to bend the shape into a circle is:

for( i = [0 : length] ) {
        bar(2,
        sin(i)*100,
        cos(i*f)*10,
        sin(i*f)*10+i,
        sin(i+1)*100,
        cos((i+1)*f)*10,
        sin((i+1)*f)*10+(i+1));
}

The result is not what I have in mind. Has somebody maybe done something similar?
Reply | Threaded
Open this post in threaded view
|

Re: Bending complex shapes, circle of a helix

Neon22
most people won't see your post as you're not registered for the mailing list. You should ?

As for the dynamic helix.
Check the post a couple back where another user has been making ellipses. Hope it helps.
http://forum.openscad.org/Tough-Nut-How-to-get-text-on-this-ellipse-shape-td13430.html
Reply | Threaded
Open this post in threaded view
|

Re: Bending complex shapes, circle of a helix

MichaelAtOz
Administrator
> most people won't see your post as you're not registered for the mailing list. You should ?


Not sure what you're asking. So;

a. Most people just read the emails which Nabble sends them.
b. Many people do NOT read the web 'forum' here.
c. So, if you are NOT appropriately registered. your posts do not go to the many people at a.
d. Sometimes a new register-person's first post doesn't make it for some timing issue, but second posts are OK.
e. Every so-often, I go through the posts on the web forum, and any with zero replies, I check to see if they are 'lost' posts which didn't make it to the mailing list, and inform them of such.
f. If there is a problem they should do/redo the instructions here.
g. If that fails, they should post a help-me post to attract the attention of the list admins.
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Reply | Threaded
Open this post in threaded view
|

Re: Bending complex shapes, circle of a helix

stonysmith
In reply to this post by gimba
See if this helps:

for( i = [0 :360] ) {
rotate([0,0,i])translate([20+sin(i*6)*2,0,cos(i*6)*2]) sphere(r=1,$fn=16);
rotate([0,0,i])translate([20+sin((i-30)*6)*2,0,cos((i-30)*6)*2]) sphere(r=1,$fn=32);}


Reply | Threaded
Open this post in threaded view
|

Re: Bending complex shapes, circle of a helix

Neon22
Parameterised but I don't have the bars right, or the 90 degree offset for the second spiral :(

```
step = 1; //quality of spiral samples. [0.1-2.0]
max_angle = 90;
pipe_radius = 2;
spiral_radius = 20;
helix_count = 8;
offset = 23; //[1,168], [2,84], [4,42], [5,36], [8,21], [10,18], [16, 11], [20,9], [30,6], [32, 5.5]
helix_radius = 12;
quality = 8;  // $fn for spheres


for( i = [0:step:max_angle] ) {
        pos_1_X = spiral_radius+sin(i*helix_count)*helix_radius;
        pos_1_Z = cos(i*helix_count)*helix_radius;
        pos_2_X = spiral_radius+sin((i-offset)*helix_count)*helix_radius;
        pos_2_Z = cos((i-offset)*helix_count)*helix_radius;
        //hull ()
        rotate([0,0,i])
        translate([pos_1_X, 0, pos_1_Z])
                sphere(r=pipe_radius,$fn=quality);
        //hull()
        rotate([0,0,i])
        translate([pos_2_X, 0, pos_2_Z])
                sphere(r=pipe_radius,$fn=quality);
        // bars
        // if (floor(i%10)==0){
        // echo(i*helix_count, cos(i*helix_count)*360);
                // rotate([0,0,i])
                // translate([pos_1_X, 0, pos_1_Z])
                // rotate([0, (sin(i*helix_count)*360)-180, (cos(i*helix_count)*360)-180])
                        // cylinder(h=helix_radius*2, r=pipe_radius);
        // }
}
```