Use dihedral angle to calculate sanding block

This commit is contained in:
Leni Aniva 2025-05-20 19:47:16 -07:00
parent bd15f28403
commit b1fe538747
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
1 changed files with 5 additions and 2 deletions

View File

@ -149,13 +149,16 @@ class Onbashira(Model):
dx = self.bearing_gap
return math.sqrt(diag ** 2 - dx ** 2)
@target(name="sanding_block")
@target(name="sanding-block")
def sanding_block(self) -> Cq.Workplane:
# Dihedral angle / 2
angle = math.radians(180 / self.n_side)
r = math.sin(angle)
x = 50.0
return (
Cq.Workplane()
.sketch()
.polygon([(0,0), (0, x), (x, x/2), (x, 0)])
.polygon([(0,0), (0, x), (x, (1-r) * x), (x, 0)])
.finalize()
.extrude(self.side_width * 1.5)
)