This is a nasty problem and results from very small numerical "errors" that
occur with rotation.
As a workaround you can enlarge your first cube by a small number.
color("cyan")
translate([10, 0, 200]) rotate([0,20,0])
linear_extrude(height = 200, convexity = 10, twist = 0)
square([200, 35.01], center = true);
--
View this message in context: http://forum.openscad.org/stl-not-correct-by-mesh-generators-tp21241p21245.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Scaling the linear_extrusion before the rotation and translation makes
things worst.
2017-04-16 15:12 GMT-03:00 Parkinbot rudolf@parkinbot.com:
This is a nasty problem and results from very small numerical "errors" that
occur with rotation.
As a workaround you can enlarge your first cube by a small number.
color("cyan")
translate([10, 0, 200]) rotate([0,20,0])
linear_extrude(height = 200, convexity = 10, twist = 0)
square([200, 35.01], center = true);
--
View this message in context: http://forum.openscad.org/stl-
not-correct-by-mesh-generators-tp21241p21245.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
For the why's, or what happens inside OpenSCAD, see my comments in
http://forum.openscad.org/template/NamlServlet.jtp?macro=reply&node=21240
This is about the practical side, how to fix it.
difference()
{
union()
{ $fn=100;
Front();
translate([80, -150, 500]) Cyl();
translate([80, -300, 500]) Cyl();
translate([80, -450, 500]) Cyl();
translate([80, -230, 500]) rotate([90,0,0]) cylinder (h = 440, r=180,
center = true);
}
translate([80, -250, 500]) rotate([90,0,0]) cylinder (h = 1200, r=150,
center = true, $fn=10);
}
module Cyl() // ensure the cylinder's top and bottom are truly vertical
difference()
{
rotate([90,0,0]) cylinder (h = 45, r=250, center = true);
translate([0,-17.5,0]) cube([600,10,600],center=true);
translate([0,17.5,0]) cube([600,10,600],center=true);
}
module Front()
difference()
{ // with twist the extruded shape will rotate around the Z axis
union()
{
translate([10, 0, 0])
linear_extrude(height = 200, convexity = 10, twist = 0)
square([200, 45], center = true);
translate([10, 0, 200]) rotate([0,20,0])
linear_extrude(height = 200, convexity = 10, twist = 0)
square([200, 45], center = true);
translate([80, 0, 500]) rotate([90,0,0]) cylinder (h = 45, r=250,
center = true);
}
translate([80,-17.5,300]) cube([600,10,1000],center=true);
translate([80,17.5,300]) cube([600,10,1000],center=true);
}
By the way: with a $fn=100, there are far too many edges, above picture uses
$fn=10. The excess edges on the inside of the cylinder are currently
harmless, that is going to change if you do something with it . . .
wolf
--
View this message in context: http://forum.openscad.org/stl-not-correct-by-mesh-generators-tp21241p21258.html
Sent from the OpenSCAD mailing list archive at Nabble.com.