puzzlecutlib rendering problem & STL export error Current top level object is empty.

classic Classic list List threaded Threaded
56 messages Options
123
Reply | Threaded
Open this post in threaded view
|

puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
Hi:

Hoping some one can help me out. I did search for this error, and did find other people with similar problem but no real solution that applies to my problem.

I have downloaded puzzlecutlib.scad from thiniverse in order to cut up an stl model that is slightly too big for my 3D printer. I was able to get the puzzle cut where I wanted it after a bit of tweaking of the code. Including changing the "child" statements in the library file to "children" to eliminate one error. I also modified the puzzlecutdemo2.scad and added translate([70,0,-22]) at the bottom of the code that imports the stl because the model was importing in the wrong alinement with the puzzle cut.

I now have it just the way I want it. But I have a problem rendering it. I get this error with F6:

"Compiling design (CSG Tree generation)...
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: /opt/mxe/usr/i686-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251
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: /opt/mxe/usr/i686-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251
Geometries in cache: 14
Geometry cache size in bytes: 415712
CGAL Polyhedrons in cache: 12
CGAL cache size in bytes: 152016
Total rendering time: 0 hours, 0 minutes, 2 seconds
Rendering finished."

I seem to have solve that error by saving the file with a new name. I now get a different error, I can not see the model after hitting F6 unless I select preview. And I get this error when I try to export to STL:

"Current top level object is empty. " when trying to export as STL.

The code for both files are listed below:

puzzlecutdemo2.scad:

//OpenSCAD PuzzleCut Library Demo - by Rich Olson
//http://www.nothinglabs.com
//Tested on build 2012.08.22
//License: http://creativecommons.org/licenses/by/3.0/
//demo object "Bucket O' Octopodes (thicker legs)" - http://www.thingiverse.com/thing:8896

//NOTE: Complex objects may result in "normalized tree" errors / rendering problems
//These can be worked around by doing a full render (just hit F6)

include <puzzlecutlib.scad>

stampSize = [500,500,70]; //size of cutting stamp (should cover 1/2 of object)

cutSize = 8; //size of the puzzle cuts

xCut1 = [-58 ,-5 ,-30]; //locations of puzzle cuts relative to X axis center
yCut1 = [-4, 5, 16]; //for Y axis

kerf = 0; //supports +/- numbers (greater value = tighter fit)
                                        //using a small negative number may be useful to assure easy fit for 3d printing
                                        //using positive values useful for lasercutting
                                        //negative values can also help visualize cuts without seperating pieces

cutInTwo(); //cuts in two along y axis
//cutInFour(); //cuts in four along x / y axis

//comment out lines as needed to render individual pieces

module cutInTwo()
{
        translate([0,-20,0])
                xMaleCut() drawOcto();

        translate([0,0,0])
                xFemaleCut() drawOcto();
}

module cutInFour()
{
        translate([6,-6,0])
                xMaleCut() yMaleCut() drawOcto();

        translate([-6,-6,0])
                xMaleCut() yFemaleCut() drawOcto();

        translate([6,6,0])
                xFemaleCut() yMaleCut() drawOcto();

        translate([-6,6,0])
                xFemaleCut() yFemaleCut() drawOcto();
}


module drawOcto()
{
        rotate ([0,-90,90]) translate([70,0,-22]) import("Cycl_XleftFrame-base cut.stl");
   
   
}

***********************************
puzzlecutlib.scad:

//OpenSCAD PuzzleCut Library Demo - by Rich Olson
//http://www.nothinglabs.com
//Tested on build 2012.08.22
//License: http://creativecommons.org/licenses/by/3.0/


module xMaleCut(offset = 0, cut = xCut1)
{
        difference()
        {
                children(0);
                translate([0,offset,0]) makePuzzleStamp(cutLocations = cut);
        }
}


module xFemaleCut(offset = 0, cut = xCut1)
{
        intersection()
        {
                children(0);
                translate([0,offset,0]) makePuzzleStamp(cutLocations = cut,
                         kerf = kerf); //only set kerf on female side
        }
}


