discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Apparent minkowski() bug in 2019.03.03 dev OpenSCAD

RD
Revar Desmera
Mon, Mar 4, 2019 12:13 PM

I just ran into a really bizarre bug, apparently in minkowski().  The following code renders incorrectly on my system, in both preview and rendering:

$fn = 7;
minkowski() {
cube(0.1);
union() {
translate([5, 0, 0]) cylinder(h=10, r=5, center=true);
cylinder(h=5, r=10, center=true);
}
}

It should output a slightly warped wide cylinder with a longer, thin cylinder poking through it along one side.
Instead it shows what looks like the longer, thin cylinder, with the wider cylinder differenced from it.  It acts like that union() is a difference().

It'll render correctly if you remove the translate().  If you translate by a value other than 5, then it works.  It works if you set $fn to any of 5, 6, 8, 9, or 12, but it fails when $fn is 7, 10, or 11. Very odd!

Here's an image of the failed render, and an image of a successful render with $fn=8:

  • Revar
I just ran into a really bizarre bug, apparently in minkowski(). The following code renders incorrectly on my system, in both preview and rendering: $fn = 7; minkowski() { cube(0.1); union() { translate([5, 0, 0]) cylinder(h=10, r=5, center=true); cylinder(h=5, r=10, center=true); } } It should output a slightly warped wide cylinder with a longer, thin cylinder poking through it along one side. Instead it shows what looks like the longer, thin cylinder, with the wider cylinder differenced from it. It acts like that union() is a difference(). It'll render correctly if you remove the translate(). If you translate by a value other than 5, then it works. It works if you set $fn to any of 5, 6, 8, 9, or 12, but it fails when $fn is 7, 10, or 11. Very odd! Here's an image of the failed render, and an image of a successful render with $fn=8: - Revar
NH
nop head
Mon, Mar 4, 2019 1:51 PM

Yes very bizarre end result, but I think it is due to doing a union of very
nearly coincident faces. Changing the translate to 5 - 1/1024 fixes it.

On Mon, 4 Mar 2019 at 12:14, Revar Desmera revarbat@gmail.com wrote:

I just ran into a really bizarre bug, apparently in minkowski().  The
following code renders incorrectly on my system, in both preview and
rendering:

$fn = 7;
minkowski() {
cube(0.1);
union() {
translate([5, 0, 0]) cylinder(h=10, r=5, center=true);
cylinder(h=5, r=10, center=true);
}
}

It should output a slightly warped wide cylinder with a longer, thin
cylinder poking through it along one side.
Instead it shows what looks like the longer, thin cylinder, with the wider
cylinder differenced from it.  It acts like that union() is a difference().

It'll render correctly if you remove the translate().  If you translate by
a value other than 5, then it works.  It works if you set $fn to any of 5,
6, 8, 9, or 12, but it fails when $fn is 7, 10, or 11. Very odd!

Here's an image of the failed render, and an image of a successful render
with $fn=8:

  • Revar

OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes very bizarre end result, but I think it is due to doing a union of very nearly coincident faces. Changing the translate to 5 - 1/1024 fixes it. On Mon, 4 Mar 2019 at 12:14, Revar Desmera <revarbat@gmail.com> wrote: > I just ran into a really bizarre bug, apparently in minkowski(). The > following code renders incorrectly on my system, in both preview and > rendering: > > $fn = 7; > minkowski() { > cube(0.1); > union() { > translate([5, 0, 0]) cylinder(h=10, r=5, center=true); > cylinder(h=5, r=10, center=true); > } > } > > > It should output a slightly warped wide cylinder with a longer, thin > cylinder poking through it along one side. > Instead it shows what looks like the longer, thin cylinder, with the wider > cylinder differenced from it. It acts like that union() is a difference(). > > It'll render correctly if you remove the translate(). If you translate by > a value other than 5, then it works. It works if you set $fn to any of 5, > 6, 8, 9, or 12, but it fails when $fn is 7, 10, or 11. Very odd! > > Here's an image of the failed render, and an image of a successful render > with $fn=8: > > > - Revar > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >