Original problem using OpenSCAD to import an STL fils
union()
{
translate([0, 0, 6])
scale([0.9842519685, 0.9842519685, 1])
import("floor.stl");
cube([50, 50, 6]);
}
Error message Rendering Polygon Mesh using CGAL... ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /usr/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426
Fix the problem using AngelCADs polyfix utility:
$ polyfix floor.stl
Parameters:
input_file = floor.stl
polyhedron 0 ================= volume=10890.5, dtol=0.01, atol=1e-06, maxiter=10
iteration 0: vertices=92100 faces=30700
warning: 1 zero area faces.
warning: nonmanifold edges: uc(1)=92100
merged 76748 vertices
removed 1 collapsed or zero area face
split 1 face
total changes=76750
no warnings
iteration 1: vertices=15352 faces=30700
total changes=0
no warnings
Summary:
polyhedron 0: vertices=15352 faces=30700 : no warnings
Writing: floor_1.stl
... polyfix finished, time used: 0d 00h 00m 01s
Then import the repaired file into OpenSCAD and press F6
union()
{
translate([0, 0, 6])
scale([0.9842519685, 0.9842519685, 1])
import("floor_1.stl");
cube([50, 50, 6]);
}
The problem is now gone
Polyfix and Angelcad are 2 different executables (polyfix is installed alongside AngelCAD though). You must run polyfix from the command line, outside AngelCAD.
This gist is about running polyfix to fix a bad STL. The .scad scripts shown here are for OpenSCAD.
The error you describe is from "as_csg" which is AngelCADs language interpreter. If you want to import the file into AngelCAD you must first use polyfix to convert/fix the original STL into .off or .obj format
Then you can import it in AngelCAD
floor_angelcad.as
For general support questions relating to anything AngelCAD, consider using the AngelCAD forum at https://forum.abmesh.com/