Files
pirouette/standoff.py
Arnaud Morin 0b96c6bcfe Introducing the pirouette FPV frame for GFPV
Signed-off-by: Arnaud Morin <arnaud.gfpv@mailops.fr>
2026-09-03 23:39:06 +02:00

38 lines
793 B
Python

# @author Arnaud Morin <arnaud.gfpv@mailops.fr>
# SPDX-License-Identifier: Apache-2.0
#
import cadquery as cq
from frame_params import PLATE_GAP
OD = 3.5 # round M2 standoff
ALU_DENSITY = 2.70e-3 # g/mm3, for mass reporting
def standoff():
p = (cq.Workplane("XY")
.circle(OD / 2.0)
.extrude(PLATE_GAP))
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__":
solid = result.val()
print("standoff %.3f g each, %.3f g for four"
% (solid.Volume() * ALU_DENSITY,
4 * solid.Volume() * ALU_DENSITY))