module yMaleCut(offset = 0, cut = yCut1)
{
        difference()
        {
                children(0);
                rotate ([0,0,90]) translate([0,offset,0]) makePuzzleStamp(cutLocations = cut);
        }
}


module yFemaleCut(offset = 0, cut = yCut1)
{
        intersection()
        {
                children(0);
                rotate ([0,0,90]) translate([0,offset,0]) makePuzzleStamp(cutLocations = cut,
                         kerf = kerf); //only set kerf on female side
        }
}



module makePuzzleStamp(kerf = 0)
{
        difference()
        {
                //make the cube
                translate ([0,stampSize[0] / 2 - kerf,0])
                        cube (stampSize, center = true);
               
                //make the cuts
                for ( i = cutLocations )
                {
                        translate([i,0,0])
                                cube ([(cutSize / 2) - kerf * 2, cutSize - kerf * 2,stampSize[2]], center = true);
                        translate([i,cutSize / 2,0])
                                cube ([cutSize - kerf *  2,(cutSize / 2) - kerf * 2, stampSize[2]], center = true);
                }
        }
}



Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
Your STL is probably invalid, check it with Netfabb Basic, or share it here.
I seem to have solve that error by saving the file with a new name. I now get a different error, I can not see the model after hitting F6 unless I select preview. And I get this error when I try to export to STL:

"Current top level object is empty. " when trying to export as STL.
The F6 is cached, so you don't get the error again unless you clear cache or exit/rerun OpenSCAD. (a flaw IMO).
Object is empty because F6 failed.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
Hi MichaelAtOz:

The stl file I am trying to use the puzzlecut plugin on originally came from netfabb. So the stl should be valid. I'll attach all the files I am using below. Hopefully you can see the error.

I don't see the problem, but then again I'm fairly new to OpenSCAD.

I even asked the author of the plugin, but he has not posted anything on his block for nearly a year. So seems like he is MIA. Thanks.

Cycl_XleftFrame-base_cut.stl
puzzlecutlib.scad
puzzlecutdemo2-cut.scad
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
Well the STL doesn't show any issues in Meshlab or Netfabb Basic.
But doing

translate([60,10,-10])
import("td17440 Cycl_XleftFrame-base_cut2.stl");
cube([10,20,5]);

Causes the error. So CGAL doesn't like it.
The error '->plane()).is_degenerate() ' points to degenerate faces, but these usually are detected by Netfabb.
Meshmixer says it has repaired the file, but unfortunately it doesn't tell what it did or what was wrong.

So I ran it thru Netfabb online and it now works.

Here is the fixed file td17440_Cycl_XleftFrame-base_cut_fixed.stl 
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
Hi MichaelAtOz:

I looked at the td17440_Cycl_XleftFrame-base_cut_fixed.stl file and it did not have the puzzle cuts. So I opened in OpenSCAD and tried to render and then export to stl. Here is the result:

Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: assertion violation! Expr: cet->get_index() == ce->twin()->get_index() File: /opt/mxe/usr/i686-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1169
ERROR: CGAL error in CGALUtils::applyBinaryOperator intersection: CGAL ERROR: assertion violation! Expr: cet->get_index() == ce->twin()->get_index() File: /opt/mxe/usr/i686-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1169
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File: /opt/mxe/usr/i686-w64-mingw32.static/include/CGAL/Nef_S2/SM_overlayer.h Line: 287
Geometries in cache: 14
Geometry cache size in bytes: 466976
CGAL Polyhedrons in cache: 12
CGAL cache size in bytes: 2695800
Total rendering time: 0 hours, 0 minutes, 15 seconds
Rendering finished.
Current top level object is empty.


As you can see I am still getting the CGAL error along with the object is empty error when I try to export. I should mention I am using OpenSCAD version 2015.03-2. And I'm on a 32bit version of windows. Did you try exporting the part with the puzzle cuts to stl? Or did you just run the unmodified stl through netfabb online?
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
FourthDr wrote
As you can see I am still getting the CGAL error along with the object is empty error when I try to export.
Well you're getting different CGAL errors. The object will always be empty with CGAL errors.
Did you try exporting the part with the puzzle cuts to stl? Or did you just run the unmodified stl through netfabb online?
I didn't try puzzlecut.
I ran your STL thru Netfabb online, then used it with my code above, to confirm that the error '->plane()).is_degenerate() ' was fixed.

