discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Minkowski difference shows up with F5 but not F6

K
kerog
Mon, Apr 16, 2018 12:53 AM

The following code quick-renders fine (F5) but when I try a full render (F6)
nothing shows up  Any thoughts on why?  Using: 2018.03.17 (git 3e7fbfff)

trayHeight = 1.425.4;
maxCutHeight = 0.4
25.4;

baseThickness = 2;
wallThickness = 2;
cornerRad = 2;
text1 = "1.4"";
text2 = "Subtract 0.0"";
text3 = "For 0 to 0.4"";
textThickness = .6;
textHeight = 4;

riserHeight = trayHeight-baseThickness;
baseLength = 2*riserHeight;

$fn=10;

difference()
{
minkowski()
{
union()
{
linear_extrude(baseThickness)

polygon([[0,0],[baseLength,0],[baseLength/2,sqrt(3)/2*baseLength]],[[0,1,2]],2);

        rotate([0,0,30])
        translate([0,wallThickness/2,baseThickness])
        rotate([90,0,0])
        linear_extrude(wallThickness)
       

polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2);

        translate([baseLength,0,baseThickness])
        rotate([0,0,150])
        translate([0,wallThickness/2,0])
        rotate([90,0,0])
        linear_extrude(wallThickness)
       

polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2);

        translate([baseLength/2,sqrt(3)/2*baseLength,baseThickness])
        rotate([0,0,-90])
        translate([0,wallThickness/2,0])
        rotate([90,0,0])
        linear_extrude(wallThickness)
       

polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2);

    }
    sphere(r=1);
}
translate([0,0,riserHeight])
cube([baseLength,baseLength,5]);

}

--
Sent from: http://forum.openscad.org/

The following code quick-renders fine (F5) but when I try a full render (F6) nothing shows up Any thoughts on why? Using: 2018.03.17 (git 3e7fbfff) trayHeight = 1.4*25.4; maxCutHeight = 0.4*25.4; baseThickness = 2; wallThickness = 2; cornerRad = 2; text1 = "1.4\""; text2 = "Subtract 0.0\""; text3 = "For 0 to 0.4\""; textThickness = .6; textHeight = 4; riserHeight = trayHeight-baseThickness; baseLength = 2*riserHeight; $fn=10; difference() { minkowski() { union() { linear_extrude(baseThickness) polygon([[0,0],[baseLength,0],[baseLength/2,sqrt(3)/2*baseLength]],[[0,1,2]],2); rotate([0,0,30]) translate([0,wallThickness/2,baseThickness]) rotate([90,0,0]) linear_extrude(wallThickness) polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2); translate([baseLength,0,baseThickness]) rotate([0,0,150]) translate([0,wallThickness/2,0]) rotate([90,0,0]) linear_extrude(wallThickness) polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2); translate([baseLength/2,sqrt(3)/2*baseLength,baseThickness]) rotate([0,0,-90]) translate([0,wallThickness/2,0]) rotate([90,0,0]) linear_extrude(wallThickness) polygon([[0,0],[baseLength/sqrt(3),0],[baseLength/sqrt(3),riserHeight]],[[0,1,2]],2); } sphere(r=1); } translate([0,0,riserHeight]) cube([baseLength,baseLength,5]); } -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Apr 16, 2018 1:04 AM

Your polygons are bad, use View/Thrown-Together, purple is bad, see  wiki FAQ
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_model_showing_up_with_F5_but_not_F6?
.


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

Your polygons are bad, use View/Thrown-Together, purple is bad, see wiki FAQ <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_model_showing_up_with_F5_but_not_F6?> . ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
F
fred_dot_u
Mon, Apr 16, 2018 1:06 AM

Not that I have an answer to your question, but when I loaded the file
(copy/paste) and hit F5, there are large areas of background showing
through. When I first hit F6, an error appeared which did not appear in
subsequent F6 presses. Closing the file and opening a blank screen with
paste, the error appears:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() || !internal::Plane_constructor
<Plane>
::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:
/opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251

Not that I have an answer to your question, but when I loaded the file (copy/paste) and hit F5, there are large areas of background showing through. When I first hit F6, an error appeared which did not appear in subsequent F6 presses. Closing the file and opening a blank screen with paste, the error appears: > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion > violation! Expr: pe_prev->is_border() || !internal::Plane_constructor > <Plane> > ::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() > File: > /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h > Line: 251 Using 2017.01.20 git 59df0d1 <http://forum.openscad.org/file/t824/openscad_forum_1.png> -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Apr 16, 2018 1:45 AM

Yes I notice. It appears not to be the polygons...


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

Yes I notice. It appears not to be the polygons... ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Apr 16, 2018 1:54 AM

It appears to not like the co-incident points at the corners of the base.

It works if you make the base so:
itsy=0.05;
#linear_extrude(baseThickness)
polygon([[0,0],[baseLength+itsy,0],[(baseLength+itsy)/2,sqrt(3)/2*(baseLength+itsy)]],[[0,1,2]],9);

I'm suspect CGAL should handle that. Anyone want to call BUG on this?


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

It appears to not like the co-incident points at the corners of the base. It works if you make the base so: itsy=0.05; #linear_extrude(baseThickness) polygon([[0,0],[baseLength+itsy,0],[(baseLength+itsy)/2,sqrt(3)/2*(baseLength+itsy)]],[[0,1,2]],9); I'm suspect CGAL should handle that. Anyone want to call BUG on this? ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Apr 16, 2018 2:00 AM

