include <../config/thread.scad> module thread_object(screw = false) { module base_object() { translate([0, 0, -thread_height / 2]) { cylinder(r = thread_diameter / 2, h = thread_height); cylinder(r = thread_top_diameter / 2, h = thread_top_height); } } module screw() { cylinder(r = thread_screw / 2, h = thread_height, center = true); } module final_object() { if (!screw) { base_object(); } else { difference() { base_object(); screw(); } } } render() { final_object(); } } module thread_screw_object(height = 5) { cylinder(r = thread_screw / 2, h = height, center = true); }