So puzzlecut is now getting a different error;

ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: assertion violation! Expr: cet->get_index() == ce->twin()->get_index() File: /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1169

which I don't recall seeing before. So this is now beyond me.

Can someone else have a look. Fixed STL is above.

I cut the code back to a minimalish;

// Cut down version of below for testing
//OpenSCAD PuzzleCut Library Demo - by Rich Olson http://www.nothinglabs.com
//License: http://creativecommons.org/licenses/by/3.0/

stampSize = [200,200,50]; //size of cutting stamp (should cover 1/2 of object)

difference()
{
        rotate ([0,-90,90])
                translate([70,0,-22])
                        import("td17440 Cycl_XleftFrame-base_cut_fixed.stl", convexity=8);
// -
        difference()
        {
                translate ([0,stampSize[0] / 2,0])
                        cube (stampSize, center = true);
                // -
                translate([0,0,0])
                        cube ([4, 8 ,stampSize[2]+2], center = true);
        }
}
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
Hi MichaelAtOz:

Thanks for the old college try. Seems like I've spent way too much of your time and mine on this. What should have been a quick cut and export is turning into a week frustration with no end in sight. Maybe you could recommend another piece of software that would let me quickly break an STL into two interlocking pieces? I have only two more parts this one and one other to print so I can complete my project. And this problem preventing from moving forward.
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
I was about to say "How much strength do you need? You could glue them. With ABS two pieces joined with acetone are melted into one piece." but I tried a simple split which failed too.

It is a problem with the STL, I suspect other tools may have a problem too.
There are CAD tools you could use, but I'm not up to date on the best for this.
Others here could suggest.
You could export the makePuzzleStamp(cutLocations = cut); shape then try a boolean in the CAD program.

For others. Cut down some more, note error occurs with intersection too;

stampSize = [170,100,50]; //size of cutting stamp (should cover 1/2 of object)

//difference()
intersection()
{
        rotate ([0,-90,90])
                translate([70,0,-22])
                        import("td17440 Cycl_XleftFrame-base_cut_fixed.stl", convexity=8);
// -
                translate ([0,stampSize[1] / 2,0])
                        cube (stampSize, center = true);
                // -

}
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
Hi MichaelAtOz:

I thought about gluing the parts together, but I don't think that would work very will with PLA. The parts are for the Cyclone PCB Factory. Basically a mini milling machine for PCB's and other light materials like acrylic wood etc.. The parts are for the X axis, so they need to be solid enough for left-right motion and to support a Dremel on top. An interlocking cut would make the two parts stronger than just glue. I suppose I could screw them together. It just would have been so much more elegant to be able to make the puzzle cut. You would think this problem comes up frequently enough that some of the major 3D software publishers would have a built-in solution for when a part is too big to print.
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

nophead
This repaired version seems to work. With Michael's version I got the error message but instead of an empty object I got something that looked like the original. I exported that and repaired it in Netfabb. That version will then cut with Michael's test.

On 29 May 2016 at 08:36, FourthDr <[hidden email]> wrote:
Hi MichaelAtOz:

I thought about gluing the parts together, but I don't think that would work
very will with PLA. The parts are for the Cyclone PCB Factory. Basically a
mini milling machine for PCB's and other light materials like acrylic wood
etc.. The parts are for the X axis, so they need to be solid enough for
left-right motion and to support a Dremel on top. An interlocking cut would
make the two parts stronger than just glue. I suppose I could screw them
together. It just would have been so much more elegant to be able to make
the puzzle cut. You would think this problem comes up frequently enough that
some of the major 3D software publishers would have a built-in solution for
when a part is too big to print.



--
View this message in context: http://forum.openscad.org/puzzlecutlib-rendering-problem-STL-export-error-Current-top-level-object-is-empty-tp17440p17454.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

