Compare commits
3 Commits
9e10071e1a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e29f86fa70 | ||
|
|
e70d2abed2 | ||
|
|
d241613ed9 |
6
arm.py
6
arm.py
@@ -147,7 +147,5 @@ if "show_object" not in globals(): # running outside CQ-editor
|
|||||||
show_object(result)
|
show_object(result)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
vol = result.val().Volume()
|
v = result.val().Volume()
|
||||||
m = vol * CF_DENSITY
|
print("%-12s %.2f g" % ("arm", v * CF_DENSITY))
|
||||||
print(f"arm mass {m:.2f} g each, {4*m:.2f} g for four")
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import cadquery as cq
|
import cadquery as cq
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
|
from frame_params import TPU_DENSITY
|
||||||
|
|
||||||
def camera_mount():
|
def camera_mount():
|
||||||
|
|
||||||
@@ -130,9 +131,5 @@ if "show_object" not in globals(): # running outside CQ-editor
|
|||||||
show_object(result)
|
show_object(result)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
TPU_DENSITY = 1.21e-3 # g/mm3
|
v = result.val().Volume()
|
||||||
|
print("%-12s %.2f g" % ("camera mount", v * TPU_DENSITY))
|
||||||
solid = result.val()
|
|
||||||
|
|
||||||
print("camera_mount %.2f g in TPU"
|
|
||||||
% (solid.Volume() * TPU_DENSITY))
|
|
||||||
|
|||||||
14
fc.py
14
fc.py
@@ -3,13 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import cadquery as cq
|
import cadquery as cq
|
||||||
|
from frame_params import PCB_DENSITY
|
||||||
# A flight controller is not a material, it is a stack: two boards, their
|
|
||||||
# spacers, and everything soldered to them. This models only the envelope, as
|
|
||||||
# one solid, so the density is FR4's -- bare PCB -- and the dense parts (FETs,
|
|
||||||
# inductors, connectors) stand in for the air between the boards. It lands the
|
|
||||||
# block at about 12 g, which is what a real 25.5 mm FC plus 4-in-1 ESC weighs.
|
|
||||||
PCB_DENSITY = 1.85e-3 # g/mm3, FR4
|
|
||||||
|
|
||||||
|
|
||||||
def fc():
|
def fc():
|
||||||
@@ -76,8 +70,6 @@ if "show_object" not in globals(): # running outside CQ-editor
|
|||||||
|
|
||||||
show_object(result)
|
show_object(result)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
v = result.val().Volume()
|
||||||
print("fc %.2f g" % (result.val().Volume() * PCB_DENSITY))
|
print("%-12s %.2f g" % ("fc", v * PCB_DENSITY))
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ from math import cos, radians, sin, sqrt
|
|||||||
# --- material ---------------------------------------------------------------
|
# --- material ---------------------------------------------------------------
|
||||||
|
|
||||||
THICKNESS = 2.0
|
THICKNESS = 2.0
|
||||||
CF_DENSITY = 1.55e-3 # g/mm3, for mass reporting
|
CF_DENSITY = 1.55e-3 # g/mm3
|
||||||
|
TPU_DENSITY = 1.21e-3 # g/mm3
|
||||||
|
PCB_DENSITY = 1.85e-3 # g/mm3
|
||||||
|
ALU_DENSITY = 2.70e-3 # g/mm3, for mass reporting
|
||||||
|
|
||||||
# --- joint fit --------------------------------------------------------------
|
# --- joint fit --------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import cadquery as cq
|
import cadquery as cq
|
||||||
|
from frame_params import TPU_DENSITY
|
||||||
|
|
||||||
|
|
||||||
def lollipop():
|
def lollipop():
|
||||||
@@ -126,6 +127,5 @@ show_object(result)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
TPU_DENSITY = 1.21e-3 # g/mm3
|
v = result.val().Volume()
|
||||||
|
print("%-12s %.2f g" % ("lollipop", v * TPU_DENSITY))
|
||||||
print("lollipop %.2f g in TPU" % (result.val().Volume() * TPU_DENSITY))
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ SPAR_MORTISE_ANGLE = 45.0 # +-45 deg to the arm axis
|
|||||||
MORTISE_L = TENON_L + FIT # 4.2
|
MORTISE_L = TENON_L + FIT # 4.2
|
||||||
MORTISE_W = THICKNESS
|
MORTISE_W = THICKNESS
|
||||||
|
|
||||||
BORE_D = 4.0 # 1404 bell / boss clearance
|
BORE_D = 5.0 # 1404 bell / boss clearance
|
||||||
BOLT_SQ = 9.0 # 1404/1105 M2 pattern -- the DIAGONAL between
|
BOLT_SQ = 9.0 # 1404/1105 M2 pattern -- the DIAGONAL between
|
||||||
# opposite bolt holes, not the square's side
|
# opposite bolt holes, not the square's side
|
||||||
BOLT_D = 2.2 # M2 clearance
|
BOLT_D = 2.2 # M2 clearance
|
||||||
@@ -114,11 +114,6 @@ if "show_object" not in globals(): # running outside CQ-editor
|
|||||||
|
|
||||||
show_object(result)
|
show_object(result)
|
||||||
|
|
||||||
# Mass report
|
|
||||||
def report():
|
|
||||||
vol = result.val().Volume()
|
|
||||||
print(f" Mass = {vol * CF_DENSITY:5.2f} g")
|
|
||||||
print(f" Mass x4 = {4 * vol * CF_DENSITY:5.2f} g")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
report()
|
v = result.val().Volume()
|
||||||
|
print("%-12s %.2f g" % ("motor base", v * CF_DENSITY))
|
||||||
|
|||||||
25
plate.py
25
plate.py
@@ -106,33 +106,37 @@ def plate():
|
|||||||
p = p.cut(bones.rotate((0, 0, 0), (0, 0, 1), a).translate((x, y, 0)))
|
p = p.cut(bones.rotate((0, 0, 0), (0, 0, 1), a).translate((x, y, 0)))
|
||||||
|
|
||||||
# Triangle cuts to reduce weight
|
# Triangle cuts to reduce weight
|
||||||
|
# the small one near center
|
||||||
cut1 = (
|
cut1 = (
|
||||||
cq.Workplane("XY")
|
cq.Workplane("XY")
|
||||||
.polyline([
|
.polyline([
|
||||||
(6.5, -9),
|
(7, -7),
|
||||||
(6.5, 9),
|
(7, 7),
|
||||||
(1, 0),
|
(1.5, 0),
|
||||||
]).close()
|
]).close()
|
||||||
.extrude(THICKNESS)
|
.extrude(THICKNESS)
|
||||||
.edges("|Z")
|
.edges("|Z")
|
||||||
.fillet(1.0)
|
.fillet(1.0)
|
||||||
)
|
)
|
||||||
|
# strap holes
|
||||||
cut2 = (
|
cut2 = (
|
||||||
cq.Workplane("XY")
|
cq.Workplane("XY")
|
||||||
.polyline([
|
.polyline([
|
||||||
(9.5, -9),
|
(11, -8),
|
||||||
(9.5, 9),
|
(11, 8),
|
||||||
(15, 0),
|
(13, 8),
|
||||||
|
(13, -8),
|
||||||
]).close()
|
]).close()
|
||||||
.extrude(THICKNESS)
|
.extrude(THICKNESS)
|
||||||
.edges("|Z")
|
.edges("|Z")
|
||||||
.fillet(1.0)
|
.fillet(0.99)
|
||||||
)
|
)
|
||||||
|
# the big one
|
||||||
cut3 = (
|
cut3 = (
|
||||||
cq.Workplane("XY")
|
cq.Workplane("XY")
|
||||||
.polyline([
|
.polyline([
|
||||||
(11, 15),
|
(10, 15),
|
||||||
(-11, 15),
|
(-10, 15),
|
||||||
(0, 4),
|
(0, 4),
|
||||||
]).close()
|
]).close()
|
||||||
.extrude(THICKNESS)
|
.extrude(THICKNESS)
|
||||||
@@ -168,6 +172,5 @@ show_object(result)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
v = result.val().Volume()
|
v = result.val().Volume()
|
||||||
print("plate mass %.2f g each, %.2f g for two" % (v * CF_DENSITY, 2 * v * CF_DENSITY))
|
print("%-12s %.2f g" % ("plate", v * CF_DENSITY))
|
||||||
|
|||||||
9
spar.py
9
spar.py
@@ -111,12 +111,6 @@ result = spar()
|
|||||||
|
|
||||||
assert result.solids().size() == 1, "spar is not one solid"
|
assert result.solids().size() == 1, "spar is not one solid"
|
||||||
|
|
||||||
# Mass report
|
|
||||||
def report():
|
|
||||||
vol = result.val().Volume()
|
|
||||||
print(f" Mass = {vol * CF_DENSITY:5.2f} g")
|
|
||||||
print(f" Mass x4 = {4 * vol * CF_DENSITY:5.2f} g")
|
|
||||||
|
|
||||||
# Running outside CQ-editor
|
# Running outside CQ-editor
|
||||||
if "show_object" not in globals():
|
if "show_object" not in globals():
|
||||||
def show_object(*args, **kwargs):
|
def show_object(*args, **kwargs):
|
||||||
@@ -125,4 +119,5 @@ if "show_object" not in globals():
|
|||||||
show_object(result)
|
show_object(result)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
report()
|
v = result.val().Volume()
|
||||||
|
print("%-12s %.2f g" % ("spar", v * CF_DENSITY))
|
||||||
|
|||||||
21
standoff.py
21
standoff.py
@@ -4,16 +4,22 @@
|
|||||||
|
|
||||||
import cadquery as cq
|
import cadquery as cq
|
||||||
|
|
||||||
from frame_params import PLATE_GAP
|
from frame_params import (ALU_DENSITY, PLATE_GAP)
|
||||||
|
|
||||||
OD = 3.5 # round M2 standoff
|
OD = 3.5 # round M2 standoff
|
||||||
ALU_DENSITY = 2.70e-3 # g/mm3, for mass reporting
|
|
||||||
|
|
||||||
|
|
||||||
def standoff():
|
def standoff():
|
||||||
p = (cq.Workplane("XY")
|
p = (cq.Workplane("XY")
|
||||||
.circle(OD / 2.0)
|
.circle(OD / 2.0)
|
||||||
.extrude(PLATE_GAP))
|
.extrude(PLATE_GAP)
|
||||||
|
)
|
||||||
|
|
||||||
|
cut = (cq.Workplane("XY")
|
||||||
|
.circle(1)
|
||||||
|
.extrude(PLATE_GAP)
|
||||||
|
)
|
||||||
|
|
||||||
|
p = p.cut(cut)
|
||||||
|
|
||||||
return p
|
return p
|
||||||
|
|
||||||
@@ -30,8 +36,5 @@ show_object(result)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
solid = result.val()
|
v = result.val().Volume()
|
||||||
|
print("%-12s %.2f g" % ("standoff", v * ALU_DENSITY))
|
||||||
print("standoff %.3f g each, %.3f g for four"
|
|
||||||
% (solid.Volume() * ALU_DENSITY,
|
|
||||||
4 * solid.Volume() * ALU_DENSITY))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user