@johnmorrisdotca/uchusen-rockets 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/LICENSES/CC-BY-4.0.txt +396 -0
- package/LICENSES/MIT.txt +21 -0
- package/NOTICE.md +66 -0
- package/README.md +171 -2
- package/dist/assets/dragon-dragon-1-apart.painted.svg +1 -0
- package/dist/assets/dragon-dragon-1-apart.svg +1 -0
- package/dist/assets/dragon-dragon-1-apart.thick.svg +1 -0
- package/dist/assets/dragon-dragon-1-capsule.glb +0 -0
- package/dist/assets/dragon-dragon-1-capsule.painted.svg +1 -0
- package/dist/assets/dragon-dragon-1-capsule.svg +1 -0
- package/dist/assets/dragon-dragon-1-capsule.thick.svg +1 -0
- package/dist/assets/dragon-dragon-1-trunk.glb +0 -0
- package/dist/assets/dragon-dragon-1-trunk.painted.svg +1 -0
- package/dist/assets/dragon-dragon-1-trunk.svg +1 -0
- package/dist/assets/dragon-dragon-1-trunk.thick.svg +1 -0
- package/dist/assets/dragon-dragon-1.glb +0 -0
- package/dist/assets/dragon-dragon-1.painted.svg +1 -0
- package/dist/assets/dragon-dragon-1.svg +1 -0
- package/dist/assets/dragon-dragon-1.thick.svg +1 -0
- package/dist/assets/dragon-dragon-2-apart.painted.svg +1 -0
- package/dist/assets/dragon-dragon-2-apart.svg +1 -0
- package/dist/assets/dragon-dragon-2-apart.thick.svg +1 -0
- package/dist/assets/dragon-dragon-2-capsule.glb +0 -0
- package/dist/assets/dragon-dragon-2-capsule.painted.svg +1 -0
- package/dist/assets/dragon-dragon-2-capsule.svg +1 -0
- package/dist/assets/dragon-dragon-2-capsule.thick.svg +1 -0
- package/dist/assets/dragon-dragon-2-trunk.glb +0 -0
- package/dist/assets/dragon-dragon-2-trunk.painted.svg +1 -0
- package/dist/assets/dragon-dragon-2-trunk.svg +1 -0
- package/dist/assets/dragon-dragon-2-trunk.thick.svg +1 -0
- package/dist/assets/dragon-dragon-2.glb +0 -0
- package/dist/assets/dragon-dragon-2.painted.svg +1 -0
- package/dist/assets/dragon-dragon-2.svg +1 -0
- package/dist/assets/dragon-dragon-2.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-apart.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-apart.svg +1 -0
- package/dist/assets/falcon-9-block-5-apart.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-apart.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-apart.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-apart.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-capsule.glb +0 -0
- package/dist/assets/falcon-9-block-5-dragon-2-capsule.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-capsule.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-capsule.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-first-stage.glb +0 -0
- package/dist/assets/falcon-9-block-5-dragon-2-first-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-first-stage.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-first-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-second-stage.glb +0 -0
- package/dist/assets/falcon-9-block-5-dragon-2-second-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-second-stage.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-second-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-trunk.glb +0 -0
- package/dist/assets/falcon-9-block-5-dragon-2-trunk.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-trunk.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2-trunk.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2.glb +0 -0
- package/dist/assets/falcon-9-block-5-dragon-2.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2.svg +1 -0
- package/dist/assets/falcon-9-block-5-dragon-2.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-fairing.glb +0 -0
- package/dist/assets/falcon-9-block-5-fairing.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-fairing.svg +1 -0
- package/dist/assets/falcon-9-block-5-fairing.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-first-stage.glb +0 -0
- package/dist/assets/falcon-9-block-5-first-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-first-stage.svg +1 -0
- package/dist/assets/falcon-9-block-5-first-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5-second-stage.glb +0 -0
- package/dist/assets/falcon-9-block-5-second-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5-second-stage.svg +1 -0
- package/dist/assets/falcon-9-block-5-second-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-block-5.glb +0 -0
- package/dist/assets/falcon-9-block-5.painted.svg +1 -0
- package/dist/assets/falcon-9-block-5.svg +1 -0
- package/dist/assets/falcon-9-block-5.thick.svg +1 -0
- package/dist/assets/falcon-9-ft-apart.painted.svg +1 -0
- package/dist/assets/falcon-9-ft-apart.svg +1 -0
- package/dist/assets/falcon-9-ft-apart.thick.svg +1 -0
- package/dist/assets/falcon-9-ft-fairing.glb +0 -0
- package/dist/assets/falcon-9-ft-fairing.painted.svg +1 -0
- package/dist/assets/falcon-9-ft-fairing.svg +1 -0
- package/dist/assets/falcon-9-ft-fairing.thick.svg +1 -0
- package/dist/assets/falcon-9-ft-first-stage.glb +0 -0
- package/dist/assets/falcon-9-ft-first-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-ft-first-stage.svg +1 -0
- package/dist/assets/falcon-9-ft-first-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-ft-second-stage.glb +0 -0
- package/dist/assets/falcon-9-ft-second-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-ft-second-stage.svg +1 -0
- package/dist/assets/falcon-9-ft-second-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-ft.glb +0 -0
- package/dist/assets/falcon-9-ft.painted.svg +1 -0
- package/dist/assets/falcon-9-ft.svg +1 -0
- package/dist/assets/falcon-9-ft.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.0-apart.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.0-apart.svg +1 -0
- package/dist/assets/falcon-9-v1.0-apart.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.0-fairing.glb +0 -0
- package/dist/assets/falcon-9-v1.0-fairing.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.0-fairing.svg +1 -0
- package/dist/assets/falcon-9-v1.0-fairing.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.0-first-stage.glb +0 -0
- package/dist/assets/falcon-9-v1.0-first-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.0-first-stage.svg +1 -0
- package/dist/assets/falcon-9-v1.0-first-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.0-second-stage.glb +0 -0
- package/dist/assets/falcon-9-v1.0-second-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.0-second-stage.svg +1 -0
- package/dist/assets/falcon-9-v1.0-second-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.0.glb +0 -0
- package/dist/assets/falcon-9-v1.0.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.0.svg +1 -0
- package/dist/assets/falcon-9-v1.0.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.1-apart.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.1-apart.svg +1 -0
- package/dist/assets/falcon-9-v1.1-apart.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.1-fairing.glb +0 -0
- package/dist/assets/falcon-9-v1.1-fairing.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.1-fairing.svg +1 -0
- package/dist/assets/falcon-9-v1.1-fairing.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.1-first-stage.glb +0 -0
- package/dist/assets/falcon-9-v1.1-first-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.1-first-stage.svg +1 -0
- package/dist/assets/falcon-9-v1.1-first-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.1-second-stage.glb +0 -0
- package/dist/assets/falcon-9-v1.1-second-stage.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.1-second-stage.svg +1 -0
- package/dist/assets/falcon-9-v1.1-second-stage.thick.svg +1 -0
- package/dist/assets/falcon-9-v1.1.glb +0 -0
- package/dist/assets/falcon-9-v1.1.painted.svg +1 -0
- package/dist/assets/falcon-9-v1.1.svg +1 -0
- package/dist/assets/falcon-9-v1.1.thick.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-apart.painted.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-apart.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-apart.thick.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-centre.glb +0 -0
- package/dist/assets/falcon-heavy-falcon-heavy-centre.painted.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-centre.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-centre.thick.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-left.glb +0 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-left.painted.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-left.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-left.thick.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-right.glb +0 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-right.painted.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-right.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy-side-right.thick.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy.glb +0 -0
- package/dist/assets/falcon-heavy-falcon-heavy.painted.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy.svg +1 -0
- package/dist/assets/falcon-heavy-falcon-heavy.thick.svg +1 -0
- package/dist/assets/grasshopper-grasshopper.glb +0 -0
- package/dist/assets/grasshopper-grasshopper.painted.svg +1 -0
- package/dist/assets/grasshopper-grasshopper.svg +1 -0
- package/dist/assets/grasshopper-grasshopper.thick.svg +1 -0
- package/dist/assets/models/dragon-dragon-1-capsule.glb +0 -0
- package/dist/assets/models/dragon-dragon-1-trunk.glb +0 -0
- package/dist/assets/models/dragon-dragon-2-capsule.glb +0 -0
- package/dist/assets/models/dragon-dragon-2-trunk.glb +0 -0
- package/dist/assets/models/falcon-9-block-5-fairing.glb +0 -0
- package/dist/assets/models/falcon-9-block-5-first-stage.glb +0 -0
- package/dist/assets/models/falcon-9-block-5-second-stage.glb +0 -0
- package/dist/assets/models/falcon-heavy-falcon-heavy-centre.glb +0 -0
- package/dist/assets/models/falcon-heavy-falcon-heavy-side-left.glb +0 -0
- package/dist/assets/models/falcon-heavy-falcon-heavy-side-right.glb +0 -0
- package/dist/assets/models/grasshopper-grasshopper-vehicle.glb +0 -0
- package/dist/assets/models/starship-2019-ship.glb +0 -0
- package/dist/assets/models/starship-v1-flight1-booster.glb +0 -0
- package/dist/assets/models/starship-v1-flight1-ship.glb +0 -0
- package/dist/assets/models/starship-v3-booster.glb +0 -0
- package/dist/assets/models/starship-v3-ship.glb +0 -0
- package/dist/assets/parts/flap-aft.glb +0 -0
- package/dist/assets/parts/flap-aft.painted.svg +1 -0
- package/dist/assets/parts/flap-aft.svg +1 -0
- package/dist/assets/parts/flap-aft.thick.svg +1 -0
- package/dist/assets/parts/flap-forward.glb +0 -0
- package/dist/assets/parts/flap-forward.painted.svg +1 -0
- package/dist/assets/parts/flap-forward.svg +1 -0
- package/dist/assets/parts/flap-forward.thick.svg +1 -0
- package/dist/assets/parts/grid-fin-four.glb +0 -0
- package/dist/assets/parts/grid-fin-four.painted.svg +1 -0
- package/dist/assets/parts/grid-fin-four.svg +1 -0
- package/dist/assets/parts/grid-fin-four.thick.svg +1 -0
- package/dist/assets/parts/grid-fin-three.glb +0 -0
- package/dist/assets/parts/grid-fin-three.painted.svg +1 -0
- package/dist/assets/parts/grid-fin-three.svg +1 -0
- package/dist/assets/parts/grid-fin-three.thick.svg +1 -0
- package/dist/assets/parts/merlin-sea-level.glb +0 -0
- package/dist/assets/parts/merlin-sea-level.painted.svg +1 -0
- package/dist/assets/parts/merlin-sea-level.svg +1 -0
- package/dist/assets/parts/merlin-sea-level.thick.svg +1 -0
- package/dist/assets/parts/raptor-sea-level.glb +0 -0
- package/dist/assets/parts/raptor-sea-level.painted.svg +1 -0
- package/dist/assets/parts/raptor-sea-level.svg +1 -0
- package/dist/assets/parts/raptor-sea-level.thick.svg +1 -0
- package/dist/assets/parts/raptor-vacuum.glb +0 -0
- package/dist/assets/parts/raptor-vacuum.painted.svg +1 -0
- package/dist/assets/parts/raptor-vacuum.svg +1 -0
- package/dist/assets/parts/raptor-vacuum.thick.svg +1 -0
- package/dist/assets/starship-2019.glb +0 -0
- package/dist/assets/starship-2019.painted.svg +1 -0
- package/dist/assets/starship-2019.svg +1 -0
- package/dist/assets/starship-2019.thick.svg +1 -0
- package/dist/assets/starship-v1-apart.painted.svg +1 -0
- package/dist/assets/starship-v1-apart.svg +1 -0
- package/dist/assets/starship-v1-apart.thick.svg +1 -0
- package/dist/assets/starship-v1-booster.glb +0 -0
- package/dist/assets/starship-v1-booster.painted.svg +1 -0
- package/dist/assets/starship-v1-booster.svg +1 -0
- package/dist/assets/starship-v1-booster.thick.svg +1 -0
- package/dist/assets/starship-v1-flight1-apart.painted.svg +1 -0
- package/dist/assets/starship-v1-flight1-apart.svg +1 -0
- package/dist/assets/starship-v1-flight1-apart.thick.svg +1 -0
- package/dist/assets/starship-v1-flight1-booster.glb +0 -0
- package/dist/assets/starship-v1-flight1-booster.painted.svg +1 -0
- package/dist/assets/starship-v1-flight1-booster.svg +1 -0
- package/dist/assets/starship-v1-flight1-booster.thick.svg +1 -0
- package/dist/assets/starship-v1-flight1-ship.glb +0 -0
- package/dist/assets/starship-v1-flight1-ship.painted.svg +1 -0
- package/dist/assets/starship-v1-flight1-ship.svg +1 -0
- package/dist/assets/starship-v1-flight1-ship.thick.svg +1 -0
- package/dist/assets/starship-v1-flight1.glb +0 -0
- package/dist/assets/starship-v1-flight1.painted.svg +1 -0
- package/dist/assets/starship-v1-flight1.svg +1 -0
- package/dist/assets/starship-v1-flight1.thick.svg +1 -0
- package/dist/assets/starship-v1-ship.glb +0 -0
- package/dist/assets/starship-v1-ship.painted.svg +1 -0
- package/dist/assets/starship-v1-ship.svg +1 -0
- package/dist/assets/starship-v1-ship.thick.svg +1 -0
- package/dist/assets/starship-v1.glb +0 -0
- package/dist/assets/starship-v1.painted.svg +1 -0
- package/dist/assets/starship-v1.svg +1 -0
- package/dist/assets/starship-v1.thick.svg +1 -0
- package/dist/assets/starship-v2-apart.painted.svg +1 -0
- package/dist/assets/starship-v2-apart.svg +1 -0
- package/dist/assets/starship-v2-apart.thick.svg +1 -0
- package/dist/assets/starship-v2-booster.glb +0 -0
- package/dist/assets/starship-v2-booster.painted.svg +1 -0
- package/dist/assets/starship-v2-booster.svg +1 -0
- package/dist/assets/starship-v2-booster.thick.svg +1 -0
- package/dist/assets/starship-v2-ship.glb +0 -0
- package/dist/assets/starship-v2-ship.painted.svg +1 -0
- package/dist/assets/starship-v2-ship.svg +1 -0
- package/dist/assets/starship-v2-ship.thick.svg +1 -0
- package/dist/assets/starship-v2.glb +0 -0
- package/dist/assets/starship-v2.painted.svg +1 -0
- package/dist/assets/starship-v2.svg +1 -0
- package/dist/assets/starship-v2.thick.svg +1 -0
- package/dist/assets/starship-v3-apart.painted.svg +1 -0
- package/dist/assets/starship-v3-apart.svg +1 -0
- package/dist/assets/starship-v3-apart.thick.svg +1 -0
- package/dist/assets/starship-v3-booster.glb +0 -0
- package/dist/assets/starship-v3-booster.painted.svg +1 -0
- package/dist/assets/starship-v3-booster.svg +1 -0
- package/dist/assets/starship-v3-booster.thick.svg +1 -0
- package/dist/assets/starship-v3-ship.glb +0 -0
- package/dist/assets/starship-v3-ship.painted.svg +1 -0
- package/dist/assets/starship-v3-ship.svg +1 -0
- package/dist/assets/starship-v3-ship.thick.svg +1 -0
- package/dist/assets/starship-v3.glb +0 -0
- package/dist/assets/starship-v3.painted.svg +1 -0
- package/dist/assets/starship-v3.svg +1 -0
- package/dist/assets/starship-v3.thick.svg +1 -0
- package/dist/assets/starship-v4-apart.painted.svg +1 -0
- package/dist/assets/starship-v4-apart.svg +1 -0
- package/dist/assets/starship-v4-apart.thick.svg +1 -0
- package/dist/assets/starship-v4-booster.glb +0 -0
- package/dist/assets/starship-v4-booster.painted.svg +1 -0
- package/dist/assets/starship-v4-booster.svg +1 -0
- package/dist/assets/starship-v4-booster.thick.svg +1 -0
- package/dist/assets/starship-v4-ship.glb +0 -0
- package/dist/assets/starship-v4-ship.painted.svg +1 -0
- package/dist/assets/starship-v4-ship.svg +1 -0
- package/dist/assets/starship-v4-ship.thick.svg +1 -0
- package/dist/assets/starship-v4.glb +0 -0
- package/dist/assets/starship-v4.painted.svg +1 -0
- package/dist/assets/starship-v4.svg +1 -0
- package/dist/assets/starship-v4.thick.svg +1 -0
- package/dist/build/glb.d.ts +12 -0
- package/dist/build/glb.js +157 -0
- package/dist/build/index.d.ts +59 -0
- package/dist/build/index.js +118 -0
- package/dist/build/lineup.d.ts +40 -0
- package/dist/build/lineup.js +97 -0
- package/dist/crossfade.d.ts +6 -0
- package/dist/crossfade.js +11 -0
- package/dist/data/credits.d.ts +87 -0
- package/dist/data/credits.js +82 -0
- package/dist/data/dragon.d.ts +2 -0
- package/dist/data/dragon.js +45 -0
- package/dist/data/falcon.d.ts +3 -0
- package/dist/data/falcon.js +121 -0
- package/dist/data/grasshopper.d.ts +2 -0
- package/dist/data/grasshopper.js +21 -0
- package/dist/data/sources.d.ts +173 -0
- package/dist/data/sources.js +25 -0
- package/dist/data/starship.d.ts +2 -0
- package/dist/data/starship.js +183 -0
- package/dist/data/types.d.ts +48 -0
- package/dist/data/types.js +8 -0
- package/dist/draw/svg.d.ts +26 -0
- package/dist/draw/svg.js +262 -0
- package/dist/element/paint.d.ts +9 -0
- package/dist/element/paint.js +138 -0
- package/dist/element/scene.d.ts +104 -0
- package/dist/element/scene.js +758 -0
- package/dist/element.d.ts +74 -0
- package/dist/element.js +488 -0
- package/dist/fit.d.ts +43 -0
- package/dist/fit.js +93 -0
- package/dist/framing.d.ts +32 -0
- package/dist/framing.js +52 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/layout.d.ts +17 -0
- package/dist/layout.js +33 -0
- package/dist/looks.d.ts +25 -0
- package/dist/looks.js +36 -0
- package/dist/model/falcon.d.ts +48 -0
- package/dist/model/falcon.js +206 -0
- package/dist/model/materials.d.ts +113 -0
- package/dist/model/materials.js +19 -0
- package/dist/model/pieces.d.ts +91 -0
- package/dist/model/pieces.js +223 -0
- package/dist/model/registry.d.ts +8 -0
- package/dist/model/registry.js +104 -0
- package/dist/model/starship.d.ts +67 -0
- package/dist/model/starship.js +503 -0
- package/dist/parts.d.ts +44 -0
- package/dist/parts.js +1 -0
- package/dist/react.d.ts +314 -0
- package/dist/react.js +8 -0
- package/dist/rockets.d.ts +27 -0
- package/dist/rockets.js +36 -0
- package/dist/tilt.d.ts +21 -0
- package/dist/tilt.js +23 -0
- package/package.json +65 -4
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
// Starship's parts from a table of numbers, so a change of block is a change of numbers. Heights and the diameter are the sourced figures. The rest of this table is how a part is drawn, not a published
|
|
2
|
+
// figure: no source gives a flap's size or a fin's reach. Block 3's come from measuring Clarence365's model after it was scaled to the sourced sizes (CC BY 4.0, see NOTICE.md); Blocks 1 and 2 keep their
|
|
3
|
+
// own documented differences (four fins, flap angles, engine shielding) with sizes judged from photographs.
|
|
4
|
+
import { deg } from "../framing.js";
|
|
5
|
+
import { flat, pointOf, radial, radiusAt, strut } from "./pieces.js";
|
|
6
|
+
const BOOSTER_ENGINES = [
|
|
7
|
+
{ ring: 0.78, count: 3, start: 30, type: "sea" },
|
|
8
|
+
{ ring: 2.2, count: 10, start: 18, type: "sea" },
|
|
9
|
+
{ ring: 3.92, count: 20, start: 9, type: "sea" },
|
|
10
|
+
];
|
|
11
|
+
const R = 4.5;
|
|
12
|
+
const TILE_LONG = (noseStart, height) => [
|
|
13
|
+
[0, 90],
|
|
14
|
+
[noseStart - 1.5, 90],
|
|
15
|
+
[noseStart + 2.5, 138],
|
|
16
|
+
[height - 7, 142],
|
|
17
|
+
[height - 5.5, 180],
|
|
18
|
+
[height, 180],
|
|
19
|
+
];
|
|
20
|
+
const ring = (height) => ({ height, struts: 24, integrated: false });
|
|
21
|
+
const FOUR_FINS = { az: [45, 135, 225, 315], reach: 7.9, width: 2.9, thick: 0.9, octagon: false };
|
|
22
|
+
export const STARSHIP_DRAWS = {
|
|
23
|
+
v1: {
|
|
24
|
+
radius: R,
|
|
25
|
+
boosterHeight: 71,
|
|
26
|
+
shipHeight: 50.3,
|
|
27
|
+
boosterSkirt: 1.1,
|
|
28
|
+
boosterBay: 2.7,
|
|
29
|
+
shielded: true,
|
|
30
|
+
ring: ring(2),
|
|
31
|
+
fins: { ...FOUR_FINS, y: 64.8 },
|
|
32
|
+
chines: { az: [60, -60, 150, -150], from: 3, to: 17, out: 0.6 },
|
|
33
|
+
boosterEngines: BOOSTER_ENGINES,
|
|
34
|
+
shipEngines: shipEngineRing(3, 2.95),
|
|
35
|
+
noseStart: 35,
|
|
36
|
+
tile: TILE_LONG(35, 50.3),
|
|
37
|
+
forward: { az: 90, thickness: 0.32, outline: [[3.6, 38.6], [8.1, 38.6], [8.1, 41], [4.3, 47.6], [3, 47.6]] },
|
|
38
|
+
aft: { az: 90, thickness: 0.4, outline: [[4.3, 0.3], [8.3, 0.3], [8.3, 6.3], [4.9, 12.2], [4.3, 12.2]] },
|
|
39
|
+
door: null,
|
|
40
|
+
docking: false,
|
|
41
|
+
},
|
|
42
|
+
"v1-flight1": {
|
|
43
|
+
radius: R,
|
|
44
|
+
boosterHeight: 69,
|
|
45
|
+
shipHeight: 50.3,
|
|
46
|
+
boosterSkirt: 1.1,
|
|
47
|
+
boosterBay: 2.7,
|
|
48
|
+
shielded: true,
|
|
49
|
+
ring: { height: 0, struts: 0, integrated: false },
|
|
50
|
+
fins: { ...FOUR_FINS, y: 64.6 },
|
|
51
|
+
chines: { az: [60, -60, 150, -150], from: 3, to: 17, out: 0.6 },
|
|
52
|
+
boosterEngines: BOOSTER_ENGINES,
|
|
53
|
+
shipEngines: shipEngineRing(3, 2.95),
|
|
54
|
+
noseStart: 35,
|
|
55
|
+
tile: TILE_LONG(35, 50.3),
|
|
56
|
+
forward: { az: 90, thickness: 0.32, outline: [[3.6, 38.6], [8.1, 38.6], [8.1, 41], [4.3, 47.6], [3, 47.6]] },
|
|
57
|
+
aft: { az: 90, thickness: 0.4, outline: [[4.3, 0.3], [8.3, 0.3], [8.3, 6.3], [4.9, 12.2], [4.3, 12.2]] },
|
|
58
|
+
door: null,
|
|
59
|
+
docking: false,
|
|
60
|
+
},
|
|
61
|
+
v2: {
|
|
62
|
+
radius: R,
|
|
63
|
+
boosterHeight: 71,
|
|
64
|
+
shipHeight: 52.1,
|
|
65
|
+
boosterSkirt: 1.1,
|
|
66
|
+
boosterBay: 2.7,
|
|
67
|
+
shielded: true,
|
|
68
|
+
ring: ring(2),
|
|
69
|
+
fins: { ...FOUR_FINS, y: 64.8 },
|
|
70
|
+
chines: { az: [60, -60, 150, -150], from: 3, to: 17, out: 0.6 },
|
|
71
|
+
boosterEngines: BOOSTER_ENGINES,
|
|
72
|
+
shipEngines: shipEngineRing(3, 2.95),
|
|
73
|
+
noseStart: 36.5,
|
|
74
|
+
tile: TILE_LONG(36.5, 52.1),
|
|
75
|
+
forward: { az: 110, thickness: 0.24, outline: [[3.2, 41], [7.9, 41], [7.9, 43.4], [3.7, 49.2], [2.5, 49.2]] },
|
|
76
|
+
aft: { az: 90, thickness: 0.4, outline: [[4.3, 0.3], [8.1, 0.3], [8.1, 6.2], [5, 11.9], [4.3, 11.9]] },
|
|
77
|
+
door: [33, 41],
|
|
78
|
+
docking: false,
|
|
79
|
+
},
|
|
80
|
+
v3: v3Like(72.3, 52.1, 3),
|
|
81
|
+
v4: v3Like(81, 61, 6),
|
|
82
|
+
"2019": {
|
|
83
|
+
radius: 4.47,
|
|
84
|
+
boosterHeight: 0,
|
|
85
|
+
shipHeight: 50,
|
|
86
|
+
boosterSkirt: 0,
|
|
87
|
+
boosterBay: 0,
|
|
88
|
+
shielded: false,
|
|
89
|
+
ring: ring(0),
|
|
90
|
+
fins: { ...FOUR_FINS, y: 0 },
|
|
91
|
+
chines: { az: [], from: 0, to: 0, out: 0 },
|
|
92
|
+
boosterEngines: [],
|
|
93
|
+
shipEngines: shipEngineRing(3, 2.75),
|
|
94
|
+
noseStart: 30,
|
|
95
|
+
tile: [
|
|
96
|
+
[0, 92],
|
|
97
|
+
[50, 92],
|
|
98
|
+
],
|
|
99
|
+
// measured from MartianDays' model after scaling: flaps that run from the body, large aft fins
|
|
100
|
+
forward: { az: 90, thickness: 0.5, outline: [[3.1, 34.5], [9.1, 40], [9.1, 42], [1.5, 48.8]] },
|
|
101
|
+
aft: { az: 90, thickness: 0.6, outline: [[4.4, 13.5], [4.4, 0.15], [9.4, 0.15], [9.4, 3.2]] },
|
|
102
|
+
door: null,
|
|
103
|
+
docking: false,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
function shipEngineRing(vacuum, ring) {
|
|
107
|
+
return [
|
|
108
|
+
{ ring: 0.85, count: 3, start: 180, type: "sea" },
|
|
109
|
+
{ ring, count: vacuum, start: 60, type: "vacuum" },
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
function v3Like(boosterHeight, shipHeight, vacuum) {
|
|
113
|
+
const stretch = shipHeight - 52.1;
|
|
114
|
+
return {
|
|
115
|
+
radius: R,
|
|
116
|
+
boosterHeight,
|
|
117
|
+
shipHeight,
|
|
118
|
+
boosterSkirt: 3.2,
|
|
119
|
+
boosterBay: 2.6,
|
|
120
|
+
shielded: false,
|
|
121
|
+
ring: { height: 2.8, struts: 22, integrated: true },
|
|
122
|
+
fins: { az: [0, 90, -90], y: boosterHeight - 6.8, reach: 8.7, width: 3.4, thick: 0.9, octagon: true },
|
|
123
|
+
chines: { az: [60, -60, 150, -150], from: 5.5, to: 27, out: 1.3 },
|
|
124
|
+
boosterEngines: BOOSTER_ENGINES,
|
|
125
|
+
shipEngines: shipEngineRing(vacuum, 3.1),
|
|
126
|
+
noseStart: 36.5 + stretch,
|
|
127
|
+
tile: TILE_LONG(36.5 + stretch, shipHeight),
|
|
128
|
+
forward: { az: 110, thickness: 0.24, outline: [[3.1, 40.9 + stretch], [7.9, 40.9 + stretch], [7.9, 43.3 + stretch], [3.5, 49 + stretch], [2.4, 49 + stretch]] },
|
|
129
|
+
aft: { az: 90, thickness: 0.4, outline: [[4.3, 0.3], [8.1, 0.3], [8.1, 6.2], [5, 11.9], [4.3, 11.9]] },
|
|
130
|
+
door: [33 + stretch, 41 + stretch],
|
|
131
|
+
docking: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
135
|
+
/** One Raptor from its exit up: the bell, its dark inside and the machinery over it. Its origin is the middle of its exit. */
|
|
136
|
+
export function raptor(at, y, type) {
|
|
137
|
+
const vac = type === "vacuum";
|
|
138
|
+
const exit = vac ? 1.15 : 0.6;
|
|
139
|
+
const length = vac ? 4.4 : 3.1;
|
|
140
|
+
const throat = vac ? 0.26 : 0.22;
|
|
141
|
+
const neck = y + length * (vac ? 0.72 : 0.5);
|
|
142
|
+
const bell = {
|
|
143
|
+
kind: "lathe",
|
|
144
|
+
material: "bell",
|
|
145
|
+
at,
|
|
146
|
+
segs: vac ? 18 : 12,
|
|
147
|
+
under: true,
|
|
148
|
+
outline: true,
|
|
149
|
+
profile: [
|
|
150
|
+
[exit, y],
|
|
151
|
+
[exit * 0.9, y + (neck - y) * 0.28],
|
|
152
|
+
[exit * 0.68, y + (neck - y) * 0.58],
|
|
153
|
+
[exit * 0.42, y + (neck - y) * 0.86],
|
|
154
|
+
[throat, neck],
|
|
155
|
+
],
|
|
156
|
+
rings: [y],
|
|
157
|
+
};
|
|
158
|
+
const inside = {
|
|
159
|
+
kind: "lathe",
|
|
160
|
+
material: "bell-inside",
|
|
161
|
+
at,
|
|
162
|
+
segs: vac ? 18 : 12,
|
|
163
|
+
under: true,
|
|
164
|
+
profile: [
|
|
165
|
+
[throat * 0.8, neck - 0.1],
|
|
166
|
+
[exit * 0.62, y + (neck - y) * 0.5],
|
|
167
|
+
[exit * 0.97, y + 0.015],
|
|
168
|
+
],
|
|
169
|
+
};
|
|
170
|
+
const throatDisc = { kind: "lathe", material: "soot", at, segs: 8, under: true, only: "mesh", profile: [[0, neck - 0.1], [throat * 0.8, neck - 0.1]] };
|
|
171
|
+
const head = {
|
|
172
|
+
kind: "lathe",
|
|
173
|
+
material: "engine-metal",
|
|
174
|
+
at,
|
|
175
|
+
segs: 10,
|
|
176
|
+
under: true,
|
|
177
|
+
only: "mesh",
|
|
178
|
+
profile: [
|
|
179
|
+
[throat, neck],
|
|
180
|
+
[0.42, neck + (length * 0.5 - (neck - y)) * 0.3 + 0.2],
|
|
181
|
+
[0.48, y + length - 0.3],
|
|
182
|
+
[0.3, y + length],
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
return [bell, inside, throatDisc, head];
|
|
186
|
+
}
|
|
187
|
+
function engineRings(rings, y) {
|
|
188
|
+
const pieces = [];
|
|
189
|
+
for (const { ring: r, count, start, type } of rings)
|
|
190
|
+
for (let i = 0; i < count; i++) {
|
|
191
|
+
const a = deg(start + (360 * i) / count);
|
|
192
|
+
pieces.push(...raptor([r * Math.sin(a), r * Math.cos(a)], y, type));
|
|
193
|
+
}
|
|
194
|
+
return pieces;
|
|
195
|
+
}
|
|
196
|
+
/** Clips a line through a convex outline. */
|
|
197
|
+
function clip(a, b, outline) {
|
|
198
|
+
let t0 = 0;
|
|
199
|
+
let t1 = 1;
|
|
200
|
+
const d = [b[0] - a[0], b[1] - a[1]];
|
|
201
|
+
let area = 0;
|
|
202
|
+
for (let i = 0; i < outline.length; i++) {
|
|
203
|
+
const p = outline[i];
|
|
204
|
+
const q = outline[(i + 1) % outline.length];
|
|
205
|
+
area += p[0] * q[1] - q[0] * p[1];
|
|
206
|
+
}
|
|
207
|
+
const sign = area > 0 ? 1 : -1;
|
|
208
|
+
for (let i = 0; i < outline.length; i++) {
|
|
209
|
+
const p = outline[i];
|
|
210
|
+
const q = outline[(i + 1) % outline.length];
|
|
211
|
+
const nx = -(q[1] - p[1]) * sign;
|
|
212
|
+
const ny = (q[0] - p[0]) * sign;
|
|
213
|
+
const denom = nx * d[0] + ny * d[1];
|
|
214
|
+
const dist = nx * (a[0] - p[0]) + ny * (a[1] - p[1]);
|
|
215
|
+
if (Math.abs(denom) < 1e-9) {
|
|
216
|
+
if (dist < 0)
|
|
217
|
+
return null;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const t = -dist / denom;
|
|
221
|
+
if (denom > 0)
|
|
222
|
+
t0 = Math.max(t0, t);
|
|
223
|
+
else
|
|
224
|
+
t1 = Math.min(t1, t);
|
|
225
|
+
}
|
|
226
|
+
if (t0 >= t1)
|
|
227
|
+
return null;
|
|
228
|
+
return [
|
|
229
|
+
[a[0] + d[0] * t0, a[1] + d[1] * t0],
|
|
230
|
+
[a[0] + d[0] * t1, a[1] + d[1] * t1],
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
/** A grid fin held out flat: a frame and a lattice, u outwards and v along the circle. */
|
|
234
|
+
export function gridFin(azDeg, y, rootRadius, reach, width, thick, octagon) {
|
|
235
|
+
const frame = flat(deg(azDeg), y);
|
|
236
|
+
const r0 = rootRadius + 0.35;
|
|
237
|
+
const hw = width / 2;
|
|
238
|
+
const cut = octagon ? width * 0.28 : width * 0.04;
|
|
239
|
+
const outline = octagon
|
|
240
|
+
? [
|
|
241
|
+
[r0, -hw + cut],
|
|
242
|
+
[r0 + cut, -hw],
|
|
243
|
+
[reach - cut, -hw],
|
|
244
|
+
[reach, -hw + cut],
|
|
245
|
+
[reach, hw - cut],
|
|
246
|
+
[reach - cut, hw],
|
|
247
|
+
[r0 + cut, hw],
|
|
248
|
+
[r0, hw - cut],
|
|
249
|
+
]
|
|
250
|
+
: [
|
|
251
|
+
[r0, -hw],
|
|
252
|
+
[reach, -hw],
|
|
253
|
+
[reach, hw],
|
|
254
|
+
[r0, hw],
|
|
255
|
+
];
|
|
256
|
+
const pieces = [];
|
|
257
|
+
// the lattice in the drawing is a plate with lines; in the mesh it is real bars
|
|
258
|
+
const pitch = width / (octagon ? 8 : 6);
|
|
259
|
+
const ribs = [];
|
|
260
|
+
const span = reach + width;
|
|
261
|
+
for (let k = -12; k <= 12; k++) {
|
|
262
|
+
for (const dir of [1, -1]) {
|
|
263
|
+
const c = k * pitch * Math.SQRT2;
|
|
264
|
+
const a = [r0 - span, c - dir * span];
|
|
265
|
+
const b = [r0 + span, c + dir * span];
|
|
266
|
+
const cut2 = clip(a, b, outline);
|
|
267
|
+
if (!cut2)
|
|
268
|
+
continue;
|
|
269
|
+
ribs.push(cut2);
|
|
270
|
+
pieces.push(strut("fin-dark", pointOf(frame, cut2[0][0], cut2[0][1], -thick / 2 + 0.2), pointOf(frame, cut2[1][0], cut2[1][1], -thick / 2 + 0.2), thick * 0.62, 0.05, { only: "mesh" }));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
for (let i = 0; i < outline.length; i++) {
|
|
274
|
+
const p = outline[i];
|
|
275
|
+
const q = outline[(i + 1) % outline.length];
|
|
276
|
+
pieces.push(strut("fin", pointOf(frame, p[0], p[1], 0), pointOf(frame, q[0], q[1], 0), thick, 0.13, { only: "mesh" }));
|
|
277
|
+
}
|
|
278
|
+
pieces.push({ kind: "plate", material: "fin-dark", frame, outline, thickness: thick * 0.9, ribs, only: "drawing" });
|
|
279
|
+
// the line look in 3D: the frame's edge at both faces
|
|
280
|
+
pieces.push({
|
|
281
|
+
kind: "lines",
|
|
282
|
+
weight: "feature",
|
|
283
|
+
only: "mesh",
|
|
284
|
+
paths: [thick / 2, -thick / 2].map((c) => [...outline, outline[0]].map(([a, b]) => pointOf(frame, a, b, c))),
|
|
285
|
+
});
|
|
286
|
+
pieces.push({
|
|
287
|
+
kind: "lines",
|
|
288
|
+
weight: "weld",
|
|
289
|
+
only: "mesh",
|
|
290
|
+
paths: ribs.map(([p, q]) => [pointOf(frame, p[0], p[1], -thick / 2 - 0.01), pointOf(frame, q[0], q[1], -thick / 2 - 0.01)]),
|
|
291
|
+
});
|
|
292
|
+
// where it meets the hull
|
|
293
|
+
pieces.push(strut("fin", pointOf(frame, rootRadius - 0.1, 0, 0), pointOf(frame, r0 + 0.05, 0, 0), 1, 0.7, { only: "mesh" }));
|
|
294
|
+
return pieces;
|
|
295
|
+
}
|
|
296
|
+
/** A flap's plate, tiled on its windward face. `outline` is [radius, height]. */
|
|
297
|
+
export function flap(draw, side) {
|
|
298
|
+
const az = deg(draw.az) * side;
|
|
299
|
+
const frame = radial(az);
|
|
300
|
+
// w must look windward, so the +w face takes the tiles
|
|
301
|
+
const windward = side > 0 ? frame : { ...frame, w: [-frame.w[0], -frame.w[1], -frame.w[2]] };
|
|
302
|
+
// the seams across it
|
|
303
|
+
const heights = draw.outline.map(([, y]) => y);
|
|
304
|
+
const reach = draw.outline.map(([r]) => r);
|
|
305
|
+
const ribs = [];
|
|
306
|
+
for (let y = Math.min(...heights) + 1.8; y < Math.max(...heights) - 0.4; y += 1.8) {
|
|
307
|
+
const seam = clip([Math.min(...reach) - 1, y], [Math.max(...reach) + 1, y], draw.outline);
|
|
308
|
+
if (seam)
|
|
309
|
+
ribs.push(seam);
|
|
310
|
+
}
|
|
311
|
+
return { kind: "plate", material: "steel", top: "tile-plain", frame: windward, outline: draw.outline, thickness: draw.thickness, ribs };
|
|
312
|
+
}
|
|
313
|
+
/** A flap's root fairing above it. */
|
|
314
|
+
function fairing(azDeg, y0, y1, surface, proud) {
|
|
315
|
+
const frame = radial(deg(azDeg));
|
|
316
|
+
const r0 = surface(y0);
|
|
317
|
+
const r1 = surface(y1);
|
|
318
|
+
return { kind: "plate", material: "tile-plain", frame, outline: [[r0 - 0.2, y0], [r0 + proud, y0], [r1 - 0.2, y1]], thickness: 0.7, plain: false };
|
|
319
|
+
}
|
|
320
|
+
/** A hull with the given profile and a tile arc: tile on the windward side, steel on the rest, on the same stations. */
|
|
321
|
+
function hullWithTiles(profile, tile, welds, segs) {
|
|
322
|
+
const ys = [...new Set([...profile.map(([, y]) => y), ...tile.map(([y]) => y)])].sort((a, b) => a - b);
|
|
323
|
+
const stations = ys.map((y) => [radiusAt(profile, y), y]);
|
|
324
|
+
const half = (y) => {
|
|
325
|
+
for (let i = 0; i + 1 < tile.length; i++)
|
|
326
|
+
if (y >= tile[i][0] && y <= tile[i + 1][0])
|
|
327
|
+
return deg(tile[i][1] + ((tile[i + 1][1] - tile[i][1]) * (y - tile[i][0])) / (tile[i + 1][0] - tile[i][0] || 1));
|
|
328
|
+
return deg(tile[tile.length - 1][1]);
|
|
329
|
+
};
|
|
330
|
+
const FULL = deg(179.9);
|
|
331
|
+
const tiles = { kind: "lathe", material: "tile", profile: stations, segs, arc: (y) => [-half(y), half(y)], uv: true, body: true, welds: [] };
|
|
332
|
+
const steelStations = stations.filter(([, y]) => half(y) < FULL || y === stations[stations.length - 1][1]);
|
|
333
|
+
const steel = { kind: "lathe", material: "steel", profile: steelStations.length > 1 ? steelStations : stations, segs, arc: (y) => [half(y), 2 * Math.PI - half(y)], uv: true, body: true, welds: welds.filter((y) => half(y) < FULL) };
|
|
334
|
+
return [steel, tiles];
|
|
335
|
+
}
|
|
336
|
+
const weldsEvery = (from, to, step) => {
|
|
337
|
+
const out = [];
|
|
338
|
+
for (let y = from + step; y < to - 0.2; y += step)
|
|
339
|
+
out.push(Math.round(y * 100) / 100);
|
|
340
|
+
return out;
|
|
341
|
+
};
|
|
342
|
+
/** The vented ring: struts between two rims, on top of the booster. */
|
|
343
|
+
function hotStage(d) {
|
|
344
|
+
const { radius: r, boosterHeight: H, ring: g } = d;
|
|
345
|
+
const y0 = H - g.height;
|
|
346
|
+
const pieces = [];
|
|
347
|
+
// the forward dome, seen through the vents
|
|
348
|
+
const domeTop = y0 + g.height * (g.integrated ? 0.72 : 0.5);
|
|
349
|
+
pieces.push({
|
|
350
|
+
kind: "lathe",
|
|
351
|
+
material: g.integrated ? "steel" : "soot",
|
|
352
|
+
segs: 40,
|
|
353
|
+
only: "mesh",
|
|
354
|
+
profile: [
|
|
355
|
+
[r - 0.05, y0 - 0.05],
|
|
356
|
+
[r * 0.82, y0 + (domeTop - y0) * 0.55],
|
|
357
|
+
[r * 0.5, y0 + (domeTop - y0) * 0.9],
|
|
358
|
+
[0, domeTop],
|
|
359
|
+
],
|
|
360
|
+
});
|
|
361
|
+
// the rims
|
|
362
|
+
pieces.push({ kind: "lathe", material: "steel", segs: 64, outline: false, body: true, rings: [H - 0.05, H - 0.4], profile: [[r - 0.45, H - 0.4], [r, H - 0.4], [r, H], [r - 0.45, H]] });
|
|
363
|
+
for (let i = 0; i < g.struts; i++) {
|
|
364
|
+
const a0 = deg((360 * i) / g.struts);
|
|
365
|
+
const a1 = deg((360 * (i + 0.5)) / g.struts);
|
|
366
|
+
const a2 = deg((360 * (i + 1)) / g.struts);
|
|
367
|
+
const low = (a) => [(r - 0.05) * Math.sin(a), y0, (r - 0.05) * Math.cos(a)];
|
|
368
|
+
const high = (a) => [(r - 0.1) * Math.sin(a), H - 0.4, (r - 0.1) * Math.cos(a)];
|
|
369
|
+
pieces.push(strut("engine-pale", low(a0), high(a1), 0.2, 0.12));
|
|
370
|
+
pieces.push(strut("engine-pale", high(a1), low(a2), 0.2, 0.12));
|
|
371
|
+
}
|
|
372
|
+
// the drawing's picture of them: one zigzag, with the dark gap behind it
|
|
373
|
+
const zig = [];
|
|
374
|
+
for (let i = 0; i <= g.struts; i++) {
|
|
375
|
+
const a = deg((360 * i) / (g.struts * 2)) * 2;
|
|
376
|
+
zig.push([(r - 0.05) * Math.sin(a), y0, (r - 0.05) * Math.cos(a)]);
|
|
377
|
+
const b = a + deg(180 / g.struts);
|
|
378
|
+
zig.push([(r - 0.1) * Math.sin(b), H - 0.4, (r - 0.1) * Math.cos(b)]);
|
|
379
|
+
}
|
|
380
|
+
pieces.push({ kind: "lathe", material: "soot", segs: 40, only: "drawing", body: true, profile: [[r - 0.15, y0], [r - 0.15, H - 0.4]] });
|
|
381
|
+
pieces.push({ kind: "lines", weight: "feature", only: "drawing", paths: [zig] });
|
|
382
|
+
if (g.integrated) {
|
|
383
|
+
// the dark vent tongues under the ring
|
|
384
|
+
for (let i = 0; i < g.struts; i++) {
|
|
385
|
+
const a = deg((360 * i) / g.struts);
|
|
386
|
+
pieces.push({ kind: "plate", material: "soot", frame: radial(a), outline: [[r - 0.15, y0 - 1.6], [r + 0.06, y0 - 1.6], [r + 0.06, y0], [r - 0.15, y0]], thickness: 0.55, plain: true });
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return pieces;
|
|
390
|
+
}
|
|
391
|
+
/** Super Heavy: its base on the axis at the bells' exit. */
|
|
392
|
+
export function boosterPieces(d) {
|
|
393
|
+
const { radius: r, boosterHeight: H, boosterSkirt: skirt, boosterBay: bay } = d;
|
|
394
|
+
const topOfHull = H - d.ring.height;
|
|
395
|
+
const body = {
|
|
396
|
+
kind: "lathe",
|
|
397
|
+
material: "steel",
|
|
398
|
+
segs: 64,
|
|
399
|
+
uv: true,
|
|
400
|
+
body: true,
|
|
401
|
+
outline: true,
|
|
402
|
+
profile: [
|
|
403
|
+
[r - (d.shielded ? 0 : 0.25), skirt],
|
|
404
|
+
[r, skirt + (d.shielded ? 0.001 : 0.7)],
|
|
405
|
+
[r, topOfHull],
|
|
406
|
+
],
|
|
407
|
+
rings: [skirt + (d.shielded ? 1.8 : 0.7), topOfHull - 0.02, topOfHull * 0.62],
|
|
408
|
+
welds: weldsEvery(skirt, topOfHull, 1.83),
|
|
409
|
+
};
|
|
410
|
+
const pieces = [body];
|
|
411
|
+
// the thrust section: dark, under the steel
|
|
412
|
+
pieces.push({
|
|
413
|
+
kind: "lathe",
|
|
414
|
+
material: "soot",
|
|
415
|
+
segs: 48,
|
|
416
|
+
under: true,
|
|
417
|
+
profile: [
|
|
418
|
+
[0, bay],
|
|
419
|
+
[r - 0.3, bay],
|
|
420
|
+
[r - 0.25, skirt],
|
|
421
|
+
],
|
|
422
|
+
rings: [bay],
|
|
423
|
+
});
|
|
424
|
+
if (d.shielded)
|
|
425
|
+
pieces.push({ kind: "lathe", material: "soot", segs: 48, only: "mesh", profile: [[r - 0.05, bay], [r - 0.05, skirt]] });
|
|
426
|
+
else
|
|
427
|
+
pieces.push({ kind: "lathe", material: "dark", segs: 48, under: true, rings: [skirt - 0.5], profile: [[r - 0.6, bay - 0.5], [r - 0.2, bay - 0.5], [r - 0.16, skirt + 0.35]] });
|
|
428
|
+
pieces.push(...engineRings(d.boosterEngines, 0));
|
|
429
|
+
// chines: long flats down the lower hull
|
|
430
|
+
for (const az of d.chines.az) {
|
|
431
|
+
const frame = radial(deg(az));
|
|
432
|
+
pieces.push({
|
|
433
|
+
kind: "plate",
|
|
434
|
+
material: "steel",
|
|
435
|
+
frame,
|
|
436
|
+
outline: [
|
|
437
|
+
[r - 0.1, d.chines.from],
|
|
438
|
+
[r + d.chines.out, d.chines.from + 0.8],
|
|
439
|
+
[r + d.chines.out, d.chines.to - 1],
|
|
440
|
+
[r - 0.1, d.chines.to + 1.2],
|
|
441
|
+
],
|
|
442
|
+
thickness: d.shielded ? 2.4 : 1.6,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
// the raceways
|
|
446
|
+
for (const az of [0, 180])
|
|
447
|
+
pieces.push(strut("engine-metal", pointOf(radial(deg(az)), r + 0.08, skirt + 3), pointOf(radial(deg(az)), r + 0.08, topOfHull - 8), 0.5, 0.2, { plain: false }));
|
|
448
|
+
// the band of vents round the common dome
|
|
449
|
+
pieces.push({ kind: "lathe", material: "engine-pale", segs: 64, only: "mesh", profile: [[r + 0.015, topOfHull * 0.62 - 0.12], [r + 0.015, topOfHull * 0.62 + 0.12]] });
|
|
450
|
+
for (const az of d.fins.az)
|
|
451
|
+
pieces.push(...gridFin(az, d.fins.y, r, d.fins.reach, d.fins.width, d.fins.thick, d.fins.octagon));
|
|
452
|
+
if (d.ring.height > 0)
|
|
453
|
+
pieces.push(...hotStage(d));
|
|
454
|
+
else
|
|
455
|
+
pieces.push({ kind: "lathe", material: "soot", segs: 48, profile: [[r, topOfHull], [0, topOfHull]], only: "mesh" });
|
|
456
|
+
return pieces;
|
|
457
|
+
}
|
|
458
|
+
/** The ship: its base on the axis at the bottom of its skirt. */
|
|
459
|
+
export function shipPieces(d) {
|
|
460
|
+
const { radius: r, shipHeight: H, noseStart } = d;
|
|
461
|
+
const noseH = H - noseStart;
|
|
462
|
+
const nose = [];
|
|
463
|
+
const steps = 16;
|
|
464
|
+
for (let i = 0; i <= steps; i++) {
|
|
465
|
+
// the points gather at the tip, which is round
|
|
466
|
+
const t = 1 - (1 - i / steps) ** 1.8;
|
|
467
|
+
nose.push([r * Math.sqrt(Math.max(0, 1 - t ** 2.15)), noseStart + noseH * t]);
|
|
468
|
+
}
|
|
469
|
+
const profile = [[r, 0], ...nose];
|
|
470
|
+
profile[profile.length - 1] = [0.001, H];
|
|
471
|
+
const welds = weldsEvery(0, noseStart + 3, 1.83);
|
|
472
|
+
const pieces = [...hullWithTiles(profile, d.tile, welds, 72)];
|
|
473
|
+
// the bay under it
|
|
474
|
+
pieces.push({ kind: "lathe", material: "soot", segs: 48, under: true, profile: [[0, 1.3], [r - 0.12, 1.3], [r - 0.12, 0], [r, 0]], rings: [0.02] });
|
|
475
|
+
pieces.push(...engineRings(d.shipEngines, 0.2));
|
|
476
|
+
const surface = (y) => radiusAt(profile, y);
|
|
477
|
+
for (const side of [1, -1]) {
|
|
478
|
+
pieces.push(flap(d.aft, side));
|
|
479
|
+
pieces.push(flap(d.forward, side));
|
|
480
|
+
const aftTop = Math.max(...d.aft.outline.map(([, y]) => y));
|
|
481
|
+
pieces.push(fairing(d.aft.az * side, aftTop - 1, aftTop + 2.8, surface, 0.8));
|
|
482
|
+
const fwdBottom = Math.min(...d.forward.outline.map(([, y]) => y));
|
|
483
|
+
pieces.push(fairing(d.forward.az * side, fwdBottom + 1, fwdBottom - 2.4, surface, 0.6));
|
|
484
|
+
}
|
|
485
|
+
// leeward raceways
|
|
486
|
+
for (const az of [165, -165])
|
|
487
|
+
pieces.push(strut("engine-metal", pointOf(radial(deg(az)), r + 0.05, 8), pointOf(radial(deg(az)), r + 0.05, Math.max(noseStart - 4, 12)), 0.3, 0.14, { plain: false }));
|
|
488
|
+
if (d.door) {
|
|
489
|
+
const az = (a) => [(r + 0.02) * Math.sin(deg(a)), 0, (r + 0.02) * Math.cos(deg(a))];
|
|
490
|
+
const at = (a, y) => [az(a)[0], y, az(a)[2]];
|
|
491
|
+
const path = [];
|
|
492
|
+
for (let a = 145; a <= 215; a += 5)
|
|
493
|
+
path.push(at(a, d.door[0]));
|
|
494
|
+
for (let a = 215; a >= 145; a -= 5)
|
|
495
|
+
path.push(at(a, d.door[1]));
|
|
496
|
+
path.push(at(145, d.door[0]));
|
|
497
|
+
pieces.push({ kind: "lines", weight: "feature", paths: [path] });
|
|
498
|
+
if (d.docking)
|
|
499
|
+
for (const a of [152, 208])
|
|
500
|
+
pieces.push({ kind: "plate", material: "dark", frame: radial(deg(a)), outline: [[r - 0.2, d.door[1] + 1], [r + 0.25, d.door[1] + 1], [r + 0.25, d.door[1] + 2.4], [r - 0.2, d.door[1] + 2.4]], thickness: 1.5 });
|
|
501
|
+
}
|
|
502
|
+
return pieces;
|
|
503
|
+
}
|
package/dist/parts.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CreditId } from "./data/credits.ts";
|
|
2
|
+
import type { Figure } from "./data/types.ts";
|
|
3
|
+
export type PartKind = "booster" | "first-stage" | "ship" | "second-stage" | "fairing" | "capsule" | "trunk" | "engine" | "fin" | "flap" | "ring" | "test-vehicle";
|
|
4
|
+
/** Where a part mates. Every part's origin is the middle of its base on its axis, at its lowest point; Y is up and the windward side faces +Z, in metres. */
|
|
5
|
+
export interface Joint {
|
|
6
|
+
/** What this joint is, so only like meets like: "stage". */
|
|
7
|
+
kind: "stage";
|
|
8
|
+
/** Metres above the part's origin. A second stage's bottom joint is above its nozzle, which nests in what is below. */
|
|
9
|
+
y: number;
|
|
10
|
+
/** Metres across at the joint. */
|
|
11
|
+
diameter: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PartRecord {
|
|
14
|
+
id: string;
|
|
15
|
+
kind: PartKind;
|
|
16
|
+
name: string;
|
|
17
|
+
/** The rocket and the variants it is true for. Empty: it was never part of a flown or announced vehicle. */
|
|
18
|
+
rocket: string;
|
|
19
|
+
trueTo: readonly string[];
|
|
20
|
+
/** Metres, as drawn: equal to the sourced figure wherever there is one. */
|
|
21
|
+
height: number;
|
|
22
|
+
diameter: number;
|
|
23
|
+
/** The sourced figures, blank where no source gives one. */
|
|
24
|
+
sourced: {
|
|
25
|
+
height: Figure;
|
|
26
|
+
diameter: Figure;
|
|
27
|
+
};
|
|
28
|
+
joints: {
|
|
29
|
+
readonly top?: Joint;
|
|
30
|
+
readonly bottom?: Joint;
|
|
31
|
+
};
|
|
32
|
+
/** It stands beside the part below it rather than on top, this far from the rocket's axis: a side booster. */
|
|
33
|
+
strapOn?: {
|
|
34
|
+
x: number;
|
|
35
|
+
z: number;
|
|
36
|
+
};
|
|
37
|
+
/** The painted look's mesh, when a licensed model gives one: its file under assets/models/ and whose it is. Otherwise this package's own code paints it. */
|
|
38
|
+
painted: {
|
|
39
|
+
file: string;
|
|
40
|
+
credit: CreditId;
|
|
41
|
+
} | null;
|
|
42
|
+
/** What a reader should be told about where its shape came from. */
|
|
43
|
+
drawnFrom: string;
|
|
44
|
+
}
|
package/dist/parts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|