@pinkaphant/kolmo 0.4.2 → 0.4.5

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.
Files changed (179) hide show
  1. package/README.md +60 -6
  2. package/bin/kolmo.mjs +455 -15
  3. package/dist/engine/index.d.ts +3 -0
  4. package/dist/engine/index.js +8 -5
  5. package/dist/engine/kolmoActions.js +24 -9
  6. package/dist/engine/kolmoActions.js.map +1 -1
  7. package/dist/engine/kolmoActor.js +19 -31
  8. package/dist/engine/kolmoActor.js.map +1 -1
  9. package/dist/engine/kolmoActorHelpers.d.ts +24 -0
  10. package/dist/engine/kolmoActorHelpers.js +64 -0
  11. package/dist/engine/kolmoActorHelpers.js.map +1 -0
  12. package/dist/engine/kolmoGame.js +4 -1
  13. package/dist/engine/kolmoGame.js.map +1 -1
  14. package/dist/engine/kolmoHud.js +34 -15
  15. package/dist/engine/kolmoHud.js.map +1 -1
  16. package/dist/engine/kolmoInput.d.ts +3 -1
  17. package/dist/engine/kolmoInput.js +18 -12
  18. package/dist/engine/kolmoInput.js.map +1 -1
  19. package/dist/engine/kolmoLongDrive.d.ts +1 -1
  20. package/dist/engine/kolmoLongDrive.js +10 -8
  21. package/dist/engine/kolmoLongDrive.js.map +1 -1
  22. package/dist/engine/kolmoPilotMesh.js +189 -48
  23. package/dist/engine/kolmoPilotMesh.js.map +1 -1
  24. package/dist/engine/kolmoStore.js +4 -0
  25. package/dist/engine/kolmoStore.js.map +1 -0
  26. package/dist/engine/kolmoTouchOverlay.d.ts +21 -0
  27. package/dist/engine/kolmoTouchOverlay.js +326 -0
  28. package/dist/engine/kolmoTouchOverlay.js.map +1 -0
  29. package/dist/engine/kolmoTouchState.d.ts +50 -0
  30. package/dist/engine/kolmoTouchState.js +210 -0
  31. package/dist/engine/kolmoTouchState.js.map +1 -0
  32. package/dist/engine/kolmoVehicle.js +30 -27
  33. package/dist/engine/kolmoVehicle.js.map +1 -1
  34. package/dist/engine/kolmoVehicleAutoCompile.d.ts +10 -0
  35. package/dist/engine/kolmoVehicleAutoCompile.js +78 -0
  36. package/dist/engine/kolmoVehicleAutoCompile.js.map +1 -0
  37. package/dist/engine/kolmoVehicleConfig.d.ts +2 -0
  38. package/dist/engine/kolmoVehicleConfig.js +8 -4
  39. package/dist/engine/kolmoVehicleConfig.js.map +1 -1
  40. package/dist/engine/kolmoVehicleDriver.d.ts +5 -0
  41. package/dist/engine/kolmoVehicleDriver.js +18 -11
  42. package/dist/engine/kolmoVehicleDriver.js.map +1 -1
  43. package/dist/engine/kolmoVehicleInner.js +49 -19
  44. package/dist/engine/kolmoVehicleInner.js.map +1 -1
  45. package/dist/engine/kolmoWorld.js +6 -2
  46. package/dist/engine/kolmoWorld.js.map +1 -1
  47. package/dist/engine/longDriveKit.d.ts +6 -1
  48. package/dist/engine/longDriveKit.js +8 -5
  49. package/dist/engine/longDriveKit.js.map +1 -1
  50. package/dist/engine/macroCellBuilder.d.ts +10 -0
  51. package/dist/engine/macroCellBuilder.js +101 -18
  52. package/dist/engine/macroCellBuilder.js.map +1 -1
  53. package/dist/engine/mainlandMacroCell.js +18 -9
  54. package/dist/engine/mainlandMacroCell.js.map +1 -1
  55. package/dist/importer/DomainWorkshopPanel.d.ts +3 -3
  56. package/dist/importer/DomainWorkshopPanel.js +148 -44
  57. package/dist/importer/DomainWorkshopPanel.js.map +1 -1
  58. package/dist/importer/GateHudBar.d.ts +2 -0
  59. package/dist/importer/GateHudBar.js +113 -35
  60. package/dist/importer/GateHudBar.js.map +1 -1
  61. package/dist/importer/GlbImportGate.js +16 -3
  62. package/dist/importer/GlbImportGate.js.map +1 -1
  63. package/dist/importer/LiveDrivePads.js +5 -3
  64. package/dist/importer/LiveDrivePads.js.map +1 -1
  65. package/dist/importer/Step1CalibrationPlinth.js +3 -3
  66. package/dist/importer/WheelRingHandles3D.js +2 -1
  67. package/dist/importer/WheelRingHandles3D.js.map +1 -1
  68. package/dist/importer/chopShopActions.js +22 -18
  69. package/dist/importer/chopShopActions.js.map +1 -1
  70. package/dist/importer/chopShopHandlers.js +17 -10
  71. package/dist/importer/chopShopHandlers.js.map +1 -1
  72. package/dist/importer/chopShopIoActions.d.ts +2 -0
  73. package/dist/importer/chopShopIoActions.js +33 -2
  74. package/dist/importer/chopShopIoActions.js.map +1 -1
  75. package/dist/importer/cylinderBooleanSlice.js.map +1 -1
  76. package/dist/importer/fusedWheelDetect.d.ts +2 -2
  77. package/dist/importer/fusedWheelDetect.js +227 -106
  78. package/dist/importer/fusedWheelDetect.js.map +1 -1
  79. package/dist/importer/fusedWheelFit.d.ts +6 -0
  80. package/dist/importer/fusedWheelFit.js +82 -1
  81. package/dist/importer/fusedWheelFit.js.map +1 -1
  82. package/dist/importer/gateStore.d.ts +2 -2
  83. package/dist/importer/gateStore.js +4 -3
  84. package/dist/importer/gateStore.js.map +1 -1
  85. package/dist/importer/glbNormalizer.js +5 -0
  86. package/dist/importer/glbNormalizer.js.map +1 -1
  87. package/dist/importer/importerWebMcpTools.js +3 -2
  88. package/dist/importer/importerWebMcpTools.js.map +1 -1
  89. package/dist/importer/index.d.ts +4 -2
  90. package/dist/importer/index.js +16 -12
  91. package/dist/importer/khrCarGeometryMass.d.ts +20 -0
  92. package/dist/importer/khrCarGeometryMass.js +125 -0
  93. package/dist/importer/khrCarGeometryMass.js.map +1 -0
  94. package/dist/importer/khrCarPlanHelpers.js +13 -23
  95. package/dist/importer/khrCarPlanHelpers.js.map +1 -1
  96. package/dist/importer/khrCarPlanner.js +52 -85
  97. package/dist/importer/khrCarPlanner.js.map +1 -1
  98. package/dist/importer/khrCompiler.js +1 -1
  99. package/dist/importer/launcherBake.js +4 -2
  100. package/dist/importer/launcherBake.js.map +1 -1
  101. package/dist/importer/launcherCadGeometry.d.ts +22 -0
  102. package/dist/importer/launcherCadGeometry.js +185 -0
  103. package/dist/importer/launcherCadGeometry.js.map +1 -0
  104. package/dist/importer/proceduralC12AndCraft.d.ts +18 -0
  105. package/dist/importer/proceduralC12AndCraft.js +302 -0
  106. package/dist/importer/proceduralC12AndCraft.js.map +1 -0
  107. package/dist/importer/proceduralDomainBuilders.d.ts +10 -0
  108. package/dist/importer/proceduralDomainBuilders.js +346 -0
  109. package/dist/importer/proceduralDomainBuilders.js.map +1 -0
  110. package/dist/importer/proceduralPersonAndProp.d.ts +8 -0
  111. package/dist/importer/proceduralPersonAndProp.js +303 -0
  112. package/dist/importer/proceduralPersonAndProp.js.map +1 -0
  113. package/dist/importer/starterScene.d.ts +3 -1
  114. package/dist/importer/starterScene.js +76 -13
  115. package/dist/importer/starterScene.js.map +1 -1
  116. package/dist/importer/universalGateBake.js +43 -11
  117. package/dist/importer/universalGateBake.js.map +1 -1
  118. package/dist/importer/useChopShopController.d.ts +3 -1
  119. package/dist/importer/useChopShopController.js +33 -18
  120. package/dist/importer/useChopShopController.js.map +1 -1
  121. package/dist/importer/useChopShopState.d.ts +1 -1
  122. package/dist/importer/useChopShopState.js +35 -9
  123. package/dist/importer/useChopShopState.js.map +1 -1
  124. package/dist/importer/wheelCutterHelpers.d.ts +7 -4
  125. package/dist/importer/wheelCutterHelpers.js +58 -28
  126. package/dist/importer/wheelCutterHelpers.js.map +1 -1
  127. package/dist/index.d.ts +4 -0
  128. package/dist/index.js +34 -20
  129. package/dist/junk/DestructibleTarget.js +9 -3
  130. package/dist/junk/DestructibleTarget.js.map +1 -1
  131. package/dist/junk/ShardPieces.js +10 -2
  132. package/dist/junk/ShardPieces.js.map +1 -1
  133. package/dist/junk/index.d.ts +1 -0
  134. package/dist/junk/index.js +2 -1
  135. package/dist/junk/junkProceduralScenes.d.ts +12 -0
  136. package/dist/junk/junkProceduralScenes.js +220 -0
  137. package/dist/junk/junkProceduralScenes.js.map +1 -0
  138. package/dist/junk/junkTypes.js +0 -0
  139. package/dist/junk/junkTypes.js.map +1 -0
  140. package/dist/sand3d/KolmoSand3D.d.ts +19 -0
  141. package/dist/sand3d/KolmoSand3D.js +92 -0
  142. package/dist/sand3d/KolmoSand3D.js.map +1 -0
  143. package/dist/sand3d/Sand3dWorkshopSection.d.ts +8 -0
  144. package/dist/sand3d/Sand3dWorkshopSection.js +117 -0
  145. package/dist/sand3d/Sand3dWorkshopSection.js.map +1 -0
  146. package/dist/sand3d/gateBakeHelpers.d.ts +21 -0
  147. package/dist/sand3d/gateBakeHelpers.js +225 -0
  148. package/dist/sand3d/gateBakeHelpers.js.map +1 -0
  149. package/dist/sand3d/gateDoorwayBake.d.ts +12 -0
  150. package/dist/sand3d/gateDoorwayBake.js +203 -0
  151. package/dist/sand3d/gateDoorwayBake.js.map +1 -0
  152. package/dist/sand3d/index.d.ts +3 -0
  153. package/dist/sand3d/index.js +4 -0
  154. package/dist/sand3d/index.js.map +1 -0
  155. package/dist/sand3d/sand3dAssetLoader.d.ts +28 -0
  156. package/dist/sand3d/sand3dAssetLoader.js +177 -0
  157. package/dist/sand3d/sand3dAssetLoader.js.map +1 -0
  158. package/dist/suika/KolmoSuikaOrb.d.ts +33 -0
  159. package/dist/suika/KolmoSuikaOrb.js +375 -0
  160. package/dist/suika/KolmoSuikaOrb.js.map +1 -0
  161. package/dist/suika/index.d.ts +4 -0
  162. package/dist/suika/index.js +5 -0
  163. package/dist/suika/index.js.map +1 -0
  164. package/dist/suika/suikaArbiter.d.ts +60 -0
  165. package/dist/suika/suikaArbiter.js +265 -0
  166. package/dist/suika/suikaArbiter.js.map +1 -0
  167. package/dist/suika/suikaGeometry.d.ts +10 -0
  168. package/dist/suika/suikaGeometry.js +251 -0
  169. package/dist/suika/suikaGeometry.js.map +1 -0
  170. package/dist/suika/suikaTypes.d.ts +74 -0
  171. package/dist/suika/suikaTypes.js +196 -0
  172. package/dist/suika/suikaTypes.js.map +1 -0
  173. package/dist/world/index.d.ts +1 -1
  174. package/dist/world/index.js +2 -2
  175. package/dist/world/worldTypes.d.ts +4 -0
  176. package/dist/world/worldTypes.js +21 -1
  177. package/dist/world/worldTypes.js.map +1 -1
  178. package/docs/api-reference.md +82 -124
  179. package/package.json +16 -7
