From 3ac342a65d1e3d2957598bcda7c80a9667a4c125 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Mon, 18 Nov 2024 14:16:35 -0800 Subject: [PATCH] Eiki epaulette --- nhf/materials.py | 7 + nhf/touhou/shiki_eiki/__init__.py | 12 +- nhf/touhou/shiki_eiki/crown.py | 54 +- nhf/touhou/shiki_eiki/epaulette-hi.dxf | 1464 ++++++++++++++ nhf/touhou/shiki_eiki/epaulette-ze.dxf | 2426 ++++++++++++++++++++++++ nhf/touhou/shiki_eiki/epaulette.py | 26 +- nhf/touhou/shiki_eiki/rod.py | 20 +- nhf/touhou/shiki_eiki/zehi.svg | 139 ++ 8 files changed, 4140 insertions(+), 8 deletions(-) create mode 100644 nhf/touhou/shiki_eiki/epaulette-hi.dxf create mode 100644 nhf/touhou/shiki_eiki/epaulette-ze.dxf create mode 100644 nhf/touhou/shiki_eiki/zehi.svg diff --git a/nhf/materials.py b/nhf/materials.py index bc172c3..e931403 100644 --- a/nhf/materials.py +++ b/nhf/materials.py @@ -84,6 +84,7 @@ class Material(Enum): ACRYLIC_TRANSLUSCENT = 1.18, _color('ivory2', 0.8) ACRYLIC_TRANSPARENT = 1.18, _color('ghostwhite', 0.5) STEEL_SPRING = 7.8, _color('gray', 0.8) + METAL_BRASS = 8.5, _color('gold1', 0.8) def __init__(self, density: float, color: Cq.Color): self.density = density @@ -116,6 +117,9 @@ def add_with_material_role( Cq.Assembly.addS = add_with_material_role def color_by_material(self: Cq.Assembly) -> Cq.Assembly: + """ + Set colours in an assembly by material + """ for _, a in self.traverse(): if KEY_MATERIAL not in a.metadata: continue @@ -123,6 +127,9 @@ def color_by_material(self: Cq.Assembly) -> Cq.Assembly: return self Cq.Assembly.color_by_material = color_by_material def color_by_role(self: Cq.Assembly, avg: bool = True) -> Cq.Assembly: + """ + Set colours in an assembly by role + """ for _, a in self.traverse(): if KEY_ROLE not in a.metadata: continue diff --git a/nhf/touhou/shiki_eiki/__init__.py b/nhf/touhou/shiki_eiki/__init__.py index ee4ccbe..c97eff5 100644 --- a/nhf/touhou/shiki_eiki/__init__.py +++ b/nhf/touhou/shiki_eiki/__init__.py @@ -11,7 +11,8 @@ class Parameters(Model): rod: MR.Rod = field(default_factory=lambda: MR.Rod()) crown: MC.Crown = field(default_factory=lambda: MC.Crown()) - epaulette: ME.Epaulette = field(default_factory=lambda: ME.Epaulette()) + epaulette_ze: ME.Epaulette = field(default_factory=lambda: ME.Epaulette(side="ze")) + epaulette_hi: ME.Epaulette = field(default_factory=lambda: ME.Epaulette(side="hi")) def __post_init__(self): super().__init__(name="shiki-eiki") @@ -22,9 +23,12 @@ class Parameters(Model): @submodel(name="crown") def submodel_crown(self) -> Model: return self.crown - @submodel(name="epaulette") - def submodel_epaulette(self) -> Model: - return self.epaulette + @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 if __name__ == '__main__': diff --git a/nhf/touhou/shiki_eiki/crown.py b/nhf/touhou/shiki_eiki/crown.py index dff7452..f2b4b07 100644 --- a/nhf/touhou/shiki_eiki/crown.py +++ b/nhf/touhou/shiki_eiki/crown.py @@ -17,6 +17,10 @@ class Crown(Model): margin: float = 10.0 + thickness: float = 0.4 # 26 Gauge + + material: Material = Material.METAL_BRASS + def __post_init__(self): super().__init__(name="crown") @@ -30,7 +34,7 @@ class Crown(Model): return self.tilt_circ / self.facets @target(name="side") - def profile_base(self) -> Cq.Sketch: + def profile_side(self) -> Cq.Sketch: # Generate the pentagonal shape dx_l = self.facet_width_lower @@ -204,7 +208,7 @@ class Crown(Model): ) return ( - self.profile_base() + self.profile_side() .boolean(window.moved(window_p1), mode='s') .boolean(window.moved(window_p1.flip_x()), mode='s') .boolean(window.moved(window_p2), mode='s') @@ -292,3 +296,49 @@ class Crown(Model): .bezier([p.flip_x().to2d_pos() for p in bezier_group]) ) return sketch.assemble() + + def assembly(self) -> Cq.Assembly: + front = ( + Cq.Workplane('XY') + .placeSketch(self.profile_front()) + .extrude(self.thickness) + ) + side = ( + Cq.Workplane('XY') + .placeSketch(self.profile_side()) + .extrude(self.thickness) + ) + side_guard = ( + Cq.Workplane('XY') + .placeSketch(self.profile_side_guard()) + .extrude(self.thickness) + ) + assembly = ( + Cq.Assembly() + .addS( + front, + name="front", + material=self.material, + role=Role.DECORATION, + ) + ) + for i, pos in enumerate([-2, -1, 1, 2]): + x = self.facet_width_upper * pos + assembly = ( + assembly + .addS( + side, + name=f"side{i}", + material=self.material, + role=Role.DECORATION, + loc=Cq.Location.from2d(x, 0), + ) + .addS( + side_guard, + name=f"guard{i}", + material=self.material, + role=Role.DECORATION, + loc=Cq.Location(x, 0, self.thickness), + ) + ) + return assembly diff --git a/nhf/touhou/shiki_eiki/epaulette-hi.dxf b/nhf/touhou/shiki_eiki/epaulette-hi.dxf new file mode 100644 index 0000000..e7a188b --- /dev/null +++ b/nhf/touhou/shiki_eiki/epaulette-hi.dxf @@ -0,0 +1,1464 @@ + 0 +SECTION + 2 +HEADER + 9 +$ACADVER + 1 +AC1014 + 9 +$HANDSEED + 5 +FFFF + 9 +$INSUNITS + 70 + 4 + 9 +$MEASUREMENT + 70 + 1 + 0 +ENDSEC + 0 +SECTION + 2 +TABLES + 0 +TABLE + 2 +VPORT + 5 +8 +330 +0 +100 +AcDbSymbolTable + 70 + 4 + 0 +VPORT + 5 +2E +330 +8 +100 +AcDbSymbolTableRecord +100 +AcDbViewportTableRecord + 2 +*ACTIVE + 70 + 0 + 10 +0.0 + 20 +0.0 + 11 +1.0 + 21 +1.0 + 12 +210.0 + 22 +148.5 + 13 +0.0 + 23 +0.0 + 14 +10.0 + 24 +10.0 + 15 +10.0 + 25 +10.0 + 16 +0.0 + 26 +0.0 + 36 +1.0 + 17 +0.0 + 27 +0.0 + 37 +0.0 + 40 +341.0 + 41 +1.24 + 42 +50.0 + 43 +0.0 + 44 +0.0 + 50 +0.0 + 51 +0.0 + 71 + 0 + 72 + 100 + 73 + 1 + 74 + 3 + 75 + 0 + 76 + 0 + 77 + 0 + 78 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +LTYPE + 5 +5 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +LTYPE + 5 +14 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYBLOCK + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +15 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYLAYER + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +16 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CONTINUOUS + 70 + 0 + 3 +Solid line + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +ENDTAB + 0 +TABLE + 2 +LAYER + 5 +2 +100 +AcDbSymbolTable + 70 +5 + 0 +LAYER + 5 +50 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +51 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Outline + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +52 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Cut + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +53 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Ze + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +54 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Hi + 70 +0 + 6 +CONTINUOUS + 0 +ENDTAB + 0 +TABLE + 2 +STYLE + 5 +3 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +STYLE + 5 +11 +330 +3 +100 +AcDbSymbolTableRecord +100 +AcDbTextStyleTableRecord + 2 +STANDARD + 70 + 0 + 40 +0.0 + 41 +1.0 + 50 +0.0 + 71 + 0 + 42 +2.5 + 3 +txt + 4 + + 0 +ENDTAB + 0 +TABLE + 2 +VIEW + 5 +6 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +UCS + 5 +7 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +APPID + 5 +9 +330 +0 +100 +AcDbSymbolTable + 70 + 2 + 0 +APPID + 5 +12 +330 +9 +100 +AcDbSymbolTableRecord +100 +AcDbRegAppTableRecord + 2 +ACAD + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +DIMSTYLE + 5 +A +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +DIMSTYLE +105 +27 +330 +A +100 +AcDbSymbolTableRecord +100 +AcDbDimStyleTableRecord + 2 +ISO-25 + 70 + 0 + 3 + + 4 + + 5 + + 6 + + 7 + + 40 +1.0 + 41 +2.5 + 42 +0.625 + 43 +3.75 + 44 +1.25 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 +140 +2.5 +141 +2.5 +142 +0.0 +143 +0.03937007874016 +144 +1.0 +145 +0.0 +146 +1.0 +147 +0.625 + 71 + 0 + 72 + 0 + 73 + 0 + 74 + 0 + 75 + 0 + 76 + 0 + 77 + 1 + 78 + 8 +170 + 0 +171 + 3 +172 + 1 +173 + 0 +174 + 0 +175 + 0 +176 + 0 +177 + 0 +178 + 0 +270 + 2 +271 + 2 +272 + 2 +273 + 2 +274 + 3 +340 +11 +275 + 0 +280 + 0 +281 + 0 +282 + 0 +283 + 0 +284 + 8 +285 + 0 +286 + 0 +287 + 3 +288 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +BLOCK_RECORD + 5 +1 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +BLOCK_RECORD + 5 +1F +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*MODEL_SPACE + 0 +BLOCK_RECORD + 5 +1B +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*PAPER_SPACE + 0 +ENDTAB + 0 +ENDSEC + 0 +SECTION + 2 +BLOCKS + 0 +BLOCK + 5 +20 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*MODEL_SPACE + 70 + 0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*MODEL_SPACE + 1 + + 0 +ENDBLK + 5 +21 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +1C +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockBegin + 2 +*PAPER_SPACE + 1 + + 0 +ENDBLK + 5 +1D +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockEnd + 0 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +SPLINE + 5 +100 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 10 +22.458851 + 20 +99.867699 + 30 +0.0 + 10 +0.132301 + 20 +77.541149 + 30 +0.0 + 10 +0.132292 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +101 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +0.132292 + 20 +49.999951 + 30 +0.0 + 10 +0.132302 + 20 +22.458753 + 30 +0.0 + 10 +22.458851 + 20 +0.132204 + 30 +0.0 + 10 +50.000049 + 20 +0.132194 + 30 +0.0 + 0 +SPLINE + 5 +102 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +0.132194 + 30 +0.0 + 10 +77.541247 + 20 +0.132204 + 30 +0.0 + 10 +99.867796 + 20 +22.458753 + 30 +0.0 + 10 +99.867806 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +103 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +99.867806 + 20 +49.999951 + 30 +0.0 + 10 +99.867796 + 20 +77.541149 + 30 +0.0 + 10 +77.541247 + 20 +99.867698 + 30 +0.0 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 0 +SPLINE + 5 +104 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 10 +74.787127 + 20 +94.880924 + 30 +0.0 + 10 +94.881021 + 20 +74.787029 + 30 +0.0 + 10 +94.881030 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +105 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +94.881030 + 20 +49.999951 + 30 +0.0 + 10 +94.881021 + 20 +25.212873 + 30 +0.0 + 10 +74.787127 + 20 +5.118979 + 30 +0.0 + 10 +50.000049 + 20 +5.118970 + 30 +0.0 + 0 +SPLINE + 5 +106 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +5.118970 + 30 +0.0 + 10 +25.212971 + 20 +5.118979 + 30 +0.0 + 10 +5.119076 + 20 +25.212873 + 30 +0.0 + 10 +5.119067 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +107 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +5.119067 + 20 +49.999951 + 30 +0.0 + 10 +5.119076 + 20 +74.787029 + 30 +0.0 + 10 +25.212971 + 20 +94.880924 + 30 +0.0 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 0 +LWPOLYLINE + 5 +108 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 0 +LWPOLYLINE + 5 +109 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 0 +LWPOLYLINE + 5 +10a +100 +AcDbEntity + 8 +Hi + 62 +5 +100 +AcDbPolyline + 90 +16 + 70 +1 + 10 +54.786837 + 20 +80.000187 + 30 +0.0 + 10 +54.786837 + 20 +20.000232 + 30 +0.0 + 10 +59.999955 + 20 +20.000232 + 30 +0.0 + 10 +59.999955 + 20 +28.943872 + 30 +0.0 + 10 +79.708830 + 20 +28.943872 + 30 +0.0 + 10 +79.708830 + 20 +37.224504 + 30 +0.0 + 10 +59.999955 + 20 +37.224504 + 30 +0.0 + 10 +59.999955 + 20 +45.859635 + 30 +0.0 + 10 +79.708830 + 20 +45.859635 + 30 +0.0 + 10 +79.708830 + 20 +54.140267 + 30 +0.0 + 10 +59.999955 + 20 +54.140267 + 30 +0.0 + 10 +59.999955 + 20 +62.775399 + 30 +0.0 + 10 +79.708830 + 20 +62.775399 + 30 +0.0 + 10 +79.708830 + 20 +71.056030 + 30 +0.0 + 10 +59.999955 + 20 +71.056030 + 30 +0.0 + 10 +59.999955 + 20 +80.000187 + 30 +0.0 + 0 +LWPOLYLINE + 5 +10b +100 +AcDbEntity + 8 +Hi + 62 +5 +100 +AcDbPolyline + 90 +16 + 70 +1 + 10 +45.245359 + 20 +20.000023 + 30 +0.0 + 10 +45.245359 + 20 +79.999978 + 30 +0.0 + 10 +40.032241 + 20 +79.999978 + 30 +0.0 + 10 +40.032241 + 20 +71.056338 + 30 +0.0 + 10 +20.323366 + 20 +71.056338 + 30 +0.0 + 10 +20.323366 + 20 +62.775706 + 30 +0.0 + 10 +40.032241 + 20 +62.775706 + 30 +0.0 + 10 +40.032241 + 20 +54.140575 + 30 +0.0 + 10 +20.323366 + 20 +54.140575 + 30 +0.0 + 10 +20.323366 + 20 +45.859943 + 30 +0.0 + 10 +40.032241 + 20 +45.859943 + 30 +0.0 + 10 +40.032241 + 20 +37.224811 + 30 +0.0 + 10 +20.323366 + 20 +37.224811 + 30 +0.0 + 10 +20.323366 + 20 +28.944180 + 30 +0.0 + 10 +40.032241 + 20 +28.944180 + 30 +0.0 + 10 +40.032241 + 20 +20.000023 + 30 +0.0 + 0 +ENDSEC + 0 +SECTION + 2 +OBJECTS + 0 +DICTIONARY + 5 +C +330 +0 +100 +AcDbDictionary + 3 +ACAD_GROUP +350 +D + 3 +ACAD_MLINESTYLE +350 +17 + 0 +DICTIONARY + 5 +D +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +1A +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +17 +330 +C +100 +AcDbDictionary + 3 +STANDARD +350 +18 + 0 +DICTIONARY + 5 +19 +330 +C +100 +AcDbDictionary + 0 +ENDSEC + 0 +EOF diff --git a/nhf/touhou/shiki_eiki/epaulette-ze.dxf b/nhf/touhou/shiki_eiki/epaulette-ze.dxf new file mode 100644 index 0000000..cc43962 --- /dev/null +++ b/nhf/touhou/shiki_eiki/epaulette-ze.dxf @@ -0,0 +1,2426 @@ + 0 +SECTION + 2 +HEADER + 9 +$ACADVER + 1 +AC1014 + 9 +$HANDSEED + 5 +FFFF + 9 +$INSUNITS + 70 + 4 + 9 +$MEASUREMENT + 70 + 1 + 0 +ENDSEC + 0 +SECTION + 2 +TABLES + 0 +TABLE + 2 +VPORT + 5 +8 +330 +0 +100 +AcDbSymbolTable + 70 + 4 + 0 +VPORT + 5 +2E +330 +8 +100 +AcDbSymbolTableRecord +100 +AcDbViewportTableRecord + 2 +*ACTIVE + 70 + 0 + 10 +0.0 + 20 +0.0 + 11 +1.0 + 21 +1.0 + 12 +210.0 + 22 +148.5 + 13 +0.0 + 23 +0.0 + 14 +10.0 + 24 +10.0 + 15 +10.0 + 25 +10.0 + 16 +0.0 + 26 +0.0 + 36 +1.0 + 17 +0.0 + 27 +0.0 + 37 +0.0 + 40 +341.0 + 41 +1.24 + 42 +50.0 + 43 +0.0 + 44 +0.0 + 50 +0.0 + 51 +0.0 + 71 + 0 + 72 + 100 + 73 + 1 + 74 + 3 + 75 + 0 + 76 + 0 + 77 + 0 + 78 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +LTYPE + 5 +5 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +LTYPE + 5 +14 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYBLOCK + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +15 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYLAYER + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +16 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CONTINUOUS + 70 + 0 + 3 +Solid line + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +ENDTAB + 0 +TABLE + 2 +LAYER + 5 +2 +100 +AcDbSymbolTable + 70 +5 + 0 +LAYER + 5 +50 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +51 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Outline + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +52 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Cut + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +53 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Ze + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +54 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Hi + 70 +0 + 6 +CONTINUOUS + 0 +ENDTAB + 0 +TABLE + 2 +STYLE + 5 +3 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +STYLE + 5 +11 +330 +3 +100 +AcDbSymbolTableRecord +100 +AcDbTextStyleTableRecord + 2 +STANDARD + 70 + 0 + 40 +0.0 + 41 +1.0 + 50 +0.0 + 71 + 0 + 42 +2.5 + 3 +txt + 4 + + 0 +ENDTAB + 0 +TABLE + 2 +VIEW + 5 +6 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +UCS + 5 +7 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +APPID + 5 +9 +330 +0 +100 +AcDbSymbolTable + 70 + 2 + 0 +APPID + 5 +12 +330 +9 +100 +AcDbSymbolTableRecord +100 +AcDbRegAppTableRecord + 2 +ACAD + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +DIMSTYLE + 5 +A +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +DIMSTYLE +105 +27 +330 +A +100 +AcDbSymbolTableRecord +100 +AcDbDimStyleTableRecord + 2 +ISO-25 + 70 + 0 + 3 + + 4 + + 5 + + 6 + + 7 + + 40 +1.0 + 41 +2.5 + 42 +0.625 + 43 +3.75 + 44 +1.25 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 +140 +2.5 +141 +2.5 +142 +0.0 +143 +0.03937007874016 +144 +1.0 +145 +0.0 +146 +1.0 +147 +0.625 + 71 + 0 + 72 + 0 + 73 + 0 + 74 + 0 + 75 + 0 + 76 + 0 + 77 + 1 + 78 + 8 +170 + 0 +171 + 3 +172 + 1 +173 + 0 +174 + 0 +175 + 0 +176 + 0 +177 + 0 +178 + 0 +270 + 2 +271 + 2 +272 + 2 +273 + 2 +274 + 3 +340 +11 +275 + 0 +280 + 0 +281 + 0 +282 + 0 +283 + 0 +284 + 8 +285 + 0 +286 + 0 +287 + 3 +288 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +BLOCK_RECORD + 5 +1 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +BLOCK_RECORD + 5 +1F +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*MODEL_SPACE + 0 +BLOCK_RECORD + 5 +1B +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*PAPER_SPACE + 0 +ENDTAB + 0 +ENDSEC + 0 +SECTION + 2 +BLOCKS + 0 +BLOCK + 5 +20 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*MODEL_SPACE + 70 + 0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*MODEL_SPACE + 1 + + 0 +ENDBLK + 5 +21 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +1C +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockBegin + 2 +*PAPER_SPACE + 1 + + 0 +ENDBLK + 5 +1D +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockEnd + 0 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +SPLINE + 5 +100 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 10 +22.458851 + 20 +99.867699 + 30 +0.0 + 10 +0.132301 + 20 +77.541149 + 30 +0.0 + 10 +0.132292 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +101 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +0.132292 + 20 +49.999951 + 30 +0.0 + 10 +0.132302 + 20 +22.458753 + 30 +0.0 + 10 +22.458851 + 20 +0.132204 + 30 +0.0 + 10 +50.000049 + 20 +0.132194 + 30 +0.0 + 0 +SPLINE + 5 +102 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +0.132194 + 30 +0.0 + 10 +77.541247 + 20 +0.132204 + 30 +0.0 + 10 +99.867796 + 20 +22.458753 + 30 +0.0 + 10 +99.867806 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +103 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +99.867806 + 20 +49.999951 + 30 +0.0 + 10 +99.867796 + 20 +77.541149 + 30 +0.0 + 10 +77.541247 + 20 +99.867698 + 30 +0.0 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 0 +SPLINE + 5 +104 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 10 +74.787127 + 20 +94.880924 + 30 +0.0 + 10 +94.881021 + 20 +74.787029 + 30 +0.0 + 10 +94.881030 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +105 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +94.881030 + 20 +49.999951 + 30 +0.0 + 10 +94.881021 + 20 +25.212873 + 30 +0.0 + 10 +74.787127 + 20 +5.118979 + 30 +0.0 + 10 +50.000049 + 20 +5.118970 + 30 +0.0 + 0 +SPLINE + 5 +106 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +5.118970 + 30 +0.0 + 10 +25.212971 + 20 +5.118979 + 30 +0.0 + 10 +5.119076 + 20 +25.212873 + 30 +0.0 + 10 +5.119067 + 20 +49.999951 + 30 +0.0 + 0 +SPLINE + 5 +107 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +5.119067 + 20 +49.999951 + 30 +0.0 + 10 +5.119076 + 20 +74.787029 + 30 +0.0 + 10 +25.212971 + 20 +94.880924 + 30 +0.0 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 0 +LWPOLYLINE + 5 +108 +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +99.867708 + 30 +0.0 + 0 +SPLINE + 5 +109 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +87.354777 + 30 +0.0 + 10 +31.310151 + 20 +87.344028 + 30 +0.0 + 10 +15.504624 + 20 +73.521864 + 30 +0.0 + 10 +13.002824 + 20 +55.000163 + 30 +0.0 + 0 +LWPOLYLINE + 5 +10a +100 +AcDbEntity + 8 +Outline + 62 +7 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +94.880933 + 30 +0.0 + 0 +SPLINE + 5 +10b +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +86.997274 + 20 +55.000163 + 30 +0.0 + 10 +84.495474 + 20 +73.521864 + 30 +0.0 + 10 +68.689947 + 20 +87.344028 + 30 +0.0 + 10 +50.000049 + 20 +87.354777 + 30 +0.0 + 0 +LWPOLYLINE + 5 +10c +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +6 + 70 +0 + 10 +13.002824 + 20 +55.000163 + 30 +0.0 + 10 +15.549438 + 20 +55.000163 + 30 +0.0 + 10 +18.019055 + 20 +55.000163 + 30 +0.0 + 10 +81.984143 + 20 +55.000163 + 30 +0.0 + 10 +83.422298 + 20 +55.000163 + 30 +0.0 + 10 +86.997274 + 20 +55.000163 + 30 +0.0 + 0 +SPLINE + 5 +10d +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +82.374202 + 30 +0.0 + 10 +58.239794 + 20 +82.362203 + 30 +0.0 + 10 +66.164913 + 20 +79.208825 + 30 +0.0 + 10 +72.160453 + 20 +73.556653 + 30 +0.0 + 0 +LWPOLYLINE + 5 +10e +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +87.354777 + 30 +0.0 + 0 +SPLINE + 5 +10f +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +27.842745 + 20 +73.556653 + 30 +0.0 + 10 +33.837505 + 20 +79.208092 + 30 +0.0 + 10 +41.761375 + 20 +82.361414 + 30 +0.0 + 10 +50.000049 + 20 +82.374202 + 30 +0.0 + 0 +LWPOLYLINE + 5 +110 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +2 + 70 +0 + 10 +72.160453 + 20 +73.556653 + 30 +0.0 + 10 +27.842745 + 20 +73.556653 + 30 +0.0 + 0 +LWPOLYLINE + 5 +111 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +50.000049 + 20 +82.374202 + 30 +0.0 + 0 +SPLINE + 5 +112 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +76.278031 + 20 +68.798287 + 30 +0.0 + 10 +78.258337 + 20 +66.042028 + 30 +0.0 + 10 +79.792920 + 20 +62.991520 + 30 +0.0 + 10 +80.825557 + 20 +59.758529 + 30 +0.0 + 0 +LWPOLYLINE + 5 +113 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +2 + 70 +0 + 10 +23.725167 + 20 +68.798287 + 30 +0.0 + 10 +76.278031 + 20 +68.798287 + 30 +0.0 + 0 +SPLINE + 5 +114 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +19.177641 + 20 +59.758529 + 30 +0.0 + 10 +20.210278 + 20 +62.991520 + 30 +0.0 + 10 +21.744861 + 20 +66.042028 + 30 +0.0 + 10 +23.725167 + 20 +68.798287 + 30 +0.0 + 0 +LWPOLYLINE + 5 +115 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +2 + 70 +0 + 10 +80.825557 + 20 +59.758529 + 30 +0.0 + 10 +19.177641 + 20 +59.758529 + 30 +0.0 + 0 +LWPOLYLINE + 5 +116 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +1 + 70 +1 + 10 +23.725167 + 20 +68.798287 + 30 +0.0 + 0 +SPLINE + 5 +117 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +21.704102 + 20 +26.193136 + 30 +0.0 + 10 +28.753604 + 20 +17.878949 + 30 +0.0 + 10 +39.099541 + 20 +13.081227 + 30 +0.0 + 10 +50.000049 + 20 +13.071456 + 30 +0.0 + 0 +SPLINE + 5 +118 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +13.071456 + 30 +0.0 + 10 +58.459978 + 20 +13.097594 + 30 +0.0 + 10 +66.657490 + 20 +16.011070 + 30 +0.0 + 10 +73.236357 + 20 +21.329867 + 30 +0.0 + 0 +LWPOLYLINE + 5 +119 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +2 + 70 +0 + 10 +30.468424 + 20 +34.957458 + 30 +0.0 + 10 +21.704102 + 20 +26.193136 + 30 +0.0 + 0 +SPLINE + 5 +11a +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +70.147139 + 20 +24.747229 + 30 +0.0 + 10 +64.432180 + 20 +20.158004 + 30 +0.0 + 10 +57.329500 + 20 +17.642998 + 30 +0.0 + 10 +50.000049 + 20 +17.613298 + 30 +0.0 + 0 +SPLINE + 5 +11b +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +50.000049 + 20 +17.613298 + 30 +0.0 + 10 +42.031806 + 20 +17.643491 + 30 +0.0 + 10 +34.403936 + 20 +20.612407 + 30 +0.0 + 10 +28.529008 + 20 +25.870158 + 30 +0.0 + 0 +LWPOLYLINE + 5 +11c +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +2 + 70 +0 + 10 +73.236357 + 20 +21.329867 + 30 +0.0 + 10 +70.147139 + 20 +24.747229 + 30 +0.0 + 0 +LWPOLYLINE + 5 +11d +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +3 + 70 +0 + 10 +28.529008 + 20 +25.870158 + 30 +0.0 + 10 +34.042367 + 20 +31.383516 + 30 +0.0 + 10 +30.468424 + 20 +34.957458 + 30 +0.0 + 0 +SPLINE + 5 +11e +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +13.231234 + 20 +45.000258 + 30 +0.0 + 10 +13.474885 + 20 +43.310754 + 30 +0.0 + 10 +13.834717 + 20 +41.640056 + 30 +0.0 + 10 +14.308171 + 20 +40.000047 + 30 +0.0 + 0 +LWPOLYLINE + 5 +11f +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +3 + 70 +0 + 10 +53.049475 + 20 +45.027128 + 30 +0.0 + 10 +53.049475 + 20 +45.000258 + 30 +0.0 + 10 +13.231234 + 20 +45.000258 + 30 +0.0 + 0 +SPLINE + 5 +120 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbSpline + 70 +8 + 71 +3 + 72 +8 + 73 +4 + 74 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +0 + 40 +1 + 40 +1 + 40 +1 + 40 +1 + 10 +85.691927 + 20 +40.000045 + 30 +0.0 + 10 +86.165381 + 20 +41.640054 + 30 +0.0 + 10 +86.525213 + 20 +43.310752 + 30 +0.0 + 10 +86.768864 + 20 +45.000256 + 30 +0.0 + 0 +LWPOLYLINE + 5 +121 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +10 + 70 +0 + 10 +14.308171 + 20 +40.000047 + 30 +0.0 + 10 +53.049475 + 20 +40.000047 + 30 +0.0 + 10 +53.049475 + 20 +24.633024 + 30 +0.0 + 10 +58.103430 + 20 +24.633024 + 30 +0.0 + 10 +58.103430 + 20 +32.302840 + 30 +0.0 + 10 +73.684908 + 20 +32.302840 + 30 +0.0 + 10 +73.684908 + 20 +37.356795 + 30 +0.0 + 10 +58.103430 + 20 +37.356795 + 30 +0.0 + 10 +58.103430 + 20 +40.000045 + 30 +0.0 + 10 +85.691927 + 20 +40.000045 + 30 +0.0 + 0 +LWPOLYLINE + 5 +122 +100 +AcDbEntity + 8 +Ze + 62 +3 +100 +AcDbPolyline + 90 +4 + 70 +0 + 10 +86.768864 + 20 +45.000256 + 30 +0.0 + 10 +58.103430 + 20 +45.000256 + 30 +0.0 + 10 +58.103430 + 20 +45.027126 + 30 +0.0 + 10 +53.049475 + 20 +45.027128 + 30 +0.0 + 0 +ENDSEC + 0 +SECTION + 2 +OBJECTS + 0 +DICTIONARY + 5 +C +330 +0 +100 +AcDbDictionary + 3 +ACAD_GROUP +350 +D + 3 +ACAD_MLINESTYLE +350 +17 + 0 +DICTIONARY + 5 +D +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +1A +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +17 +330 +C +100 +AcDbDictionary + 3 +STANDARD +350 +18 + 0 +DICTIONARY + 5 +19 +330 +C +100 +AcDbDictionary + 0 +ENDSEC + 0 +EOF diff --git a/nhf/touhou/shiki_eiki/epaulette.py b/nhf/touhou/shiki_eiki/epaulette.py index 38b9d10..6150c64 100644 --- a/nhf/touhou/shiki_eiki/epaulette.py +++ b/nhf/touhou/shiki_eiki/epaulette.py @@ -1,5 +1,6 @@ import math from dataclasses import dataclass, field +from pathlib import Path import cadquery as Cq from nhf import Material, Role from nhf.build import Model, target, assembly @@ -8,5 +9,28 @@ import nhf.utils @dataclass class Epaulette(Model): + side: str + diam: float = 100.0 + thickness_brass: float = 0.4 # 26 Gauge + thickness_fabric: float = 0.3 + material: Material = Material.METAL_BRASS + def __post_init__(self): - super().__init__(name="epaulette") + super().__init__(name=f"epaulette-{self.side}") + + def surface(self) -> Cq.Solid: + path = Path(__file__).resolve().parent / f"epaulette-{self.side}.dxf" + return ( + Cq.importers.importDXF(path).wires().toPending().extrude(self.thickness_brass) + ) + def assembly(self) -> Cq.Assembly: + assembly = ( + Cq.Assembly() + .addS( + self.surface(), + name="surface", + material=self.material, + role=Role.DECORATION, + ) + ) + return assembly diff --git a/nhf/touhou/shiki_eiki/rod.py b/nhf/touhou/shiki_eiki/rod.py index 3b303ac..9ae8f8e 100644 --- a/nhf/touhou/shiki_eiki/rod.py +++ b/nhf/touhou/shiki_eiki/rod.py @@ -14,6 +14,9 @@ class Rod(Model): width_tail: float = 60.0 margin: float = 10.0 + thickness_top: float = 25.4 / 4 + thickness_side: float = 25.4 / 8 + # counted from middle to the bottom fac_bar_top: float = 0.1 # counted from bottom to top @@ -23,6 +26,8 @@ class Rod(Model): fac_window_footer_bot: float = 0.33 fac_window_footer_top: float = 0.59 + material_shell: Material = Material.WOOD_BIRCH + def __post_init__(self): super().__init__(name="rod") self.loc_core = Cq.Location.from2d(self.length - self.length_tip, 0) @@ -279,7 +284,7 @@ class Rod(Model): @target(name="surface") - def top_profile(self) -> Cq.Sketch: + def profile_top(self) -> Cq.Sketch: sketch = ( Cq.Sketch() .polygon([ @@ -302,9 +307,22 @@ class Rod(Model): ) return sketch + def surface_top(self) -> Cq.Workplane: + return ( + Cq.Workplane('XZ') + .placeSketch(self.profile_top()) + .extrude(self.thickness_top) + ) + @assembly() def assembly(self) -> Cq.Assembly: a = ( Cq.Assembly() + .addS( + self.surface_top(), + name="top", + material=self.material_shell, + role=Role.STRUCTURE | Role.DECORATION + ) ) return a diff --git a/nhf/touhou/shiki_eiki/zehi.svg b/nhf/touhou/shiki_eiki/zehi.svg new file mode 100644 index 0000000..cfa56e0 --- /dev/null +++ b/nhf/touhou/shiki_eiki/zehi.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +