adrianschlatter / threadlib

thread library for OpenSCAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DesignOfThreadlib example

yeKcim opened this issue · comments

I’ve tried threadlib/docs/DesignOfThreadlib.md example:

use <threadlib/threadlib.scad>

MY_THREAD_TABLE = ["M4-int", [0.7, -2.1095, 4.1095,
            [
             [0, 0.3465], 
             [0, -0.3465], 
             [0.43304671, -0.09648036], 
             [0.43304671, 0.09648036]
            ]]];

thread("M4-int", turns=1, table=MY_THREAD_TABLE);

Got a lot of warnings and nothing is created:

…
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined + number) in file skin.scad, line 42 
WARNING: undefined operation (undefined - number) in file skin.scad, line 47 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined + number) in file skin.scad, line 42 
WARNING: undefined operation (undefined - number) in file skin.scad, line 47 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated in file skin.scad, line 18 
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated in file skin.scad, line 29 
Compiling design (CSG Products generation)...
WARNING: Point index 18446744073709551615 is out of bounds (from faces[0][0]) in file list-comprehension-demos/skin.scad, line 32 
ERROR: Unable to convert points[0] = undef to a vec3 of numbers in file list-comprehension-demos/skin.scad, line 32 
WARNING: PolySet has degenerate polygons 
Geometries in cache: 130
Geometry cache size in bytes: 16678832
CGAL Polyhedrons in cache: 15
CGAL cache size in bytes: 94345312
Compiling design (CSG Products normalization)...
Normalized tree has 1 elements!
Compile and preview finished.
Total rendering time: 0:00:31.795

Nothing is created with nut or bolt either

bolt:

Parsing design (AST generation)...
Saved backup file: /home/carre/.local/share/OpenSCAD/backups/unsaved-backup-cEeFxVfs.scad
Compiling design (CSG Tree generation)...
ERROR: Assertion '!is_undef(specs)' failed: "Designator: 'M4-int-ext' not found" in file threadlib.scad, line 25 
TRACE: called by 'thread_specs' in file threadlib.scad, line 42 
TRACE: called by 'union' in file threadlib.scad, line 41 
TRACE: called by 'bolt' in file libraries, line 11 
Compiling design (CSG Products generation)...
Geometries in cache: 131
Geometry cache size in bytes: 16678984
CGAL Polyhedrons in cache: 15
CGAL cache size in bytes: 94345312
Compiling design (CSG Products normalization)...
Normalized tree has 1 elements!
Compile and preview finished.
Total rendering time: 0:00:00.116

I’m trying to understand this documentation to create my own thread (diameter 21.4, pitch 907)

Check your brackets: You forgot the outermost [... ]. MY_THREAD_TABLE must be a list of thread specs, even if you have only 1 thread spec. This should work:

use <threadlib/threadlib.scad>

MY_THREAD_TABLE = [["M4-int", [0.7, -2.1095, 4.1095,
                   [
                    [0, 0.3465],
                    [0, -0.3465],
                    [0.43304671, -0.09648036],
                    [0.43304671, 0.09648036]
                    ]]]];


thread("M4-int", turns=15, table=MY_THREAD_TABLE);```