Cosplay/nhf/touhou/shiki_eiki/__init__.py

41 lines
1.2 KiB
Python
Raw Normal View History

2024-11-13 22:36:10 -08:00
from dataclasses import dataclass, field
import cadquery as Cq
from nhf.build import Model, TargetKind, target, assembly, submodel
import nhf.touhou.shiki_eiki.rod as MR
2024-11-18 00:36:39 -08:00
import nhf.touhou.shiki_eiki.crown as MC
import nhf.touhou.shiki_eiki.epaulette as ME
2024-11-13 22:36:10 -08:00
import nhf.utils
@dataclass
class Parameters(Model):
rod: MR.Rod = field(default_factory=lambda: MR.Rod())
2024-11-18 00:36:39 -08:00
crown: MC.Crown = field(default_factory=lambda: MC.Crown())
2024-11-18 14:16:35 -08:00
epaulette_ze: ME.Epaulette = field(default_factory=lambda: ME.Epaulette(side="ze"))
epaulette_hi: ME.Epaulette = field(default_factory=lambda: ME.Epaulette(side="hi"))
2024-11-13 22:36:10 -08:00
def __post_init__(self):
super().__init__(name="shiki-eiki")
@submodel(name="rod")
def submodel_rod(self) -> Model:
return self.rod
2024-11-18 00:36:39 -08:00
@submodel(name="crown")
def submodel_crown(self) -> Model:
return self.crown
2024-11-18 14:16:35 -08:00
@submodel(name="epaulette_ze")
def submodel_epaulette_ze(self) -> Model:
return self.epaulette_ze
@submodel(name="epaulette_hi")
def submodel_epaulette_hi(self) -> Model:
return self.epaulette_hi
2024-11-13 22:36:10 -08:00
if __name__ == '__main__':
import sys
p = Parameters()
if len(sys.argv) == 1:
p.build_all()
sys.exit(0)