Welcome! Log In Create A New Profile

Advanced

Error rendering a modified stl file

Posted by appjaws1 
Error rendering a modified stl file
April 26, 2016 10:18PM
I am importing a stl file and adding a cube and then cutting a slot but when I try and render, F6, All I get is the new addition, the original stl is not displayed.
This is the code:-

difference(){
union(){
import("1-Hotend_Clamp_E3Dv6.stl",convexity=10);
translate([2.2,1.68,0]) cube([9.5,3.7,6]);
}
translate([0,5.68,1.5]) rotate(-45,0,0) cube([9,1.3,3]); //tie slot
}


attached is the original stl

I have been able to modify stl files before so I don't know what I have done wrong for this not to work

just tried it again and have this console output:-

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:tongue sticking out smileylane_constructor::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
Geometries in cache: 7
Geometry cache size in bytes: 730568
CGAL Polyhedrons in cache: 8
CGAL cache size in bytes: 156032
Total rendering time: 0 hours, 0 minutes, 1 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 16
Halfedges: 48
Edges: 24
Halffacets: 20
Facets: 10
Volumes: 2
Rendering finished.


appjaws - Ormerod 1, core XY
Duet wifi, duex5
firmware 1.18
Web Interface 1.15a
OpenSCAD 2015.03
slic3r-1.33.8-prusa3d and/or Simplify3D 3.1.1
Attachments:
open | download - 1-Hotend_Clamp_E3Dv6.stl (246.5 KB)
Re: Error rendering a modified stl file
April 27, 2016 03:10AM
Your problem was a bad STL file.
I used the Microsoft Model Repair Service and changed your code as follows:
difference(){
	union(){
		import("1-Hotend_Clamp_E3Dv6_fixed.stl",convexity=10);
		translate([2.2,1.68,0]) color("blue")
            cube([9.5,3.7,6]);
	}
	translate([0,5.68,1.5])
        rotate(-45,0,0) color("red")
            cube([9,1.3,3]); //tie slot
}
And now BOTH F5 and F6 work!

1-Hotend_Clamp_E3Dv6_fixed.stl


Bob Morrison
W├Ârth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Error rendering a modified stl file
April 27, 2016 04:13AM
Quote
appjaws1
I am importing a stl file and adding a cube and then cutting a slot but when I try and render, F6, All I get is the new addition, the original stl is not displayed.
I get this quite a lot. I think there are two things that can cause it. The first is a "bad" STL file. This can usually be cured by running the STL through a repair application. Note however that I have come across several STLs on "Thingiverse" and elsewhere that work in some slicers but not others, and will either not render or cannot be modified in OpenScad - but repairing them results in the wrong shape being produced - typically voids and hollows are filled. I'm not sure what can be done about such STLs.

The second cause is a shape that is too complex (too many facets). This can usually be corrected by playing with the values under ["Edit" > "Preferences" > "Advanced"] of the Openscad menu.

Dave
Re: Error rendering a modified stl file
April 27, 2016 04:39AM
Thank you Bob and Dave, I now know what to do in the future if I get an error like this

Paul.


appjaws - Ormerod 1, core XY
Duet wifi, duex5
firmware 1.18
Web Interface 1.15a
OpenSCAD 2015.03
slic3r-1.33.8-prusa3d and/or Simplify3D 3.1.1
Sorry, only registered users may post in this forum.

Click here to login