cosplay: Touhou/Shiki Eiki #7
|
@ -275,7 +275,7 @@ class Model:
|
||||||
"""
|
"""
|
||||||
Build all targets in this model and write the results to file
|
Build all targets in this model and write the results to file
|
||||||
"""
|
"""
|
||||||
output_dir = Path(output_dir)
|
output_dir = Path(output_dir) / self.name
|
||||||
targets = Target.methods(self)
|
targets = Target.methods(self)
|
||||||
for t in targets.values():
|
for t in targets.values():
|
||||||
file_name = t.file_name
|
file_name = t.file_name
|
||||||
|
|
|
@ -2,7 +2,7 @@ import math
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
import cadquery as Cq
|
import cadquery as Cq
|
||||||
from nhf import Material, Role
|
from nhf import Material, Role
|
||||||
from nhf.build import Model, target, assembly
|
from nhf.build import Model, target, assembly, TargetKind
|
||||||
import nhf.utils
|
import nhf.utils
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -33,7 +33,7 @@ class Crown(Model):
|
||||||
def facet_width_upper(self):
|
def facet_width_upper(self):
|
||||||
return self.tilt_circ / self.facets
|
return self.tilt_circ / self.facets
|
||||||
|
|
||||||
@target(name="side")
|
@target(name="side", kind=TargetKind.DXF)
|
||||||
def profile_side(self) -> Cq.Sketch:
|
def profile_side(self) -> Cq.Sketch:
|
||||||
# Generate the pentagonal shape
|
# Generate the pentagonal shape
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class Crown(Model):
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
@target(name="front")
|
@target(name="front", kind=TargetKind.DXF)
|
||||||
def profile_front(self) -> Cq.Sketch:
|
def profile_front(self) -> Cq.Sketch:
|
||||||
dx_l = self.facet_width_lower
|
dx_l = self.facet_width_lower
|
||||||
dx_u = self.facet_width_upper
|
dx_u = self.facet_width_upper
|
||||||
|
@ -221,7 +221,7 @@ class Crown(Model):
|
||||||
.clean()
|
.clean()
|
||||||
)
|
)
|
||||||
|
|
||||||
@target(name="side-guard")
|
@target(name="side-guard", kind=TargetKind.DXF)
|
||||||
def profile_side_guard(self) -> Cq.Sketch:
|
def profile_side_guard(self) -> Cq.Sketch:
|
||||||
dx = self.facet_width_lower / 2
|
dx = self.facet_width_lower / 2
|
||||||
dy = self.height
|
dy = self.height
|
||||||
|
|
|
@ -2,7 +2,7 @@ import math
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
import cadquery as Cq
|
import cadquery as Cq
|
||||||
from nhf import Material, Role
|
from nhf import Material, Role
|
||||||
from nhf.build import Model, target, assembly
|
from nhf.build import Model, target, assembly, TargetKind
|
||||||
import nhf.utils
|
import nhf.utils
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -280,10 +280,7 @@ class Rod(Model):
|
||||||
.moved(loc)
|
.moved(loc)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@target(name="surface", kind=TargetKind.DXF)
|
||||||
|
|
||||||
|
|
||||||
@target(name="surface")
|
|
||||||
def profile_top(self) -> Cq.Sketch:
|
def profile_top(self) -> Cq.Sketch:
|
||||||
sketch = (
|
sketch = (
|
||||||
Cq.Sketch()
|
Cq.Sketch()
|
||||||
|
|
Loading…
Reference in New Issue