repaired.stl (239K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

nophead
I replied with a version that works but it is blocked for being too long.

On 29 May 2016 at 10:51, nop head <[hidden email]> wrote:
This repaired version seems to work. With Michael's version I got the error message but instead of an empty object I got something that looked like the original. I exported that and repaired it in Netfabb. That version will then cut with Michael's test.

On 29 May 2016 at 08:36, FourthDr <[hidden email]> wrote:
Hi MichaelAtOz:

I thought about gluing the parts together, but I don't think that would work
very will with PLA. The parts are for the Cyclone PCB Factory. Basically a
mini milling machine for PCB's and other light materials like acrylic wood
etc.. The parts are for the X axis, so they need to be solid enough for
left-right motion and to support a Dremel on top. An interlocking cut would
make the two parts stronger than just glue. I suppose I could screw them
together. It just would have been so much more elegant to be able to make
the puzzle cut. You would think this problem comes up frequently enough that
some of the major 3D software publishers would have a built-in solution for
when a part is too big to print.



--
View this message in context: http://forum.openscad.org/puzzlecutlib-rendering-problem-STL-export-error-Current-top-level-object-is-empty-tp17440p17454.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

nophead
It made it to the forum though.
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
In reply to this post by nophead
nophead wrote
I replied with a version that works but it is blocked for being too long.
Lets see in an Admin can fix that...
nopheads_repaired.stl
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
In reply to this post by nophead
nophead wrote
It made it to the forum though.
I just approved it, but didn't see it in the forum, but in the mailing list. Hence above forum post, which seems to have worked.

Nophead, what version did you use to export that? (and I presume when you say Michael's version you mean ..._fixed.stl?)
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

Parkinbot
In reply to this post by FourthDr
For me kisslicer is a good indicator tool to find out where a stl is degenerate. This is what it indicates with your STL:

Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
So, what does a 'blade edge' mean?
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

nophead
In reply to this post by MichaelAtOz


On 29 May 2016 at 11:38, MichaelAtOz <[hidden email]> wrote:
nophead wrote
> It made it to the forum though.

I just approved it, but didn't see it in the forum, but in the mailing list.
Hence above forum post, which seems to have worked.

Nophead, what version did you use to export that? (and I presume when you
say Michael's version you mean ..._fixed.stl?)

I used OpenScad 2015.05.16 (git e673fff).

Yes it came from your td17440_Cycl_XleftFrame-base_cut_fixed.stl. Netfabb doesn't show any errors in that but once it has passed through OpenScad / CGAL it shows 20 holes and 17 shells.







-----
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!
--
View this message in context: http://forum.openscad.org/puzzlecutlib-rendering-problem-STL-export-error-Current-top-level-object-is-empty-tp17440p17459.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

Parkinbot
In reply to this post by MichaelAtOz
"blade edge sharp crease" is what it says and mostly results from numerical errors. (Almost) degenerated triangles will most probably not show up as 'desired' in the sliced path. A closer look at the triangulation (CTRL+1) unveals what has happend.

Kisslicer indicates those errors, but silently gets around most of them. Redness of colors indicate severity of errors.
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

FourthDr
In reply to this post by MichaelAtOz
Hi MichaelAtOz:

I see this attached STL actually compiles with no problems. What did you do to the file? Or to the OpenSCAD code? Has an admin responded to your request yet? If not, you can PM(not sure if this forum supports that) me and I'll arrange an ftp upload if needed. Let me know. I actually will need to make changes to my part, so having working OpenSCAD code or a work-around procedure would be helpful. Thank you for the help :-)
Reply | Threaded
Open this post in threaded view
|

Re: puzzlecutlib rendering problem & STL export error Current top level object is empty.

MichaelAtOz
Administrator
Nophead loaded that STL saying  above "This repaired version seems to work. With Michael's version [aka the ...fixed.stl] I got the error message but instead of an empty object I got something that looked like the original. I exported that and repaired it in Netfabb. That version will then cut with Michael's test.".

I just loaded his STL after his post got held up, as I'm an Admin.

I just tried to reproduce what he did and can't get the same result (tho not using his exact version). The STL still gets the error, and Netfabb doesn't show any issues.

So sorry, not solved...
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
123