Loading

ERROR: Current top level object is empty.

Please Login to Comment

Hello,
I am a complete beginner with openScad.
When I call the preview with F5 everything is ok. As soon as I want to render with F6, the error message appears.
The single modules go without problems. If I then work with "difference()", it comes to the error message. Can someone help me?
The code is in files.
Thanks, Frank

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
Geometries in cache: 28
Geometry cache size in bytes: 72840
CGAL Polyhedrons in cache: 2
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.061
Top level object is a 3D object:
Facets: 164
Rendering finished.
Loaded design '/home/fbg/Schreibtisch/Kabelhalter_Bett.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
Geometries in cache: 28
Geometry cache size in bytes: 72840
CGAL Polyhedrons in cache: 2
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 2 elements!
Compile and preview finished.
Total rendering time: 0:00:00.079

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
CGAL Cache hit: difference(){linear_extrude(height=50,ce (0 bytes)
Geometries in cache: 28
Geometry cache size in bytes: 72840
CGAL Polyhedrons in cache: 2
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.052
Rendering finished.
ERROR: Current top level object is empty.

I fixed your issue. OpenSCAD does not like it when two facing surfaces are coplanar. It is fine if the coplanar surfaces face the same direction, but not when they face in opposite directions. To fix this, adjust the position of one surface a tiny little bit so that it passes through the other surface. I did this by adjusting the Y position in this statement by 0.01.

    // Querträger
    // ----------
    translate([hw/2, breiteBett + 2 * wandStaerke - 0.01, 0]) 
    square([wandStaerke,hw -10 ]);

That square, when extruded, faces another extruded square, and the two facing surfaces occupied the same plane. Pushing that object into the other object by 0.01 fixed the problem. If you want, you can compensate for this shift by lengthening the object by 0.01 also.

To solve this pragmatic: Make a projection of the profile of your shape as .svg. (See addition)
Then use:

difference()
{
translate([0,-200,0]) // may be different in your situation
linear_extrude(hoeheBauteil)
import("Kabelhalter_Bett.svg");
Kabel_Duchfuehrung();
}

This is less complicated and therefore able to be renderend

Servus!

I tried rendering your model in version 2019.5 under SuSE linux and I got this error message:
UI-WARNING: Object may not be a valid 2-manifold and may need repair!

The problem lies with the Vestärkungen elements. I think that OpenSCAD is having trouble with the difference() command leaving an internal rounding error - Open SCAD doesn't like impossibly thin membranes being left by difference() and thinks that they aren't valid geometry.

My solution is to create both Vestärkungen as a single difference() operation - yes, you can remove several elements in one go...

Delete the first difference() and replace the second with this code:
difference() {
translate([
hoeheBauteil / 2 - 1.5 @ wandStaerke,
wandStaerke + breiteBett,
0])
square([2*radiusVerstaerkung + wandStaerke,radiusVerstaerkung + wandStaerke]);
translate([
hoeheBauteil / 2 - radiusVerstaerkung,
2 @ wandStaerke + breiteBett + radiusVerstaerkung,
0])
circle(radiusVerstaerkung, $fn = 40);
translate([
wandStaerke + hoeheBauteil / 2 + radiusVerstaerkung,
2 @ wandStaerke + breiteBett + radiusVerstaerkung,
0])
circle(radiusVerstaerkung, $fn = 40);
}
You are now creating a rectangle and removing the two circles. And no error messages.

edit: I posted my message then remembered that ThigiVerse doesn't like the asterisk. Please replace the @ symbols with stars for multiplication.

Thanks Meister,
I'll try and try to understand how it works. ;-)

Looks like difference from 2d extrusion was bad idea... But not matter 3d or 2d object you to difference from.