@@ -0,0 +1,185 @@
1
+ import * as THREE from "three";
2
+ // src/importer/launcherCadGeometry.ts
3
+ function finalizeCadGeometry(geo) {
4
+ const nonIdx = geo.index ? geo.toNonIndexed() : geo;
5
+ if (nonIdx !== geo) geo.dispose();
6
+ nonIdx.computeVertexNormals();
7
+ nonIdx.computeBoundingBox();
8
+ nonIdx.computeBoundingSphere();
9
+ return nonIdx;
10
+ }
11
+ /**
12
+ * Extrudes a 2D YZ side profile ([z, y]) along X centered on X = 0 with crisp faceted normals.
13
+ */
14
+ function extrudeCadSideProfile(pointsZY, widthX, holesZY = []) {
15
+ const shape = new THREE.Shape();
16
+ pointsZY.forEach(([z, y], idx) => idx === 0 ? shape.moveTo(z, y) : shape.lineTo(z, y));
17
+ shape.closePath();
18
+ for (const holePts of holesZY) {
19
+ if (holePts.length < 3) continue;
20
+ const hole = new THREE.Path();
21
+ holePts.forEach(([z, y], idx) => idx === 0 ? hole.moveTo(z, y) : hole.lineTo(z, y));
22
+ hole.closePath();
23
+ shape.holes.push(hole);
24
+ }
25
+ const depth = Math.max(.001, widthX);
26
+ const geo = new THREE.ExtrudeGeometry(shape, {
27
+ depth,
28
+ steps: 1,
29
+ curveSegments: 4,
30
+ bevelEnabled: false
31
+ });
32
+ geo.translate(0, 0, -depth * .5);
33
+ geo.rotateY(-Math.PI / 2);
34
+ return finalizeCadGeometry(geo);
35
+ }
36
+ /**
37
+ * Extrudes a 2D XY cross-section along Z centered on Z = 0.
38
+ */
39
+ function extrudeCadFrontProfile(pointsXY, lengthZ) {
40
+ const shape = new THREE.Shape();
41
+ pointsXY.forEach(([x, y], idx) => idx === 0 ? shape.moveTo(x, y) : shape.lineTo(x, y));
42
+ shape.closePath();
43
+ const depth = Math.max(.001, lengthZ);
44
+ const geo = new THREE.ExtrudeGeometry(shape, {
45
+ depth,
46
+ steps: 1,
47
+ curveSegments: 4,
48
+ bevelEnabled: false
49
+ });
50
+ geo.translate(0, 0, -depth * .5);
51
+ return finalizeCadGeometry(geo);
52
+ }
53
+ /**
54
+ * Builds a genuinely HOLLOW faceted octagonal tube (outer wall + front crown + inner bore + rear face)
55
+ * aligned along +Z centered on Z = 0 (`8` radial segments = 64 crisp triangles total).
56
+ */
57
+ function buildHollowBoreTubeZ(outerRadius, innerRadius, lengthZ, radialSegments = 8) {
58
+ const segs = Math.min(12, Math.max(6, radialSegments));
59
+ const or = Math.max(.002, outerRadius);
60
+ const ir = Math.min(Math.max(8e-4, innerRadius), or - 8e-4);
61
+ const hz = Math.max(.002, lengthZ * .5);
62
+ const pts = [
63
+ [ir, -hz],
64
+ [or, -hz],
65
+ [or, hz],
66
+ [ir, hz],
67
+ [ir, -hz]
68
+ ];
69
+ const geo = new THREE.LatheGeometry(pts.map(([r, z]) => new THREE.Vector2(r, z)), segs);
70
+ geo.rotateX(Math.PI / 2);
71
+ return finalizeCadGeometry(geo);
72
+ }
73
+ /**
74
+ * Outward-facing faceted LatheGeometry aligned along +Z centered on Z = 0.
75
+ */
76
+ function buildCadLatheZ(pointsRZ, radialSegments = 8) {
77
+ const vecs = pointsRZ.map(([r, z]) => new THREE.Vector2(Math.max(1e-4, r), z));
78
+ const geo = new THREE.LatheGeometry(vecs, radialSegments);
79
+ geo.rotateX(Math.PI / 2);
80
+ return finalizeCadGeometry(geo);
81
+ }
82
+ /**
83
+ * Builds a role-specific CAD BufferGeometry sized to `[sx, sy, sz]` (derived from threejs-khr-armory's CAD kernel).
84
+ */
85
+ function buildLauncherPartCadGeometry(role, size, recipeId = "") {
86
+ const [sx, sy, sz] = size;
87
+ const hx = sx * .5;
88
+ const hy = sy * .5;
89
+ const hz = sz * .5;
90
+ if (role === "barrel") {
91
+ const outerR = Math.max(sx, sy) * .5;
92
+ if (recipeId.includes("rpg")) return buildCadLatheZ([
93
+ [outerR * .78, -hz],
94
+ [outerR * 1.15, -hz],
95
+ [outerR * .85, -hz * .55],
96
+ [outerR, -hz * .2],
97
+ [outerR, hz * .85],
98
+ [outerR * 1.18, hz],
99
+ [outerR * .74, hz],
100
+ [outerR * .74, -hz]
101
+ ], 8);
102
+ return buildHollowBoreTubeZ(outerR, outerR * .62, sz, 8);
103
+ }
104
+ if (role === "pump") {
105
+ const rMax = Math.max(sx, sy) * .5;
106
+ const rEnd = rMax * .62;
107
+ return buildCadLatheZ([
108
+ [rEnd, -hz],
109
+ [rMax, -hz * .82],
110
+ [rMax, hz * .82],
111
+ [rEnd, hz]
112
+ ], 8);
113
+ }
114
+ if (role === "bolt") {
115
+ const wall = Math.max(.0025, sx * .22);
116
+ const roof = Math.max(.003, sy * .28);
117
+ return extrudeCadFrontProfile([
118
+ [-hx, -hy],
119
+ [-hx + wall, -hy],
120
+ [-hx + wall, hy - roof],
121
+ [hx - wall, hy - roof],
122
+ [hx - wall, -hy],
123
+ [hx, -hy],
124
+ [hx, hy * .68],
125
+ [hx * .72, hy],
126
+ [-hx * .72, hy],
127
+ [-hx, hy * .68]
128
+ ], sz);
129
+ }
130
+ if (role === "trigger") return extrudeCadSideProfile([
131
+ [-hz * .35, hy],
132
+ [hz * .45, hy],
133
+ [hz * .2, 0],
134
+ [hz * .55, -hy * .78],
135
+ [hz * .15, -hy],
136
+ [-hz * .45, -hy * .62],
137
+ [-hz * .2, 0]
138
+ ], sx);
139
+ if (role === "magazine") {
140
+ const rake = sz * .22;
141
+ return extrudeCadSideProfile([
142
+ [-hz + rake, -hy],
143
+ [hz + rake, -hy],
144
+ [hz, hy],
145
+ [-hz, hy]
146
+ ], sx);
147
+ }
148
+ if (role === "stock") return extrudeCadSideProfile([
149
+ [hz, hy * .62],
150
+ [hz, -hy * .18],
151
+ [hz * .75, -hy * .36],
152
+ [-hz, -hy],
153
+ [-hz, hy * .28],
154
+ [-hz * .15, hy * .46]
155
+ ], sx);
156
+ if (role === "screen_rect") return extrudeCadFrontProfile([
157
+ [-hx, -hy],
158
+ [hx, -hy],
159
+ [hx, hy],
160
+ [-hx, hy]
161
+ ], sz);
162
+ const guardHole = [
163
+ [-hz * .08, -hy * .82],
164
+ [hz * .28, -hy * .82],
165
+ [hz * .24, -hy * .32],
166
+ [-hz * .08, -hy * .32]
167
+ ];
168
+ return extrudeCadSideProfile([
169
+ [-hz, -hy * .25],
170
+ [-hz * .82, -hy],
171
+ [-hz * .36, -hy],
172
+ [-hz * .18, -hy * .35],
173
+ [-hz * .12, -hy * .92],
174
+ [hz * .34, -hy * .92],
175
+ [hz * .42, -hy * .28],
176
+ [hz, -hy * .28],
177
+ [hz, hy * .74],
178
+ [hz * .88, hy],
179
+ [-hz * .86, hy],
180
+ [-hz, hy * .65]
181
+ ], sx, [guardHole]);
182
+ }
183
+ export { buildCadLatheZ, buildHollowBoreTubeZ, buildLauncherPartCadGeometry, extrudeCadFrontProfile, extrudeCadSideProfile };
184
+
185
+ //# sourceMappingURL=launcherCadGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcherCadGeometry.js","names":[],"sources":["../../src/importer/launcherCadGeometry.ts"],"sourcesContent":["import * as THREE from \"three\";\n\nfunction finalizeCadGeometry(geo: THREE.BufferGeometry): THREE.BufferGeometry {\n const nonIdx = geo.index ? geo.toNonIndexed() : geo;\n if (nonIdx !== geo) geo.dispose();\n nonIdx.computeVertexNormals();\n nonIdx.computeBoundingBox();\n nonIdx.computeBoundingSphere();\n return nonIdx;\n}\n\n/**\n * Extrudes a 2D YZ side profile ([z, y]) along X centered on X = 0 with crisp faceted normals.\n */\nexport function extrudeCadSideProfile(\n pointsZY: readonly [number, number][],\n widthX: number,\n holesZY: readonly (readonly [number, number][])[] = [],\n): THREE.BufferGeometry {\n const shape = new THREE.Shape();\n pointsZY.forEach(([z, y], idx) => (idx === 0 ? shape.moveTo(z, y) : shape.lineTo(z, y)));\n shape.closePath();\n\n for (const holePts of holesZY) {\n if (holePts.length < 3) continue;\n const hole = new THREE.Path();\n holePts.forEach(([z, y], idx) => (idx === 0 ? hole.moveTo(z, y) : hole.lineTo(z, y)));\n hole.closePath();\n shape.holes.push(hole);\n }\n\n const depth = Math.max(0.001, widthX);\n const geo = new THREE.ExtrudeGeometry(shape, { depth, steps: 1, curveSegments: 4, bevelEnabled: false });\n geo.translate(0, 0, -depth * 0.5);\n geo.rotateY(-Math.PI / 2);\n return finalizeCadGeometry(geo);\n}\n\n/**\n * Extrudes a 2D XY cross-section along Z centered on Z = 0.\n */\nexport function extrudeCadFrontProfile(\n pointsXY: readonly [number, number][],\n lengthZ: number,\n): THREE.BufferGeometry {\n const shape = new THREE.Shape();\n pointsXY.forEach(([x, y], idx) => (idx === 0 ? shape.moveTo(x, y) : shape.lineTo(x, y)));\n shape.closePath();\n const depth = Math.max(0.001, lengthZ);\n const geo = new THREE.ExtrudeGeometry(shape, { depth, steps: 1, curveSegments: 4, bevelEnabled: false });\n geo.translate(0, 0, -depth * 0.5);\n return finalizeCadGeometry(geo);\n}\n\n/**\n * Builds a genuinely HOLLOW faceted octagonal tube (outer wall + front crown + inner bore + rear face)\n * aligned along +Z centered on Z = 0 (`8` radial segments = 64 crisp triangles total).\n */\nexport function buildHollowBoreTubeZ(\n outerRadius: number,\n innerRadius: number,\n lengthZ: number,\n radialSegments = 8,\n): THREE.BufferGeometry {\n const segs = Math.min(12, Math.max(6, radialSegments));\n const or = Math.max(0.002, outerRadius);\n const ir = Math.min(Math.max(0.0008, innerRadius), or - 0.0008);\n const hz = Math.max(0.002, lengthZ * 0.5);\n const pts: [number, number][] = [\n [ir, -hz],\n [or, -hz],\n [or, hz],\n [ir, hz],\n [ir, -hz],\n ];\n const geo = new THREE.LatheGeometry(pts.map(([r, z]) => new THREE.Vector2(r, z)), segs);\n geo.rotateX(Math.PI / 2);\n return finalizeCadGeometry(geo);\n}\n\n/**\n * Outward-facing faceted LatheGeometry aligned along +Z centered on Z = 0.\n */\nexport function buildCadLatheZ(\n pointsRZ: readonly [number, number][],\n radialSegments = 8,\n): THREE.BufferGeometry {\n const vecs = pointsRZ.map(([r, z]) => new THREE.Vector2(Math.max(0.0001, r), z));\n const geo = new THREE.LatheGeometry(vecs, radialSegments);\n geo.rotateX(Math.PI / 2);\n return finalizeCadGeometry(geo);\n}\n\n/**\n * Builds a role-specific CAD BufferGeometry sized to `[sx, sy, sz]` (derived from threejs-khr-armory's CAD kernel).\n */\nexport function buildLauncherPartCadGeometry(\n role: string,\n size: readonly [number, number, number],\n recipeId = \"\",\n): THREE.BufferGeometry {\n const [sx, sy, sz] = size;\n const hx = sx * 0.5;\n const hy = sy * 0.5;\n const hz = sz * 0.5;\n\n if (role === \"barrel\") {\n const outerR = Math.max(sx, sy) * 0.5;\n if (recipeId.includes(\"rpg\")) {\n return buildCadLatheZ(\n [\n [outerR * 0.78, -hz], [outerR * 1.15, -hz], [outerR * 0.85, -hz * 0.55], [outerR, -hz * 0.2],\n [outerR, hz * 0.85], [outerR * 1.18, hz], [outerR * 0.74, hz], [outerR * 0.74, -hz],\n ],\n 8,\n );\n }\n return buildHollowBoreTubeZ(outerR, outerR * 0.62, sz, 8);\n }\n\n if (role === \"pump\") {\n const rMax = Math.max(sx, sy) * 0.5;\n const rEnd = rMax * 0.62;\n return buildCadLatheZ([[rEnd, -hz], [rMax, -hz * 0.82], [rMax, hz * 0.82], [rEnd, hz]], 8);\n }\n\n if (role === \"bolt\") {\n const wall = Math.max(0.0025, sx * 0.22);\n const roof = Math.max(0.003, sy * 0.28);\n return extrudeCadFrontProfile(\n [\n [-hx, -hy], [-hx + wall, -hy], [-hx + wall, hy - roof], [hx - wall, hy - roof], [hx - wall, -hy],\n [hx, -hy], [hx, hy * 0.68], [hx * 0.72, hy], [-hx * 0.72, hy], [-hx, hy * 0.68],\n ],\n sz,\n );\n }\n\n if (role === \"trigger\") {\n return extrudeCadSideProfile(\n [\n [-hz * 0.35, hy], [hz * 0.45, hy], [hz * 0.2, 0], [hz * 0.55, -hy * 0.78],\n [hz * 0.15, -hy], [-hz * 0.45, -hy * 0.62], [-hz * 0.2, 0],\n ],\n sx,\n );\n }\n\n if (role === \"magazine\") {\n const rake = sz * 0.22;\n return extrudeCadSideProfile([[-hz + rake, -hy], [hz + rake, -hy], [hz, hy], [-hz, hy]], sx);\n }\n\n if (role === \"stock\") {\n return extrudeCadSideProfile(\n [\n [hz, hy * 0.62], [hz, -hy * 0.18], [hz * 0.75, -hy * 0.36],\n [-hz, -hy], [-hz, hy * 0.28], [-hz * 0.15, hy * 0.46],\n ],\n sx,\n );\n }\n\n if (role === \"screen_rect\") {\n return extrudeCadFrontProfile([[-hx, -hy], [hx, -hy], [hx, hy], [-hx, hy]], sz);\n }\n\n // Default `receiver`: monolithic receiver silhouette with integral trigger guard window & raked grip tang\n const guardHole: [number, number][] = [\n [-hz * 0.08, -hy * 0.82], [hz * 0.28, -hy * 0.82], [hz * 0.24, -hy * 0.32], [-hz * 0.08, -hy * 0.32],\n ];\n return extrudeCadSideProfile(\n [\n [-hz, -hy * 0.25], [-hz * 0.82, -hy], [-hz * 0.36, -hy], [-hz * 0.18, -hy * 0.35],\n [-hz * 0.12, -hy * 0.92], [hz * 0.34, -hy * 0.92], [hz * 0.42, -hy * 0.28], [hz, -hy * 0.28],\n [hz, hy * 0.74], [hz * 0.88, hy], [-hz * 0.86, hy], [-hz, hy * 0.65],\n ],\n sx,\n [guardHole],\n );\n}\n"],"mappings":";;AAEA,SAAS,oBAAoB,KAAiD;CAC1E,MAAM,SAAS,IAAI,QAAQ,IAAI,aAAa,IAAI;CAChD,IAAI,WAAW,KAAK,IAAI,QAAQ;CAChC,OAAO,qBAAqB;CAC5B,OAAO,mBAAmB;CAC1B,OAAO,sBAAsB;CAC7B,OAAO;AACX;;;;AAKA,SAAgB,sBACZ,UACA,QACA,UAAoD,CAAC,GACjC;CACpB,MAAM,QAAQ,IAAI,MAAM,MAAM;CAC9B,SAAS,SAAS,CAAC,GAAG,IAAI,QAAS,QAAQ,IAAI,MAAM,OAAO,GAAG,CAAC,IAAI,MAAM,OAAO,GAAG,CAAC,CAAE;CACvF,MAAM,UAAU;CAEhB,KAAK,MAAM,WAAW,SAAS;EAC3B,IAAI,QAAQ,SAAS,GAAG;EACxB,MAAM,O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@ -0,0 +1,18 @@
1
+ import * as THREE from "three";
2
+ import { type KolmoNodeExtension, type KolmoSocketRole } from "../schema/kolmoSchema.js";
3
+ export interface ProceduralRecipeSpec<TId extends string = string> {
4
+ readonly id: TId;
5
+ readonly label: string;
6
+ readonly domain: "c12" | "craft" | "person" | "prop" | "junk";
7
+ readonly targetMeters: number;
8
+ readonly massKg: number;
9
+ readonly powerOrThrust?: number;
10
+ readonly color: string;
11
+ }
12
+ export type C12ProceduralRecipeId = "c12_doorway_wall" | "c12_window_wall" | "c12_floor_corbel" | "c12_stair_flight" | "c12_gable_roof" | "c12_hex_wing";
13
+ export declare const C12_PROCEDURAL_RECIPES: readonly ProceduralRecipeSpec<C12ProceduralRecipeId>[];
14
+ export declare function makeFlatMat(color: string, roughness?: number, metalness?: number, emissive?: string): THREE.MeshStandardMaterial;
15
+ export declare function addPartBox(p: THREE.Object3D, name: string, sx: number, sy: number, sz: number, x: number, y: number, z: number, mat: THREE.Material): THREE.Mesh;
16
+ export declare function addKolmoSocket(parent: THREE.Object3D, name: string, pos: [number, number, number], role: KolmoSocketRole, emitter?: Omit<KolmoNodeExtension, "socket">, rotEuler?: [number, number, number]): THREE.Object3D;
17
+ export declare function buildDoorLeafMesh(w: number, h: number, t: number, leafHex: number, handleHex: number): THREE.Mesh;
18
+ export declare function buildProceduralC12Scene(recipeOrId?: C12ProceduralRecipeId | ProceduralRecipeSpec | string): THREE.Group;
@@ -0,0 +1,302 @@
1
+ import { KOLMO_EXTENSION_NAME } from "../schema/kolmoTypes.js";
2
+ import * as THREE from "three";
3
+ import { DOOR_HINGE_SPEC } from "@khr3/c12";
4
+ // src/importer/proceduralC12AndCraft.ts
5
+ var C12_PROCEDURAL_RECIPES = Object.freeze([
6
+ {
7
+ id: "c12_doorway_wall",
8
+ label: "Doorway Wall",
9
+ domain: "c12",
10
+ targetMeters: 3,
11
+ massKg: 0,
12
+ color: "#94a3b8"
13
+ },
14
+ {
15
+ id: "c12_window_wall",
16
+ label: "Window Wall",
17
+ domain: "c12",
18
+ targetMeters: 3,
19
+ massKg: 0,
20
+ color: "#38bdf8"
21
+ },
22
+ {
23
+ id: "c12_floor_corbel",
24
+ label: "Floor Corbel",
25
+ domain: "c12",
26
+ targetMeters: 3,
27
+ massKg: 0,
28
+ color: "#64748b"
29
+ },
30
+ {
31
+ id: "c12_stair_flight",
32
+ label: "Stair Flight",
33
+ domain: "c12",
34
+ targetMeters: 3,
35
+ massKg: 0,
36
+ color: "#f59e0b"
37
+ },
38
+ {
39
+ id: "c12_gable_roof",
40
+ label: "Gable Roof",
41
+ domain: "c12",
42
+ targetMeters: 3,
43
+ massKg: 0,
44
+ color: "#b45309"
45
+ },
46
+ {
47
+ id: "c12_hex_wing",
48
+ label: "C12 Hex Wing",
49
+ domain: "c12",
50
+ targetMeters: 3,
51
+ massKg: 0,
52
+ color: "#10b981"
53
+ }
54
+ ]);
55
+ function makeFlatMat(color, roughness = .55, metalness = .18, emissive) {
56
+ return new THREE.MeshStandardMaterial({
57
+ color,
58
+ roughness,
59
+ metalness,
60
+ flatShading: true,
61
+ ...emissive ? {
62
+ emissive,
63
+ emissiveIntensity: .85
64
+ } : {}
65
+ });
66
+ }
67
+ function addPartBox(p, name, sx, sy, sz, x, y, z, mat) {
68
+ const m = new THREE.Mesh(new THREE.BoxGeometry(sx, sy, sz), mat);
69
+ m.name = name;
70
+ m.position.set(x, y, z);
71
+ p.add(m);
72
+ return m;
73
+ }
74
+ function addKolmoSocket(parent, name, pos, role, emitter, rotEuler) {
75
+ const node = new THREE.Object3D();
76
+ node.name = name;
77
+ node.position.set(pos[0], pos[1], pos[2]);
78
+ if (rotEuler) node.rotation.set(rotEuler[0], rotEuler[1], rotEuler[2]);
79
+ const ext = {
80
+ ...emitter ?? {},
81
+ socket: role
82
+ };
83
+ node.userData = {
84
+ kolmoSocket: role,
85
+ socket: role,
86
+ [KOLMO_EXTENSION_NAME]: ext,
87
+ kolmoExtension: ext
88
+ };
89
+ parent.add(node);
90
+ return node;
91
+ }
92
+ function buildDoorLeafMesh(w, h, t, leafHex, handleHex) {
93
+ const pos = [], norm = [], col = [];
94
+ const c = new THREE.Color();
95
+ const pushBox = (sx, sy, sz, ox, oy, oz, hex) => {
96
+ const raw = new THREE.BoxGeometry(sx, sy, sz);
97
+ const g = raw.index ? raw.toNonIndexed() : raw;
98
+ if (raw.index) raw.dispose();
99
+ const pa = g.getAttribute("position"), na = g.getAttribute("normal");
100
+ c.setHex(hex);
101
+ for (let i = 0; i < pa.count; i++) {
102
+ pos.push(pa.getX(i) + ox, pa.getY(i) + oy, pa.getZ(i) + oz);
103
+ norm.push(na.getX(i), na.getY(i), na.getZ(i));
104
+ col.push(c.r, c.g, c.b);
105
+ }
106
+ g.dispose();
107
+ };
108
+ pushBox(w, h, t, w * .5 + .005, h * .5 + .01, 0, leafHex);
109
+ pushBox(w * .7, h * .34, t + .014, w * .5 + .005, h * .72, 0, leafHex - 789516);
110
+ pushBox(w * .7, h * .32, t + .014, w * .5 + .005, h * .27, 0, leafHex - 789516);
111
+ pushBox(.03, .14, t + .04, w - .09, h * .48, 0, handleHex);
112
+ pushBox(.11, .024, t + .08, w - .12, h * .48, 0, handleHex);
113
+ const geo = new THREE.BufferGeometry();
114
+ geo.setAttribute("position", new THREE.Float32BufferAttribute(pos, 3));
115
+ geo.setAttribute("normal", new THREE.Float32BufferAttribute(norm, 3));
116
+ geo.setAttribute("color", new THREE.Float32BufferAttribute(col, 3));
117
+ geo.computeBoundingBox();
118
+ geo.computeBoundingSphere();
119
+ const leaf = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({
120
+ vertexColors: true,
121
+ roughness: .48,
122
+ metalness: .22,
123
+ flatShading: true
124
+ }));
125
+ leaf.name = "DoorLeaf";
126
+ return leaf;
127
+ }
128
+ function addC12CornerFooters(group, mat) {
129
+ const h = 1 / 12, w = .25;
130
+ for (const [tag, sx] of [["L", -1], ["R", 1]]) for (const [zTag, sz] of [["F", 1], ["B", -1]]) addPartBox(group, `LatticeFooter_${tag}_${zTag}`, w, h, w, sx * (1.5 - w * .5), h * .5, sz * (1.5 - w * .5), mat);
131
+ }
132
+ function buildProceduralC12Scene(recipeOrId = "c12_doorway_wall") {
133
+ const id = typeof recipeOrId === "string" ? recipeOrId : recipeOrId.id;
134
+ const root = new THREE.Group();
135
+ root.name = id;
136
+ const wallMat = makeFlatMat("#94a3b8", .68, .12);
137
+ const trimMat = makeFlatMat("#334155", .52, .28);
138
+ const woodMat = makeFlatMat("#b45309", .62, .1);
139
+ const T = .25;
140
+ if (id === "c12_window_wall") {
141
+ addC12CornerFooters(root, trimMat);
142
+ addPartBox(root, "WallSill", 3, .9, T, 0, .45, 0, wallMat);
143
+ addPartBox(root, "WallHeader", 3, .75, T, 0, 2.625, 0, wallMat);
144
+ addPartBox(root, "WallPier_L", .6, 1.35, T, -1.2, 1.575, 0, wallMat);
145
+ addPartBox(root, "WallPier_R", .6, 1.35, T, 1.2, 1.575, 0, wallMat);
146
+ addPartBox(root, "WindowLedge", 1.88, .06, .33, 0, .91, 0, trimMat);
147
+ addPartBox(root, "MullionV", .06, 1.35, .08, 0, 1.575, 0, trimMat);
148
+ addPartBox(root, "MullionH", 1.8, .06, .08, 0, 1.575, 0, trimMat);
149
+ const glassMat = new THREE.MeshStandardMaterial({
150
+ color: "#7dd3fc",
151
+ transparent: true,
152
+ opacity: .36,
153
+ roughness: .1,
154
+ flatShading: true
155
+ });
156
+ for (const [gi, gx, gy] of [
157
+ [
158
+ 0,
159
+ -.45,
160
+ 1.24
161
+ ],
162
+ [
163
+ 1,
164
+ .45,
165
+ 1.24
166
+ ],
167
+ [
168
+ 2,
169
+ -.45,
170
+ 1.91
171
+ ],
172
+ [
173
+ 3,
174
+ .45,
175
+ 1.91
176
+ ]
177
+ ]) addPartBox(root, `WindowPane_${gi}`, .84, .6, .025, gx, gy, 0, glassMat);
178
+ addKolmoSocket(root, "Aperture_Window", [
179
+ 0,
180
+ 1.575,
181
+ 0
182
+ ], "mount");
183
+ } else if (id === "c12_floor_corbel") {
184
+ addPartBox(root, "DeckSlab", 3, 1 / 12, 3, 0, .25 - 1 / 24, 0, wallMat);
185
+ for (const [pos, idx] of [
186
+ [-1.375, 0],
187
+ [-.45, 1],
188
+ [.45, 2],
189
+ [1.375, 3]
190
+ ]) {
191
+ addPartBox(root, `CorbelRibX_${idx}`, .25, 2 / 12, 3, pos, 1 / 12, 0, trimMat);
192
+ addPartBox(root, `CorbelRibZ_${idx}`, 2.5, 2 / 12, .22, 0, 1 / 12, pos, trimMat);
193
+ }
194
+ } else if (id === "c12_stair_flight") {
195
+ const steps = 10, sw = 1.5, stepH = 3 / steps, stepD = 3 / steps;
196
+ for (let i = 0; i < steps; i++) {
197
+ const h = (i + 1) * stepH * .28 + .08, yTop = (i + 1) * stepH, z = -1.5 + (i + .5) * stepD;
198
+ addPartBox(root, `StairTread_${i}`, 1.3599999999999999, h, stepD, 0, yTop - h * .5, z, woodMat);
199
+ }
200
+ addPartBox(root, "LandingBase", sw, 1 / 12, .3, 0, 1 / 24, -1.35, trimMat);
201
+ for (const [tag, sx] of [["L", -1], ["R", 1]]) {
202
+ const str = addPartBox(root, `StairStringer_${tag}`, .06, .16, 3.6, sx * (sw * .5 - .03), 1.42, 0, trimMat);
203
+ str.rotation.x = -Math.PI * .25;
204
+ const rail = addPartBox(root, `StairHandrail_${tag}`, .05, .05, 2.8, sx * (sw * .5 - .03), 1.96, -.12, woodMat);
205
+ rail.rotation.x = -.62;
206
+ addPartBox(root, `NewelLow_${tag}`, .06, 1.05, .06, sx * (sw * .5 - .03), .525, -1.44, trimMat);
207
+ addPartBox(root, `NewelHigh_${tag}`, .06, .6, .06, sx * (sw * .5 - .03), 2.7, 1.44, trimMat);
208
+ }
209
+ } else if (id === "c12_gable_roof") {
210
+ addPartBox(root, "EaveBeam_L", .18, 1 / 6, 3, -1.41, 1 / 12, 0, trimMat);
211
+ addPartBox(root, "EaveBeam_R", .18, 1 / 6, 3, 1.41, 1 / 12, 0, trimMat);
212
+ addPartBox(root, "RidgeBeam", .18, .18, 3, 0, 1.41, 0, trimMat);
213
+ const slopeL = addPartBox(root, "RoofSlope_L", 1.92, .1, 3, -.74, .78, 0, woodMat);
214
+ slopeL.rotation.z = .72;
215
+ const slopeR = addPartBox(root, "RoofSlope_R", 1.92, .1, 3, .74, .78, 0, woodMat);
216
+ slopeR.rotation.z = -.72;
217
+ for (const [tag, z] of [["Front", 1.42], ["Back", -1.42]]) {
218
+ const tri = new THREE.Shape([
219
+ new THREE.Vector2(-1.38, .12),
220
+ new THREE.Vector2(1.38, .12),
221
+ new THREE.Vector2(0, 1.38)
222
+ ]);
223
+ const raw = new THREE.ExtrudeGeometry(tri, {
224
+ depth: .12,
225
+ bevelEnabled: false
226
+ });
227
+ const g = raw.index ? raw.toNonIndexed() : raw;
228
+ if (raw.index) raw.dispose();
229
+ g.translate(0, 0, z - .06);
230
+ g.computeVertexNormals();
231
+ const m = new THREE.Mesh(g, wallMat);
232
+ m.name = `GablePediment_${tag}`;
233
+ root.add(m);
234
+ }
235
+ } else if (id === "c12_hex_wing") {
236
+ addC12CornerFooters(root, trimMat);
237
+ const wedge = new THREE.Shape([
238
+ new THREE.Vector2(-1.5, -1.25),
239
+ new THREE.Vector2(1.5, -1.25),
240
+ new THREE.Vector2(0, 1.35)
241
+ ]);
242
+ const raw = new THREE.ExtrudeGeometry(wedge, {
243
+ depth: .16,
244
+ bevelEnabled: false
245
+ });
246
+ const deckGeo = raw.index ? raw.toNonIndexed() : raw;
247
+ if (raw.index) raw.dispose();
248
+ deckGeo.rotateX(Math.PI * .5);
249
+ deckGeo.translate(0, .16, 0);
250
+ deckGeo.computeVertexNormals();
251
+ const deck = new THREE.Mesh(deckGeo, trimMat);
252
+ deck.name = "HexFloorWedge";
253
+ const cap = new THREE.Mesh(deckGeo.clone(), trimMat);
254
+ cap.name = "HexCeilingWedge";
255
+ cap.position.y = 2.84;
256
+ root.add(deck, cap);
257
+ for (const [tag, sx, yaw] of [[
258
+ "L",
259
+ -.72,
260
+ .5236
261
+ ], [
262
+ "R",
263
+ .72,
264
+ -.5236
265
+ ]]) {
266
+ const w = addPartBox(root, `HexFacetWall_${tag}`, .14, 2.68, 2.4, sx, 1.5, .05, wallMat);
267
+ w.rotation.y = yaw;
268
+ }
269
+ addPartBox(root, "HexApexPillar", .28, 3, .28, 0, 1.5, 1.32, trimMat);
270
+ } else {
271
+ addC12CornerFooters(root, trimMat);
272
+ const ow = DOOR_HINGE_SPEC.openingWidthM, oh = DOOR_HINGE_SPEC.openingHeightM;
273
+ const jw = (3 - ow) * .5;
274
+ addPartBox(root, "WallJamb_L", jw, oh, T, -(ow * .5 + jw * .5), oh * .5, 0, wallMat);
275
+ addPartBox(root, "WallJamb_R", jw, oh, T, ow * .5 + jw * .5, oh * .5, 0, wallMat);
276
+ addPartBox(root, "WallLintel", 3, 3 - oh, T, 0, oh + (3 - oh) * .5, 0, wallMat);
277
+ addPartBox(root, "DoorFrame_L", .05, oh, .29, -ow * .5 + .025, oh * .5, 0, trimMat);
278
+ addPartBox(root, "DoorFrame_R", .05, oh, .29, ow * .5 - .025, oh * .5, 0, trimMat);
279
+ addPartBox(root, "DoorFrame_Top", ow, .05, .29, 0, oh - .025, 0, trimMat);
280
+ const leaf = buildDoorLeafMesh(ow - .012, oh - .02, .046, 11817737, 16498468);
281
+ leaf.position.set(...DOOR_HINGE_SPEC.hingeOffsetLocal);
282
+ leaf.userData = {
283
+ c12Role: "DoorLeaf",
284
+ hingeOffsetLocal: [...DOOR_HINGE_SPEC.hingeOffsetLocal]
285
+ };
286
+ root.add(leaf);
287
+ addKolmoSocket(root, "Socket_DoorHinge", [...DOOR_HINGE_SPEC.hingeOffsetLocal], "hinge");
288
+ addKolmoSocket(root, "Aperture_Doorway_900x2100", [
289
+ 0,
290
+ oh * .5,
291
+ 0
292
+ ], "mount");
293
+ }
294
+ root.userData = {
295
+ proceduralDomain: "c12",
296
+ proceduralRecipeId: id
297
+ };
298
+ return root;
299
+ }
300
+ export { C12_PROCEDURAL_RECIPES, addKolmoSocket, addPartBox, buildDoorLeafMesh, buildProceduralC12Scene, makeFlatMat };
301
+
302
+ //# sourceMappingURL=proceduralC12AndCraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proceduralC12AndCraft.js","names":[],"sources":["../../src/importer/proceduralC12AndCraft.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport { DOOR_HINGE_SPEC } from \"@khr3/c12\";\nimport { KOLMO_EXTENSION_NAME, type KolmoNodeExtension, type KolmoSocketRole } from \"../schema/kolmoSchema.js\";\n\nexport interface ProceduralRecipeSpec<TId extends string = string> {\n readonly id: TId;\n readonly label: string;\n readonly domain: \"c12\" | \"craft\" | \"person\" | \"prop\" | \"junk\";\n readonly targetMeters: number;\n readonly massKg: number;\n readonly powerOrThrust?: number;\n readonly color: string;\n}\n\nexport type C12ProceduralRecipeId =\n | \"c12_doorway_wall\"\n | \"c12_window_wall\"\n | \"c12_floor_corbel\"\n | \"c12_stair_flight\"\n | \"c12_gable_roof\"\n | \"c12_hex_wing\";\n\nexport const C12_PROCEDURAL_RECIPES: readonly ProceduralRecipeSpec<C12ProceduralRecipeId>[] = Object.freeze([\n { id: \"c12_doorway_wall\", label: \"Doorway Wall\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#94a3b8\" },\n { id: \"c12_window_wall\", label: \"Window Wall\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#38bdf8\" },\n { id: \"c12_floor_corbel\", label: \"Floor Corbel\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#64748b\" },\n { id: \"c12_stair_flight\", label: \"Stair Flight\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#f59e0b\" },\n { id: \"c12_gable_roof\", label: \"Gable Roof\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#b45309\" },\n { id: \"c12_hex_wing\", label: \"C12 Hex Wing\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#10b981\" },\n]);\n\nexport function makeFlatMat(color: string, roughness = 0.55, metalness = 0.18, emissive?: string): THREE.MeshStandardMaterial {\n return new THREE.MeshStandardMaterial({\n color,\n roughness,\n metalness,\n flatShading: true,\n ...(emissive ? { emissive, emissiveIntensity: 0.85 } : {}),\n });\n}\n\nexport function addPartBox(p: THREE.Object3D, name: string, sx: number, sy: number, sz: number, x: number, y: number, z: number, mat: THREE.Material): THREE.Mesh {\n const m = new THREE.Mesh(new THREE.BoxGeometry(sx, sy, sz), mat);\n m.name = name;\n m.position.set(x, y, z);\n p.add(m);\n return m;\n}\n\nexport function addKolmoSocket(\n parent: THREE.Object3D,\n name: string,\n pos: [number, number, number],\n role: KolmoSocketRole,\n emitter?: Omit<KolmoNodeExtension, \"socket\">,\n rotEuler?: [number, number, number],\n): THREE.Object3D {\n const node = new THREE.Object3D();\n node.name = name;\n node.position.set(pos[0], pos[1], pos[2]);\n if (rotEuler) node.rotation.set(rotEuler[0], rotEuler[1], rotEuler[2]);\n const ext: KolmoNodeExtension = { ...(emitter ?? {}), socket: role };\n node.userData = { kolmoSocket: role, socket: role, [KOLMO_EXTENSION_NAME]: ext, kolmoExtension: ext };\n parent.add(node);\n return node;\n}\n\nexport function buildDoorLeafMesh(w: number, h: number, t: number, leafHex: number, handleHex: number): THREE.Mesh {\n const pos: number[] = [], norm: number[] = [], col: number[] = [];\n const c = new THREE.Color();\n const pushBox = (sx: number, sy: number, sz: number, ox: number, oy: number, oz: number, hex: number) => {\n const raw = new THREE.BoxGeometry(sx, sy, sz);\n const g = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n const pa = g.getAttribute(\"position\"), na = g.getAttribute(\"normal\");\n c.setHex(hex);\n for (let i = 0; i < pa.count; i++) {\n pos.push(pa.getX(i) + ox, pa.getY(i) + oy, pa.getZ(i) + oz);\n norm.push(na.getX(i), na.getY(i), na.getZ(i));\n col.push(c.r, c.g, c.b);\n }\n g.dispose();\n };\n pushBox(w, h, t, w * 0.5 + 0.005, h * 0.5 + 0.01, 0, leafHex);\n pushBox(w * 0.7, h * 0.34, t + 0.014, w * 0.5 + 0.005, h * 0.72, 0, leafHex - 0x0c0c0c);\n pushBox(w * 0.7, h * 0.32, t + 0.014, w * 0.5 + 0.005, h * 0.27, 0, leafHex - 0x0c0c0c);\n pushBox(0.03, 0.14, t + 0.04, w - 0.09, h * 0.48, 0, handleHex);\n pushBox(0.11, 0.024, t + 0.08, w - 0.12, h * 0.48, 0, handleHex);\n const geo = new THREE.BufferGeometry();\n geo.setAttribute(\"position\", new THREE.Float32BufferAttribute(pos, 3));\n geo.setAttribute(\"normal\", new THREE.Float32BufferAttribute(norm, 3));\n geo.setAttribute(\"color\", new THREE.Float32BufferAttribute(col, 3));\n geo.computeBoundingBox();\n geo.computeBoundingSphere();\n const leaf = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({ vertexColors: true, roughness: 0.48, metalness: 0.22, flatShading: true }));\n leaf.name = \"DoorLeaf\";\n return leaf;\n}\n\nfunction addC12CornerFooters(group: THREE.Group, mat: THREE.Material): void {\n const h = 1 / 12, w = 0.25;\n for (const [tag, sx] of [[\"L\", -1], [\"R\", 1]] as const) {\n for (const [zTag, sz] of [[\"F\", 1], [\"B\", -1]] as const) {\n addPartBox(group, `LatticeFooter_${tag}_${zTag}`, w, h, w, sx * (1.5 - w * 0.5), h * 0.5, sz * (1.5 - w * 0.5), mat);\n }\n }\n}\n\nexport function buildProceduralC12Scene(recipeOrId: C12ProceduralRecipeId | ProceduralRecipeSpec | string = \"c12_doorway_wall\"): THREE.Group {\n const id = (typeof recipeOrId === \"string\" ? recipeOrId : recipeOrId.id) as C12ProceduralRecipeId;\n const root = new THREE.Group();\n root.name = id;\n const wallMat = makeFlatMat(\"#94a3b8\", 0.68, 0.12);\n const trimMat = makeFlatMat(\"#334155\", 0.52, 0.28);\n const woodMat = makeFlatMat(\"#b45309\", 0.62, 0.1);\n const T = 0.25;\n\n if (id === \"c12_window_wall\") {\n addC12CornerFooters(root, trimMat);\n addPartBox(root, \"WallSill\", 3, 0.9, T, 0, 0.45, 0, wallMat);\n addPartBox(root, \"WallHeader\", 3, 0.75, T, 0, 2.625, 0, wallMat);\n addPartBox(root, \"WallPier_L\", 0.6, 1.35, T, -1.2, 1.575, 0, wallMat);\n addPartBox(root, \"WallPier_R\", 0.6, 1.35, T, 1.2, 1.575, 0, wallMat);\n addPartBox(root, \"WindowLedge\", 1.88, 0.06, T + 0.08, 0, 0.91, 0, trimMat);\n addPartBox(root, \"MullionV\", 0.06, 1.35, 0.08, 0, 1.575, 0, trimMat);\n addPartBox(root, \"MullionH\", 1.8, 0.06, 0.08, 0, 1.575, 0, trimMat);\n const glassMat = new THREE.MeshStandardMaterial({ color: \"#7dd3fc\", transparent: true, opacity: 0.36, roughness: 0.1, flatShading: true });\n for (const [gi, gx, gy] of [[0, -0.45, 1.24], [1, 0.45, 1.24], [2, -0.45, 1.91], [3, 0.45, 1.91]] as const) {\n addPartBox(root, `WindowPane_${gi}`, 0.84, 0.6, 0.025, gx, gy, 0, glassMat);\n }\n addKolmoSocket(root, \"Aperture_Window\", [0, 1.575, 0], \"mount\");\n } else if (id === \"c12_floor_corbel\") {\n addPartBox(root, \"DeckSlab\", 3, 1 / 12, 3, 0, 0.25 - 1 / 24, 0, wallMat);\n for (const [pos, idx] of [[-1.375, 0], [-0.45, 1], [0.45, 2], [1.375, 3]] as const) {\n addPartBox(root, `CorbelRibX_${idx}`, 0.25, 2 / 12, 3, pos, 1 / 12, 0, trimMat);\n addPartBox(root, `CorbelRibZ_${idx}`, 2.5, 2 / 12, 0.22, 0, 1 / 12, pos, trimMat);\n }\n } else if (id === \"c12_stair_flight\") {\n const steps = 10, sw = 1.5, stepH = 3 / steps, stepD = 3 / steps;\n for (let i = 0; i < steps; i++) {\n const h = (i + 1) * stepH * 0.28 + 0.08, yTop = (i + 1) * stepH, z = -1.5 + (i + 0.5) * stepD;\n addPartBox(root, `StairTread_${i}`, sw - 0.14, h, stepD, 0, yTop - h * 0.5, z, woodMat);\n }\n addPartBox(root, \"LandingBase\", sw, 1 / 12, 0.3, 0, 1 / 24, -1.35, trimMat);\n for (const [tag, sx] of [[\"L\", -1], [\"R\", 1]] as const) {\n const str = addPartBox(root, `StairStringer_${tag}`, 0.06, 0.16, 3.6, sx * (sw * 0.5 - 0.03), 1.42, 0, trimMat);\n str.rotation.x = -Math.PI * 0.25;\n const rail = addPartBox(root, `StairHandrail_${tag}`, 0.05, 0.05, 2.8, sx * (sw * 0.5 - 0.03), 1.96, -0.12, woodMat);\n rail.rotation.x = -0.62;\n addPartBox(root, `NewelLow_${tag}`, 0.06, 1.05, 0.06, sx * (sw * 0.5 - 0.03), 0.525, -1.44, trimMat);\n addPartBox(root, `NewelHigh_${tag}`, 0.06, 0.6, 0.06, sx * (sw * 0.5 - 0.03), 2.7, 1.44, trimMat);\n }\n } else if (id === \"c12_gable_roof\") {\n addPartBox(root, \"EaveBeam_L\", 0.18, 1 / 6, 3, -1.41, 1 / 12, 0, trimMat);\n addPartBox(root, \"EaveBeam_R\", 0.18, 1 / 6, 3, 1.41, 1 / 12, 0, trimMat);\n addPartBox(root, \"RidgeBeam\", 0.18, 0.18, 3, 0, 1.41, 0, trimMat);\n const slopeL = addPartBox(root, \"RoofSlope_L\", 1.92, 0.1, 3, -0.74, 0.78, 0, woodMat);\n slopeL.rotation.z = 0.72;\n const slopeR = addPartBox(root, \"RoofSlope_R\", 1.92, 0.1, 3, 0.74, 0.78, 0, woodMat);\n slopeR.rotation.z = -0.72;\n for (const [tag, z] of [[\"Front\", 1.42], [\"Back\", -1.42]] as const) {\n const tri = new THREE.Shape([new THREE.Vector2(-1.38, 0.12), new THREE.Vector2(1.38, 0.12), new THREE.Vector2(0, 1.38)]);\n const raw = new THREE.ExtrudeGeometry(tri, { depth: 0.12, bevelEnabled: false });\n const g = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n g.translate(0, 0, z - 0.06);\n g.computeVertexNormals();\n const m = new THREE.Mesh(g, wallMat);\n m.name = `GablePediment_${tag}`;\n root.add(m);\n }\n } else if (id === \"c12_hex_wing\") {\n addC12CornerFooters(root, trimMat);\n const wedge = new THREE.Shape([new THREE.Vector2(-1.5, -1.25), new THREE.Vector2(1.5, -1.25), new THREE.Vector2(0, 1.35)]);\n const raw = new THREE.ExtrudeGeometry(wedge, { depth: 0.16, bevelEnabled: false });\n const deckGeo = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n deckGeo.rotateX(Math.PI * 0.5);\n deckGeo.translate(0, 0.16, 0);\n deckGeo.computeVertexNormals();\n const deck = new THREE.Mesh(deckGeo, trimMat);\n deck.name = \"HexFloorWedge\";\n const cap = new THREE.Mesh(deckGeo.clone(), trimMat);\n cap.name = \"HexCeilingWedge\";\n cap.position.y = 2.84;\n root.add(deck, cap);\n for (const [tag, sx, yaw] of [[\"L\", -0.72, 0.5236], [\"R\", 0.72, -0.5236]] as const) {\n const w = addPartBox(root, `HexFacetWall_${tag}`, 0.14, 2.68, 2.4, sx, 1.5, 0.05, wallMat);\n w.rotation.y = yaw;\n }\n addPartBox(root, \"HexApexPillar\", 0.28, 3, 0.28, 0, 1.5, 1.32, trimMat);\n } else {\n addC12CornerFooters(root, trimMat);\n const ow = DOOR_HINGE_SPEC.openingWidthM, oh = DOOR_HINGE_SPEC.openingHeightM;\n const jw = (3 - ow) * 0.5;\n addPartBox(root, \"WallJamb_L\", jw, oh, T, -(ow * 0.5 + jw * 0.5), oh * 0.5, 0, wallMat);\n addPartBox(root, \"WallJamb_R\", jw, oh, T, ow * 0.5 + jw * 0.5, oh * 0.5, 0, wallMat);\n addPartBox(root, \"WallLintel\", 3, 3 - oh, T, 0, oh + (3 - oh) * 0.5, 0, wallMat);\n addPartBox(root, \"DoorFrame_L\", 0.05, oh, T + 0.04, -ow * 0.5 + 0.025, oh * 0.5, 0, trimMat);\n addPartBox(root, \"DoorFrame_R\", 0.05, oh, T + 0.04, ow * 0.5 - 0.025, oh * 0.5, 0, trimMat);\n addPartBox(root, \"DoorFrame_Top\", ow, 0.05, T + 0.04, 0, oh - 0.025, 0, trimMat);\n const leaf = buildDoorLeafMesh(ow - 0.012, oh - 0.02, 0.046, 0xb45309, 0xfbbf24);\n leaf.position.set(...DOOR_HINGE_SPEC.hingeOffsetLocal);\n leaf.userData = { c12Role: \"DoorLeaf\", hingeOffsetLocal: [...DOOR_HINGE_SPEC.hingeOffsetLocal] };\n root.add(leaf);\n addKolmoSocket(root, \"Socket_DoorHinge\", [...DOOR_HINGE_SPEC.hingeOffsetLocal], \"hinge\");\n addKolmoSocket(root, \"Aperture_Doorway_900x2100\", [0, oh * 0.5, 0], \"mount\");\n }\n\n root.userData = { proceduralDomain: \"c12\", proceduralRecipeId: id };\n return root;\n}\n"],"mappings":";;;;AAsBA,IAAa,yBAAiF,OAAO,OAAO;CACxG;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC7G;EAAE,IAAI;EAAmB,OAAO;EAAe,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC3G;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC7G;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC7G;EAAE,IAAI;EAAkB,OAAO;EAAc,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CACzG;EAAE,IAAI;EAAgB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;AAC7G,CAAC;AAED,SAAgB,YAAY,OAAe,YAAY,KAAM,YAAY,KAAM,UAA+C;CAC1H,OAAO,IAAI,MAAM,qBAAqB;EAClC;EACA;EACA;EACA,aAAa;EACb,GAAI,WAAW;GAAE;GAAU,mBAAmB;EAAK,IAAI,CAAC;CAC5D,CAAC;AACL;A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,MAAM,OAAO;CAC1E,OAAO;EACH,oBAAoB,MAAM,OAAO;EACjC,MAAM,KAAK,gBAAgB,eAAe,KAAK,gBAAgB;EAC/D,MAAM,MAAM,IAAI,MAAM;EACtB,WAAW,MAAM,cAAc,IAAI,IAAI,GAAG,EAAE,KAAK,KAAM,KAAK,KAAM,KAAK,IAAK,GAAG,OAAO;EACtF,WAAW,MAAM,cAAc,IAAI,IAAI,GAAG,KAAK,KAAM,KAAK,IAAK,KAAK,IAAK,GAAG,OAAO;EACnF,WAAW,MAAM,cAAc,GAAG,IAAI,IAAI,GAAG,GAAG,MAAM,IAAI,MAAM,IAAK,GAAG,OAAO;EAC/E,WAAW,MAAM,eAAe,KAAM,IAAI,KAAU,CAAC,KAAK,KAAM,MAAO,KAAK,IAAK,GAAG,OAAO;EAC3F,WAAW,MAAM,eAAe,KAAM,IAAI,KAAU,KAAK,KAAM,MAAO,KAAK,IAAK,GAAG,OAAO;EAC1F,WAAW,MAAM,iBAAiB,IAAI,KAAM,KAAU,GAAG,KAAK,MAAO,GAAG,OAAO;EAC/E,MAAM,OAAO,kBAAkB,KAAK,MAAO,KAAK,KAAM,MAAO,UAAU,QAAQ;EAC/E,KAAK,SAAS,IAAI,GAAG,gBAAgB,gBAAgB;EACrD,KAAK,WAAW;GAAE,SAAS;GAAY,kBAAkB,CAAC,GAAG,gBAAgB,gBAAgB;EAAE;EAC/F,KAAK,IAAI,IAAI;EACb,eAAe,MAAM,oBAAoB,CAAC,GAAG,gBAAgB,gBAAgB,GAAG,OAAO;EACvF,eAAe,MAAM,6BAA6B;GAAC;GAAG,KAAK;GAAK;EAAC,GAAG,OAAO;CAC/E;CAEA,KAAK,WAAW;EAAE,kBAAkB;EAAO,oBAAoB;CAAG;CAClE,OAAO;AACX"}
@@ -0,0 +1,10 @@
1
+ import * as THREE from "three";
2
+ import { JUNK_PROCEDURAL_RECIPES, buildProceduralJunkScene, type JunkProceduralRecipe, type JunkProceduralRecipeId } from "../junk/junkProceduralScenes.js";
3
+ import { C12_PROCEDURAL_RECIPES, buildProceduralC12Scene, type C12ProceduralRecipeId, type ProceduralRecipeSpec } from "./proceduralC12AndCraft.js";
4
+ import { PERSON_PROCEDURAL_RECIPES, PROP_PROCEDURAL_RECIPES, buildProceduralPersonScene, buildProceduralPropScene, type PersonProceduralRecipeId, type PropProceduralRecipeId } from "./proceduralPersonAndProp.js";
5
+ export type CraftProceduralRecipeId = "starfighter_delta" | "vtol_dropship" | "hover_skiff" | "orbital_lander";
6
+ export declare const CRAFT_PROCEDURAL_RECIPES: readonly ProceduralRecipeSpec<CraftProceduralRecipeId>[];
7
+ export declare function buildProceduralCraftScene(recipeOrId?: CraftProceduralRecipeId | ProceduralRecipeSpec | string): THREE.Group;
8
+ export type ProceduralBuilderDomain = "c12" | "craft" | "person" | "prop" | "junk";
9
+ export declare function buildProceduralDomainScene(domain: ProceduralBuilderDomain, recipeId?: string): THREE.Group;
10
+ export { C12_PROCEDURAL_RECIPES, JUNK_PROCEDURAL_RECIPES, PERSON_PROCEDURAL_RECIPES, PROP_PROCEDURAL_RECIPES, buildProceduralC12Scene, buildProceduralJunkScene, buildProceduralPersonScene, buildProceduralPropScene, type C12ProceduralRecipeId, type JunkProceduralRecipe, type JunkProceduralRecipeId, type PersonProceduralRecipeId, type PropProceduralRecipeId, type ProceduralRecipeSpec, };