Rotate relative, or make spokes

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

Rotate relative, or make spokes

vIQleS
This post has NOT been accepted by the mailing list yet.
Noob question soz.

Is there a way of (easily) rotating the arms/spokes around a circle?

I'm trying to replicate this:

https://boardgamegeek.com/thread/991134/modifying-windrose

I made it work, but I thought I'd try it with variables so that you can make an anynumber version. (Cause why not...)

The problem I'm trying to fix is: Can I offset them somehow so that they're nicely arranged? The end result should be more like spokes and less "twisty". (cf code example)

I found a spokes example, but it looked like he was translating the spokes so that they were centered, resulting in an even number of spokes. I want to do the same thing but allow for odd numbers...


--=Code=--

NoArm=7;
ArmWide=3;
ArmHigh=3;
ArmLong=80;
CircSize=6;

DGrees=360/NoArm;

union()
{
    for (i=[1:NoArm])
    {
        rotate([0,0,DGrees*i]) cube([ArmWide,ArmLong,ArmHigh]);
    }

    cylinder(ArmHigh,CircSize,CircSize);
}


Reply | Threaded
Open this post in threaded view
|

Re: Rotate relative, or make spokes

L Boyd
 For( I = [ 0:360/NoArms: 359 ] )  { rotate ( [ 0,0,I])   Etc
Larry
Reply | Threaded
Open this post in threaded view
|

Re: Rotate relative, or make spokes

Chow Loong Jin
On Mon, Nov 23, 2015 at 09:34:28PM -0700, L Boyd wrote:
>  For( I = [ 0:360/NoArms: 359 ] )  { rotate ( [ 0,0,I])   Etc

https://github.com/openscad/MCAD/blob/dev/array/along_curve.scad#L13

Warning: API not stable yet.

--
Kind regards,
Loong Jin

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

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Rotate relative, or make spokes

Hypher
Well, the list managed to not correlate my reply correctly. You can see my resposne here: http://forum.openscad.org/Re-Rotate-relative-or-make-spokes-tp14882.html
Reply | Threaded
Open this post in threaded view
|

Re: Rotate relative, or make spokes

Parkinbot
In reply to this post by vIQleS
You can use the argument
center = true
with cube and cylinder. This gives you the desired result (with an additional translation)

    for (i=[1:NoArm])
    {
        rotate([0,0,DGrees*i])
        translate([0, ArmLong/2, 0])
          cube([ArmWide,ArmLong,ArmHigh], center = true);
    }
    cylinder(ArmHigh,CircSize,CircSize, center = true);