mirror of https://github.com/vitalif/openscad
Restores rotation of cylinder to that of previous versions of openscad.
Fix for changes done in commit 8c95ac4462
stl_dim
parent
9ca6f0dedf
commit
82b1216ad2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue