diff --git a/threadlib.scad b/threadlib.scad index 8f9e2ea..132efb5 100644 --- a/threadlib.scad +++ b/threadlib.scad @@ -17,9 +17,12 @@ include function thread_specs(designator, table=THREAD_TABLE) = /* Returns thread specs of thread-type 'designator' as a vector of [pitch, Rrotation, Dsupport, section_profile] */ - - table[search([designator], table, num_returns_per_match=1, - index_col_num=0)[0]][1]; + + // first lookup designator in table inside a let() statement: + let (specs = table[search([designator], table, num_returns_per_match=1, + index_col_num=0)[0]][1]) + // verify that we found something and return it: + assert(!is_undef(specs), str("Designator: '", designator, "' not found")) specs; module thread(designator, turns, higbee_arc=20, fn=120, table=THREAD_TABLE) {