# @author Arnaud Morin # SPDX-License-Identifier: Apache-2.0 # import cadquery as cq from frame_params import (ALU_DENSITY, PLATE_GAP) OD = 3.5 # round M2 standoff def standoff(): p = (cq.Workplane("XY") .circle(OD / 2.0) .extrude(PLATE_GAP) ) cut = (cq.Workplane("XY") .circle(1) .extrude(PLATE_GAP) ) p = p.cut(cut) return p result = standoff() assert result.solids().size() == 1, "standoff is not one solid" if "show_object" not in globals(): # running outside CQ-editor def show_object(*args, **kwargs): pass show_object(result) if __name__ == "__main__": v = result.val().Volume() print("%-12s %.2f g" % ("standoff", v * ALU_DENSITY))