threads-scad icon indicating copy to clipboard operation
threads-scad copied to clipboard

Final rendering throws an error while preview does not.

Open masosnoski opened this issue 1 year ago • 0 comments

Trying to create a nipple that is threaded inside and out. It preview renders fine. When I do the final rendering in order to make an stl file, it throws the following error:

Parsing design (AST generation)... Saved backup file: C:/Users/sosno/Documents/OpenSCAD/backups/LampAdapter-backup-yBChwxzl.scad Compiling design (CSG Tree generation)... Rendering Polygon Mesh using CGAL... ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: assertion violation! Expr: target(s1).vertex()==target(s2).vertex() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 227 Geometries in cache: 90 Geometry cache size in bytes: 67070304 CGAL Polyhedrons in cache: 2 CGAL cache size in bytes: 96450832 Total rendering time: 0:01:06.115 Top level object is a 3D object: Simple: yes Vertices: 19215 Halfedges: 112546 Edges: 56273 Halffacets: 74122 Facets: 37061 Volumes: 2 Rendering finished.

The Openscad script:

use <C:\Users\sosno\Documents\OpenSCAD\threads\threads.scad>

OutSidePitch=(1/20)25.4; // 20 threads/inch InSidePitch=(1/27)25.4; // 27 threads/inch Height = 26; InsideDiameter = 3/825.4; OutsideDiameter = 1/225.4; TopThickness = 2; //
// ScrewHole(3/8*25.4, 26, position=[0,0,0], rotation=[0,0,0], pitch=InSidePitch, tooth_angle=35, tolerance=0.4, tooth_height=1) // ScrewThread(12.2, 26, pitch=OutSidePitch, tooth_angle=35, tolerance=0.4, tip_height=0, tooth_height=1, tip_min_fract=5) // cylinder(h=26, d=12.2); difference(){ union () { ScrewThread(OutsideDiameter, Height, pitch=OutSidePitch, tooth_angle=35, tolerance=0.4, tip_height=0, tooth_height=1, tip_min_fract=5)
cylinder(h=26,d=OutsideDiameter); // translate([0,0,Height-TopThickness]) cylinder(h=TopThickness, d=OutsideDiameter+4); } translate([0,0,-1.5]) ScrewThread(InsideDiameter, Height+3, pitch=InSidePitch, tooth_angle=35, tolerance=0.4, tip_height=0, tooth_height=1, tip_min_fract=5) color("red") cylinder(h=Height+3, r=InsideDiameter); }

I also tried creating it with the lines that are commented out, Same error.

masosnoski avatar Apr 04 '23 19:04 masosnoski