Hello everybody
i need help with this:
with openscad 2018.06.14 from github
this code:
h=9.2-4+.3;
difference()
{
cube([20,2h,2h]);
cylinder(d=15,h=h);
translate([0,0,h])
{
cube([17,20,4]);
cylinder(d=15,h=h);
}
}
produces this after rendering:
but if you change the value of h at the first line to
h=5.2+.3;
(which is still the same number as above h=9.2-4+.3 and still equals to
5.5 )
restart openscad to reset cache, and rerender, you will get a different
picture:
anybody knows which version(revision) of openscad is last to be known to
not have this effect?
why do i get 2 volumes anyway?
Thanks for advice. Peter
Try this
h=9.2-4+.3;
h2=5.2+.3;
h3=5.2+.3+0.000005;
echo(h=h,h2=h2,h3=h3);
echo( (h==h2) ? "EQ" : "NEQ" );
echo( h-h2);
Floating point plays tricks, compounded, AGAIN, by echo rounding results.
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
You get two volumes for a single object because the outside universe counts
as a volume. So you always need to subtract one from what OpenSCAD reports.
Also internal cavities count as volumes, so a hollow sphere would report 3
volumes.
On 20 June 2018 at 14:43, MichaelAtOz oz.at.michael@gmail.com wrote:
Try this
h=9.2-4+.3;
h2=5.2+.3;
h3=5.2+.3+0.000005;
echo(h=h,h2=h2,h3=h3);
echo( (h==h2) ? "EQ" : "NEQ" );
echo( h-h2);
Floating point plays tricks, compounded, AGAIN, by echo rounding results.
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org