summaryrefslogtreecommitdiff
path: root/primitives.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-14 05:25:55 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-14 05:25:55 (GMT)
commitf950feace3beaeec9bd5a6d6e65f7790bd80a9d8 (patch)
treec03b995d7f2589612f0cb284c59e473289313791 /primitives.cc
parent2bea6501b7d7be3e10dc6dae1609f80c5e542199 (diff)
Clifford Wolf:
Fixed cylinders, added "render" statement git-svn-id: http://svn.clifford.at/openscad/trunk@55 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'primitives.cc')
-rw-r--r--primitives.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/primitives.cc b/primitives.cc
index a2ca971..c08e0a1 100644
--- a/primitives.cc
+++ b/primitives.cc
@@ -286,10 +286,20 @@ sphere_next_r2:
for (int i=0; i<fragments; i++) {
double phi = (M_PI*2*i) / fragments;
- circle1[i].x = r1*cos(phi);
- circle1[i].y = r1*sin(phi);
- circle2[i].x = r2*cos(phi);
- circle2[i].y = r2*sin(phi);
+ if (r1 > 0) {
+ circle1[i].x = r1*cos(phi);
+ circle1[i].y = r1*sin(phi);
+ } else {
+ circle1[i].x = 0;
+ circle1[i].y = 0;
+ }
+ if (r2 > 0) {
+ circle2[i].x = r2*cos(phi);
+ circle2[i].y = r2*sin(phi);
+ } else {
+ circle2[i].x = 0;
+ circle2[i].y = 0;
+ }
}
for (int i=0; i<fragments; i++) {
contact: Jan Huwald // Impressum