feat: Rod outline

This commit is contained in:
Leni Aniva 2024-11-14 13:59:01 -08:00
parent fbacd980c0
commit bfa96e7cef
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 10 additions and 5 deletions

View File

@ -7,16 +7,21 @@ import nhf.utils
@dataclass @dataclass
class Rod(Model): class Rod(Model):
width: float = 120.0
length: float = 550.0
length_tip: float = 100.0
width_tail: float = 60.0
@target(name="surface") @target(name="surface")
def top_profile(self) -> Cq.Sketch: def top_profile(self) -> Cq.Sketch:
w, h = 10, 20
sketch = ( sketch = (
Cq.Sketch() Cq.Sketch()
.polygon([ .polygon([
(w, h), (self.length, 0),
(w, -h), (self.length - self.length_tip, self.width/2),
(-w, -h), (0, self.width_tail / 2),
(-w, h), (0, -self.width_tail / 2),
(self.length - self.length_tip, -self.width/2),
]) ])
) )
return sketch return sketch