cosplay: Touhou/Houjuu Nue #1

Closed
aniva wants to merge 37 commits from touhou/houjuu-nue into main
2 changed files with 72 additions and 1 deletions
Showing only changes of commit 376580003e - Show all commits

View File

@ -13,6 +13,7 @@ def hirth_joint(radius=60,
""" """
# ensures secant doesn't blow up # ensures secant doesn't blow up
assert n_tooth >= 5 assert n_tooth >= 5
assert radius > radius_inner
# angle of half of a single tooth # angle of half of a single tooth
theta = math.pi / n_tooth theta = math.pi / n_tooth
@ -64,7 +65,7 @@ def hirth_joint(radius=60,
radius=radius, radius=radius,
centered=(True, True, False)) centered=(True, True, False))
.faces(">Z").tag("bore") .faces(">Z").tag("bore")
.union(teeth.val().move(Cq.Location((0,0,base_height)))) .union(teeth.val().move(Cq.Location((0,0,base_height))), tol=tol)
.clean() .clean()
) )
#base.workplane(offset=tooth_height/2).circle(radius=radius,forConstruction=True).tag("mate") #base.workplane(offset=tooth_height/2).circle(radius=radius,forConstruction=True).tag("mate")

View File

@ -1,6 +1,7 @@
from dataclasses import dataclass from dataclasses import dataclass
import unittest import unittest
import cadquery as Cq import cadquery as Cq
import nhf.joints
@dataclass(frozen=True) @dataclass(frozen=True)
class Parameters: class Parameters:
@ -25,6 +26,75 @@ class Parameters:
wing_r2_height = 100 wing_r2_height = 100
wing_r3_height = 100 wing_r3_height = 100
"""
The Houjuu-Scarlett joint mechanism at the base of the wing
"""
hs_joint_base_width = 85
hs_joint_base_thickness = 10
hs_joint_ring_thickness = 10
hs_joint_tooth_height = 10
hs_joint_radius = 30
hs_joint_radius_inner = 20
hs_joint_corner_fillet = 5
hs_joint_corner_cbore_diam = 12
hs_joint_corner_cbore_depth = 12
hs_joint_corner_diam = 15
hs_joint_corner_inset = 15
def print_geometries(self):
return [
self.hs_joint_parent()
]
def hs_joint_parent(self):
"""
Parent part of the Houjuu-Scarlett joint, which is composed of a Hirth
coupling, a cylindrical base, and a mounting base.
"""
hirth = nhf.joints.hirth_joint(
radius=self.hs_joint_radius,
radius_inner=self.hs_joint_radius_inner,
tooth_height=self.hs_joint_tooth_height,
base_height=self.hs_joint_ring_thickness)
hole_rect_width = self.hs_joint_base_width - 2 * self.hs_joint_corner_inset
hirth = (
hirth
.faces("<Z")
.workplane()
.transformed(
offset=Cq.Vector(0, 0, -self.hs_joint_ring_thickness / 2),
rotate=Cq.Vector(90, 0, 0))
# This hole will drill only to the centre and not through. This is
# intended.
.hole(5)
.val()
)
result = (
Cq.Workplane('XY')
.box(
self.hs_joint_base_width,
self.hs_joint_base_width,
self.hs_joint_base_thickness,
centered=(True, True, False))
.edges("|Z")
.fillet(self.hs_joint_corner_fillet)
.faces(">Z")
.workplane()
.rect(hole_rect_width, hole_rect_width, forConstruction=True)
.vertices()
.cboreHole(
diameter=self.hs_joint_corner_diam,
cboreDiameter=self.hs_joint_corner_cbore_diam,
cboreDepth=self.hs_joint_corner_cbore_depth)
.faces(">Z")
.workplane()
.union(hirth.move((0, 0, self.hs_joint_base_thickness)), tol=0.1)
.clean()
)
return result
def wing_r1_profile(self) -> Cq.Sketch: def wing_r1_profile(self) -> Cq.Sketch:
""" """
Generates the first wing segment profile, with the wing root pointing in Generates the first wing segment profile, with the wing root pointing in