Welcome! Log In Create A New Profile

Advanced

ERROR: CGAL error

Posted by appjaws1 
ERROR: CGAL error
August 14, 2017 06:54AM
Hi all,
I have tried everything I and my poor skill level, can think of.
I keep getting the following error
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: target(s1).vertex()==target(s2).vertex() File: /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 218

This works
if (leftfront) {
import("D:/Core XY/appjaws-Core-XY/files/1-Motor_Mount_Left.stl",convexity=10);
translate([0,20.5,0]) rotate([0,0,0]) mirror([0,1,0]) inlinemount();
translate([68.25,20.25,35.15]) cube([13,3.75,12]);
}

The next 3 do not work
if (rightfront){
import("D:/Core XY/appjaws-Core-XY/files/1-Motor_Mount_Right.stl",convexity=10);
translate([20.5,0,0]) rotate([0,0,90])inlinemount();
translate([20.25,68.25,35.15]) cube([3.75,13,12]);
}

if (rightrear){
import("D:/Core XY/appjaws-Core-XY/files/1-Rear_Idler_Right.stl",convexity=10);
difference(){
translate([90.5,190,0]) mirror([0,1,0])rotate([0,0,90]) inlinemount();
translate([60.25,105,-1]) cube([35,13,50]);
translate([60.25,60,44]) cube([35,50,13]);
}
}

if (leftrear){
import("D:/Core XY/appjaws-Core-XY/files/1-Rear_Idler_left.stl",convexity=10);
difference(){
translate([189.9,93.98,3.5]) mirror([1,0,0])rotate([90,0,0]) inlinemount();
translate([105.25,40,-1]) cube([15,60,35]);
}
}


this is the inlinemount code
module inlinemount(){
difference(){
translate([84,20.5,0]) mirror([0,1,0])rotate([0,0,0]) import("D:/Core XY/appjaws-Core-XY/files/1-Motor_Mount_Left.stl",convexity=10);
translate([80,-53.5,-1]) cube([70,50,60]);
translate([126,-10.5,-1]) cube([50,50,60]);
}
translate([80.25,-3.5,-0.0]) cube([4,24,47]);
}

Attached files of the 4 stl files

Any help please.
Thanks
Paul


appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
OpenSCAD version 2020.07
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
Attachments:
open | download - 1-Motor_Mount_Left.stl (281.9 KB)
open | download - 1-Motor_Mount_Right.stl (264.2 KB)
open | download - 1-Rear_Idler_Right.stl (329.9 KB)
open | download - 1-Rear_Idler_Right.stl (329.9 KB)
Re: ERROR: CGAL error
August 31, 2017 01:32AM
Could you please point out where line 218 (the line where the error occurs) is please? I don't believe it's in the section of code you've pasted as the error is regarding a union operation and there are no union operations in the section of code you posted.

My shot in the dark from the error message and the fact you're importing STLs is that the STLs have some errors in them. They're likely non manifold; this means a triangle could be inside out (STL triangles have an 'inside' and 'outside' face), there could be a hole in your object or there could be a triangle with zero area (all three points are identical). All of these cause issues in OpenSCAD when using union/difference/intersection operators.

I suggest running the STLs through a STL repair service like netfab or something, it may fix your issue, but without seeing the part of the code which caused the error I don't know.

Hope it helps.
Re: ERROR: CGAL error
August 31, 2017 01:32AM
Could you please point out where line 218 (the line where the error occurs) is please? I don't believe it's in the section of code you've pasted as the error is regarding a union operation and there are no union operations in the section of code you posted.

My shot in the dark from the error message and the fact you're importing STLs is that the STLs have some errors in them. They're likely non manifold; this means a triangle could be inside out (STL triangles have an 'inside' and 'outside' face), there could be a hole in your object or there could be a triangle with zero area (all three points are identical). All of these cause issues in OpenSCAD when using union/difference/intersection operators.

I suggest running the STLs through a STL repair service like netfab or something, it may fix your issue, but without seeing the part of the code which caused the error I don't know.

Hope it helps.
Re: ERROR: CGAL error
September 05, 2017 07:21AM
I have found that such errors can occur for some reason when you use a union operation on shapes that do not overlap. At least that appears to be the crux of the issue as I got rid of it by removing the (perfectly valid) union operation.

Dave
Re: ERROR: CGAL error
September 12, 2017 04:47AM
Thank you Dave, I got so frustrated with this problem so I have designed the items from scratch.

It would be of great help if the issues that produce an error like this could be highlighted, either on the render or in the code.

The same problem occurs when the object that has been created is not manifold, it would help if the problem area could be indicated so that in a very complicated part the user will know where to modify the code.

Paul


appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
OpenSCAD version 2020.07
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
Sorry, only registered users may post in this forum.

Click here to login