

hi,
trying to generate a large (25mm) screw, 9mm long, with a decent (between the U.S. "national coarse" and "national fine") thread count.
if i use:
metric_thread(diameter=25, pitch=26, length=strsScrewLength, internal=false, n_starts=1);
it fails (see below);
if i use:
metric_thread(25, 16, strsScrewLength);
it works.
if anyone has any advice, i'm all ears.
thanks
twistOneUp
the scad and the output of failing F6:
THE SCAD:

use <threads.scad>;
include <foo.scad>;
genTest = true;
strhFn=(genTest) ? 30 : 30;
//strhKeeperHoleOffsetFromCentah = (strhDiametah/2)strhKeeperHoleFromEdge;
union() {
difference() {
union() {
cylinder(r=strhSpacerRadius, h=strhSpacerWidth, $fn=strhFn, center=true);
translate([0, 0, (strhSpacerWidth/2)])//strhSpacerWidth])
cylinder(r=strhGripRadius, h=strhGripWidth, $fn=strhFn);
}
// iterate da grips
for (i = [0 : (strhGripHoleQuantity1)]) {
translate([(strhGripRadius*sin(i*(360/strhGripHoleQuantity))), (strhGripRadius*cos(i*(360/strhGripHoleQuantity))), (strhSpacerWidth/2)])
cylinder(r=(strhGripHoleDiametah/2), h=strhSpacerWidth, $fn=strhFn);
}
}
// smooth the "gear teeth"
for (i = [0 : (strhGripHoleQuantity1)]) {
translate([((strhGripRadius*sin(i*(360/strhGripHoleQuantity)+((360/strhGripHoleQuantity/2))))), ((strhGripRadius*cos(i*(360/strhGripHoleQuantity)+((360/strhGripHoleQuantity/2))))), (strhSpacerWidth/2)])
cylinder(r=(strhGripHoleDiametah/4), h=strhGripWidth, $fn=strhFn);
}
// add in shaft (splined)
rotate([180, 0, 0])
cylinder(r=12.7, h=50, $fn=strhFn);
for (i=[0:(strhGripHoleQuantity1)]) {
rotate([180, 0, 0])
if ( (i==0)  (i==3)  (i==6)  (i==9) ) {
translate([1.25, 1.25, 5])
translate([12.7*sin(i*(360/strhGripHoleQuantity)), 12.7*cos(i*(360/strhGripHoleQuantity)), (strhSpacerWidth/2)])
cube([2.5, 2.5, 50]);
}
}
// add in da screw
translate([0, 0, 59])
// metric_thread(25, 16, strsScrewLength); // takes forEVAH!
metric_thread(diameter=25, pitch=26, length=strsScrewLength, internal=false, n_starts=1);
}
foo.scad:
strStrappingWidth = 25.4;
strDiametah = 4*25.4;
strThickness = 4;
strCenterHoleDiametah = 25;
strPinHoleQuantity = 12;
strPinHoleDiametah = 10;
strPinpHoleFromEdge = 4;
strhGripHoleQuantity = 12;
strhSpacerRadius = 17.5;
strhSpacerWidth = 10;
strhGripRadius = 25;
strhGripWidth = 5;
strhGripHoleDiametah = 10;
strcsRadius = 16;
strcsSpacerInsetIntoReel = 2;
strcsAddlWidthAroundStrap = 1;
strpPinGripRadius = 6;
strpPinGripLength = 12;
strpPinCollarRadius = 8;
strpPinCollarThickness = 2;
strpPinProngRadius = 6;
strpPinProngLength = 12;
strsScrewLength = 9;
THE OUTPUT:

Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
CGAL error in CGAL_Nef_polyhedron's intersection operator: CGAL ERROR: assertion violation!
Expr: itl != it>second.end()
File: ../openscad_deps/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
PolySets in cache: 0
PolySet cache size in bytes: 0
CGAL Polyhedrons in cache: 1167
CGAL cache size in bytes: 104848440
Top level object is a 3D object:
Simple: yes
Vertices: 1018
Halfedges: 3054
Edges: 1527
Halffacets: 1026
Facets: 513
Volumes: 2
Total rendering time: 0 hours, 0 minutes, 6 seconds
Rendering finished.

Administrator

where is threads.scad?
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

Administrator

With the latest snapshot, I get a different, single error.
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: itl != it>second.end() File: /data/OpenSCAD/librariesmingw64master/mxew64/usr/x86_64w64mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1102
What OpenSCAD version are you using?
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

Administrator

I get the OP's errors with 2014.03. And with just the metric_thread(25,26,9) call, no other geometry.
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

Administrator

OK, the library, where the pitch >= diameter, gets n_turns=0, probably not healthy.
It may take a while to understand what's happening.
Perhaps, diameter=25, pitch=24 will do???
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

Administrator

Scratch that.
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

Administrator

That's above my pay grade.
I've dropped Dan the author a note in case he can see something...
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!


This post has NOT been accepted by the mailing list yet.
No, I don't have any idea of what's the immediate cause of the problem.
But looking at the highestpitch number that seems to work in this case, (pitch=16), one gets a thread that doesn't look much like any reallife thread that I've ever seen:
If I comment out the parts of the code that (1) draw the bottom of the thread "trough" and (2) "cut" the thread to length you see this from a "Top" view:
The polyhedra that form the thread "ridges" are quite close to intersecting at the axis  which I can easily imagine is trouble for the rendering.
My takeaway is: settle for a morerealistic thread! (Patient: "Doctor, it hurts when I do that." Doctor: "So don't do that.")
I guess I should put a restriction in the code to prevent this issue in the future.
Dan

Administrator

Ping, because the above post didn't make it to the mailing list.
Admin  email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!

