diff --git a/nhf/touhou/__init__.py b/nhf/touhou/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nhf/touhou/shiki_eiki/__init__.py b/nhf/touhou/shiki_eiki/__init__.py new file mode 100644 index 0000000..034bd7d --- /dev/null +++ b/nhf/touhou/shiki_eiki/__init__.py @@ -0,0 +1,26 @@ +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 +import nhf.utils + +@dataclass +class Parameters(Model): + + rod: MR.Rod = field(default_factory=lambda: MR.Rod()) + + def __post_init__(self): + super().__init__(name="shiki-eiki") + + @submodel(name="rod") + def submodel_rod(self) -> Model: + return self.rod + + +if __name__ == '__main__': + import sys + + p = Parameters() + if len(sys.argv) == 1: + p.build_all() + sys.exit(0) diff --git a/nhf/touhou/shiki_eiki/rod.py b/nhf/touhou/shiki_eiki/rod.py new file mode 100644 index 0000000..b53141d --- /dev/null +++ b/nhf/touhou/shiki_eiki/rod.py @@ -0,0 +1,29 @@ +from dataclasses import dataclass, field +import cadquery as Cq +from nhf import Material, Role +from nhf.build import Model, target, assembly +import nhf.utils + +@dataclass +class Rod(Model): + + @target(name="surface") + def top_profile(self) -> Cq.Sketch: + w, h = 10, 20 + sketch = ( + Cq.Sketch() + .polygon([ + (w, h), + (w, -h), + (-w, -h), + (-w, h), + ]) + ) + return sketch + + @assembly() + def assembly(self) -> Cq.Assembly: + a = ( + Cq.Assembly() + ) + return a