adrianschlatter / threadlib

thread library for OpenSCAD
BSD 3-Clause "New" or "Revised" License
351 stars 34 forks source link

Error creating a thread?/ #71

Closed mconsidine closed 2 years ago

mconsidine commented 2 years ago

I have figured out how to get the data for a thread profile and am trying to get it to work with a known-good example. But the following code fails, for reasons I cannot understand. Can you suggest what I am doing wrong? `use <threadlib/threadlib.scad>

echo ("threadlib version: ", __THREADLIB_VERSION());

MYTHREADTABLE=[["test1-ext",[0.0750, 0.0700,0.1500,[[0,-0.0343],[0, 0.0343],[0.0513, 0.0047],[0.0513,-0.0047]]]], ["test1-int",[0.0750,-0.1358,0.2655,[[0, 0.0371],[0,-0.0371],[0.0408,-0.0136],[0.0408, 0.0136]]]], ]; type = "test1"; turns = 5; Douter = thread_specs(str(type, "-int"), table=MYTHREADTABLE)[2] * 1.2;

echo(thread_specs(str(type, "-ext")));`

The error message in the console is: Parsing design (AST generation)... [...] ECHO: "threadlib version: ", 0.3 [ERROR: Assertion '!is_undef(specs)' failed: "Designator: 'test1-ext' not found" in file threadlib.scad, line 25] [TRACE: called by 'thread_specs' in file , line 12] [TRACE: called by 'echo' in file , line 12] Compiling design (CSG Products generation)...

Thanks in advance for any help. mconsidine

mconsidine commented 2 years ago

This problem is fixed. I neglected to add the new table as a parameter to the last "echo" statement. My bad... mconsidine