diff options
author | Giles Bathgate <gilesbathgate@gmail.com> | 2011-06-04 10:29:09 (GMT) |
---|---|---|
committer | Giles Bathgate <gilesbathgate@gmail.com> | 2011-06-04 10:35:32 (GMT) |
commit | 82b1216ad2dba7be4d1fe8521c78af3e15994720 (patch) | |
tree | 70e760ceb5cf825b918898c4c0f8e0cb36d5d246 /src/primitives.cc | |
parent | 9ca6f0dedf65ba917319088fdd7708957e87c30c (diff) |
Restores rotation of cylinder to that of previous versions of openscad.
Fix for changes done in commit 8c95ac44629e699c842a883c79d0833c5b83475c
Diffstat (limited to 'src/primitives.cc')
-rw-r--r-- | src/primitives.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/primitives.cc b/src/primitives.cc index 0f82c1b..0b021ce 100644 --- a/src/primitives.cc +++ b/src/primitives.cc @@ -223,10 +223,10 @@ struct point2d { double x, y; }; -static void generate_circle(point2d *circle, double r, int fragments) +static void generate_circle(point2d *circle, double r, int fragments, double offset) { for (int i=0; i<fragments; i++) { - double phi = (M_PI*2* (i + 0.5)) / fragments; + double phi = (M_PI*2* (i + offset)) / fragments; circle[i].x = r*cos(phi); circle[i].y = r*sin(phi); } @@ -311,7 +311,7 @@ PolySet *PrimitiveNode::render_polyset(render_mode_e) const double r = r1 * sin(phi); ring[i].z = r1 * cos(phi); ring[i].points = new point2d[fragments]; - generate_circle(ring[i].points, r, fragments); + generate_circle(ring[i].points, r, fragments,0.5); } p->append_poly(); @@ -373,8 +373,8 @@ sphere_next_r2: point2d *circle1 = new point2d[fragments]; point2d *circle2 = new point2d[fragments]; - generate_circle(circle1, r1, fragments); - generate_circle(circle2, r2, fragments); + generate_circle(circle1, r1, fragments,0.0); + generate_circle(circle2, r2, fragments,0.0); for (int i=0; i<fragments; i++) { int j = (i+1) % fragments; |