# Problem with union

3 messages
Open this post in threaded view
|

## Problem with union

 This post has NOT been accepted by the mailing list yet. Hi, I'm new to openSCAD and during "testing" it I got a mysterious error. The code below can be previewed bat not render. The stl also can not be save properly. Both parts can be rendered separably. Any hint, please. Best regards, Staszek ============================= code ================================ function square(x) = sqrt(1 - x * x); union() {     difference() {         rotate_extrude(angle=360,convexity=4, \$fn=6)         polygon([[0,0],             [3.95, square(0.9)-0.5],             [3.9, square(0.8)-0.5],             [3.85, square(0.7)-0.5],             [3.8, square(0.6)-0.5],             [3.75, square(0.5)-0.5],             [3.7, square(0.4)-0.5],             [3.65, square(0.3)-0.5],             [3.6, square(0.2)-0.5],             [3.55, square(0.1)-0.5],         [3.5,0.5], [2.5,0.5], [2.5,0.8], [0,0.8]]);         union() {             rotate(30,[0,0,1]) cube([8,1.2, 2],true);             rotate(90,[0,0,1]) cube([8,1.2, 2], true);             rotate(150,[0,0,1]) cube([8,1.2, 2], true);         }     }     rotate_extrude(angle=360,convexity=3, \$fn=6)     polygon([[3.5,0.5],             [3.45, square(0.9)],             [3.4, square(0.8)],             [3.35, square(0.7)],             [3.3, square(0.6)],             [3.25, square(0.5)],             [3.2, square(0.4)],             [3.15, square(0.3)],             [3.1, square(0.2)],             [3.05, square(0.1)],             [3.0, 1], [2.5,1],             [2.25, 3 - square(0.1) * 2],             [2.125, 3 - square(0.2) * 2],             [2.0, 3 - square(0.3) * 2],             [1.875, 3 - square(0.4) * 2],             [1.75, 3 - square(0.5) * 2],             [1.625, 3 - square(0.6) * 2],             [1.5, 3 - square(0.7) * 2],             [1.375, 3 - square(0.8) * 2],             [1.25, 3 - square(0.9) * 2],             [1.15, 3 - square(0.9) * 2],             [1.15, 0.5]     ]); }