Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

scad: rotate angles are being interpreted as radians #31

Closed
tolomea opened this Issue · 3 comments

2 participants

@tolomea

instead of degrees, consider these examples

difference() {
sphere(r=25);
rotate([0, 0, 90]) cylinder(r=12.5,h=50,center=true);
rotate([90, 0, 0]) cylinder(r=12.5,h=50,center=true);
rotate([0, 90, 0]) cylinder(r=12.5,h=50,center=true);
}

difference() {
sphere(r=25);
rotate([0, 0, 1.57079633]) cylinder(r=12.5,h=50,center=true);
rotate([1.57079633, 0, 0]) cylinder(r=12.5,h=50,center=true);
rotate([0, 1.57079633, 0]) cylinder(r=12.5,h=50,center=true);
}

@tolomea tolomea referenced this issue
Merged

scad rotate fixes #35

@colah
Owner

Issue should be fixed. But I think the angle unit should be configurable.

@tolomea

Repost my comment from the pull request:

I think we need a clear decision on degrees vs radians internally and to
convert to and from that as close to the user as possible. I know from
previous projects that having different bits of code using different units
is a bad idea. My preference would be whatever haskells trig functions
expect
With regard to what the user inputs, degrees generally do a better job than
radians. There are 2 main reasons for this:
1: They are much more widely known, so using them makes the tool more
approachable and that in turn drives adoption.
2: They have nice concise rational representations for many of the most
significant values like a whole circle, 1/2, 1/3, 1/4, 1/5, 1/6, 1/8, 1/10,
1/12, 1/16 of a circle.
One alternative that would be interesting is fractions of a circle, so n where radians = tau/n.

@colah
Owner

My preference would be whatever haskells trig functions expect

Radians.

One alternative that would be interesting is fractions of a circle, so n where radians = tau/n.

Well, I don't know about the reciprocal part, but turn would be a nice format to support. ;)

@colah colah closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.