Oops, not my day today.

I had the cube commented out. Still an issue...


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

Oops, not my day today. I had the cube commented out. Still an issue... ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Apr 16, 2018 3:11 AM

Something weird is going on.

I went back to the source in the OP.
Tried it in 2015.03-02 and it works:
http://forum.openscad.org/file/t359/td23839_2015-03.jpg

Then same source in 2018.04.01, which was what I used when I initially
looked with above posts. It now works:
http://forum.openscad.org/file/t359/td23839_snapshot.jpg

Note that these were both fresh run OpenSCAD instances, and F6 was the first
thing I did.
I then did preview, and that displays badly in both versions.

I definitely got the CGAL error mentioned above in my earlier testing.
Weirdness...


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

Something weird is going on. I went back to the source in the OP. Tried it in 2015.03-02 and it works: <http://forum.openscad.org/file/t359/td23839_2015-03.jpg> Then same source in 2018.04.01, which was what I used when I initially looked with above posts. It now works: <http://forum.openscad.org/file/t359/td23839_snapshot.jpg> Note that these were both fresh run OpenSCAD instances, and F6 was the first thing I did. I then did preview, and that displays badly in both versions. I definitely got the CGAL error mentioned above in my earlier testing. Weirdness... ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
K
kerog
Mon, Apr 16, 2018 3:45 PM

Thanks, for looking at my problem!  Did you have a recommendation on how I
should proceed?

FWIW, what I'm trying to do is make an OpenSCAD version of this:
https://www.thingiverse.com/thing:2829836

My next step was to clean up the base with the following added to the
difference after the part that cuts off the top:

    difference()
    {
       translate([.5*baseLength,.5*baseLength,0])
       cube([2*baseLength,2*baseLength,10],true);
       minkowski()
        {
            linear_extrude(5)
           

polygon([[0,0],[baseLength,0],[baseLength/2,sqrt(3)/2*baseLength]],[[0,1,2]],2);
cylinder(r=1,h=5);
}
}

In case that triggers a different issue...

--
Sent from: http://forum.openscad.org/

Thanks, for looking at my problem! Did you have a recommendation on how I should proceed? FWIW, what I'm trying to do is make an OpenSCAD version of this: https://www.thingiverse.com/thing:2829836 My next step was to clean up the base with the following added to the difference after the part that cuts off the top: difference() { translate([.5*baseLength,.5*baseLength,0]) cube([2*baseLength,2*baseLength,10],true); minkowski() { linear_extrude(5) polygon([[0,0],[baseLength,0],[baseLength/2,sqrt(3)/2*baseLength]],[[0,1,2]],2); cylinder(r=1,h=5); } } In case that triggers a different issue... -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Tue, Apr 17, 2018 12:27 AM

As I can't reproduce the CGAL error on both 2015.03-2 and the 2018.04.01
snapshot, I suggest you try either of these versions, or the latest  here
http://www.openscad.org/downloads.html#snapshots  , first.
I seem to recall a somewhat recent snapshot had a bad regression.

If the error persists, please post the specific error message
(Design/Flush-Caches will reproduce the F6 error message - it sometimes
doesn't get repeated due to caching). And the latest source code if you have
advanced.

There are two issues BTW, whatever is causing the CGAL error, and the really
garbled preview.
The preview can be 'fixed' via Preferences/Advanced-Tab/Enable-Goldfeather.
(I always want to type GoldFinger...for some reason, No Mr Bond, I expect
you to die!)
If that fixes the preview for you, could you post the info from
Help/Library-Info, it often points to a graphics driver problem (different
to the CGAL issue). You could try updating the driver.

For the CGAL error, it should not error when processing normal OpenSCAD
code, imported STLs are usually the cause.
I suspect co-incident faces/edges/points could be the contributor. Like
where the three sides touch each other in the center, and the corners. I'll
look there if you still get the problem.


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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

As I can't reproduce the CGAL error on both 2015.03-2 and the 2018.04.01 snapshot, I suggest you try either of these versions, or the latest here <http://www.openscad.org/downloads.html#snapshots> , first. I seem to recall a somewhat recent snapshot had a bad regression. If the error persists, please post the specific error message (Design/Flush-Caches will reproduce the F6 error message - it sometimes doesn't get repeated due to caching). And the latest source code if you have advanced. There are two issues BTW, whatever is causing the CGAL error, and the really garbled preview. The preview can be 'fixed' via Preferences/Advanced-Tab/Enable-Goldfeather. (I always want to type GoldFinger...for some reason, No Mr Bond, I expect you to die!) If that fixes the preview for you, could you post the info from Help/Library-Info, it often points to a graphics driver problem (different to the CGAL issue). You could try updating the driver. For the CGAL error, it should not error when processing normal OpenSCAD code, imported STLs are usually the cause. I suspect co-incident faces/edges/points could be the contributor. Like where the three sides touch each other in the center, and the corners. I'll look there if you still get the problem. ----- 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
N
NateTG
Tue, Apr 17, 2018 4:08 AM

Here's the error message I see:
Rendering Polygon Mesh using CGAL...ERROR: CGAL error in
CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr:
pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File: /usr/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251
OpenSCAD version 2018.03.24

--
Sent from: http://forum.openscad.org/

Here's the error message I see: Rendering Polygon Mesh using CGAL...ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: pe_prev->is_border() || !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() File: /usr/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251 OpenSCAD version 2018.03.24 -- Sent from: http://forum.openscad.org/