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

Safeguards for undef to avoid long computations

Open ebigeon opened this issue 1 year ago • 1 comments

If one of the parameters of the modules is undef, it can take for ever to return because of undefined value propagations.

For example :

ScrewThread(12, undef, pitch=0, tooth_angle=30, tolerance=0.4, tip_height=0, tooth_height=0, tip_min_fract=0);

Adding asserts or is_num tests at the relevant points should suffice to avoid it at very low cost.

ebigeon avatar Apr 23 '23 09:04 ebigeon

I just ran into this as well. Happy to open a PR for at least a couple obvious ones.

benzvan avatar Feb 23 '24 14:02 benzvan