mesheditor 0.0.0-stage → 1.0.3

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 (258) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +853 -2
  3. package/dist-lib/esm/AIAgentService.d.ts +106 -0
  4. package/dist-lib/esm/AIAgentService.js +1471 -0
  5. package/dist-lib/esm/MeshEditorApp.d.ts +412 -0
  6. package/dist-lib/esm/MeshEditorApp.js +9092 -0
  7. package/dist-lib/esm/MeshEditorService.d.ts +459 -0
  8. package/dist-lib/esm/MeshEditorService.js +7083 -0
  9. package/dist-lib/esm/Neural3DGeneratorService.d.ts +88 -0
  10. package/dist-lib/esm/Neural3DGeneratorService.js +1397 -0
  11. package/dist-lib/esm/adapters/BrowserPlatformAdapter.d.ts +16 -0
  12. package/dist-lib/esm/adapters/BrowserPlatformAdapter.js +25 -0
  13. package/dist-lib/esm/adapters/ElectronPlatformAdapter.d.ts +32 -0
  14. package/dist-lib/esm/adapters/ElectronPlatformAdapter.js +336 -0
  15. package/dist-lib/esm/adapters/HostAppAdapter.d.ts +54 -0
  16. package/dist-lib/esm/adapters/HostAppAdapter.js +75 -0
  17. package/dist-lib/esm/adapters/PlatformAdapter.d.ts +98 -0
  18. package/dist-lib/esm/adapters/PlatformAdapter.js +1 -0
  19. package/dist-lib/esm/adapters/index.d.ts +13 -0
  20. package/dist-lib/esm/adapters/index.js +15 -0
  21. package/dist-lib/esm/assets/fonts/Droid_Sans_Bold.json +1 -0
  22. package/dist-lib/esm/assets/fonts/Droid_Sans_Regular.json +1 -0
  23. package/dist-lib/esm/assets/fonts/Kenney_Future_Regular.json +1 -0
  24. package/dist-lib/esm/baking/TextureBaker.d.ts +84 -0
  25. package/dist-lib/esm/baking/TextureBaker.js +709 -0
  26. package/dist-lib/esm/builtInSkills.d.ts +19 -0
  27. package/dist-lib/esm/builtInSkills.js +186 -0
  28. package/dist-lib/esm/compression/ModelCompressor.d.ts +87 -0
  29. package/dist-lib/esm/compression/ModelCompressor.js +553 -0
  30. package/dist-lib/esm/decals/DecalController.d.ts +147 -0
  31. package/dist-lib/esm/decals/DecalController.js +1031 -0
  32. package/dist-lib/esm/decals/decalAssetUrls.d.ts +1 -0
  33. package/dist-lib/esm/decals/decalAssetUrls.js +16 -0
  34. package/dist-lib/esm/geometry/architecture.d.ts +114 -0
  35. package/dist-lib/esm/geometry/architecture.js +832 -0
  36. package/dist-lib/esm/geometry/bevelModifier.d.ts +59 -0
  37. package/dist-lib/esm/geometry/bevelModifier.js +345 -0
  38. package/dist-lib/esm/geometry/facetSurfaceUtils.d.ts +127 -0
  39. package/dist-lib/esm/geometry/facetSurfaceUtils.js +676 -0
  40. package/dist-lib/esm/geometry/roundedBox.d.ts +15 -0
  41. package/dist-lib/esm/geometry/roundedBox.js +133 -0
  42. package/dist-lib/esm/index.d.ts +21 -0
  43. package/dist-lib/esm/index.js +50 -0
  44. package/dist-lib/esm/pathExtrusion/PathExtrusionController.d.ts +59 -0
  45. package/dist-lib/esm/pathExtrusion/PathExtrusionController.js +483 -0
  46. package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.d.ts +76 -0
  47. package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.js +1792 -0
  48. package/dist-lib/esm/pathExtrusion/PathFactory.d.ts +95 -0
  49. package/dist-lib/esm/pathExtrusion/PathFactory.js +627 -0
  50. package/dist-lib/esm/pathExtrusion/index.d.ts +4 -0
  51. package/dist-lib/esm/pathExtrusion/index.js +4 -0
  52. package/dist-lib/esm/pathExtrusion/types.d.ts +50 -0
  53. package/dist-lib/esm/pathExtrusion/types.js +1 -0
  54. package/dist-lib/esm/plugin.d.ts +250 -0
  55. package/dist-lib/esm/plugin.js +144 -0
  56. package/dist-lib/esm/rigging/WeightPaintController.d.ts +162 -0
  57. package/dist-lib/esm/rigging/WeightPaintController.js +1421 -0
  58. package/dist-lib/esm/sculpting/SculptController.d.ts +146 -0
  59. package/dist-lib/esm/sculpting/SculptController.js +2038 -0
  60. package/dist-lib/esm/sdf/index.d.ts +2 -0
  61. package/dist-lib/esm/sdf/index.js +2 -0
  62. package/dist-lib/esm/sdf/sdfPrimitives.d.ts +97 -0
  63. package/dist-lib/esm/sdf/sdfPrimitives.js +402 -0
  64. package/dist-lib/esm/sdf/surfaceNets.d.ts +29 -0
  65. package/dist-lib/esm/sdf/surfaceNets.js +399 -0
  66. package/dist-lib/esm/styles.d.ts +11 -0
  67. package/dist-lib/esm/styles.js +32 -0
  68. package/dist-lib/esm/template.d.ts +12 -0
  69. package/dist-lib/esm/template.js +19 -0
  70. package/dist-lib/esm/textMesh/TextMeshController.d.ts +61 -0
  71. package/dist-lib/esm/textMesh/TextMeshController.js +405 -0
  72. package/dist-lib/esm/textures/AITextureGenerator.d.ts +119 -0
  73. package/dist-lib/esm/textures/AITextureGenerator.js +945 -0
  74. package/dist-lib/esm/textures/ExternalImageGeneratorService.d.ts +62 -0
  75. package/dist-lib/esm/textures/ExternalImageGeneratorService.js +879 -0
  76. package/dist-lib/esm/tools/AbstractTool.d.ts +68 -0
  77. package/dist-lib/esm/tools/AbstractTool.js +128 -0
  78. package/dist-lib/esm/tools/ToolExecutionContext.d.ts +40 -0
  79. package/dist-lib/esm/tools/ToolExecutionContext.js +1 -0
  80. package/dist-lib/esm/tools/ToolInterface.d.ts +104 -0
  81. package/dist-lib/esm/tools/ToolInterface.js +1 -0
  82. package/dist-lib/esm/tools/ToolRegistry.d.ts +43 -0
  83. package/dist-lib/esm/tools/ToolRegistry.js +115 -0
  84. package/dist-lib/esm/tools/builtin/ApplyMaterialTool.d.ts +34 -0
  85. package/dist-lib/esm/tools/builtin/ApplyMaterialTool.js +48 -0
  86. package/dist-lib/esm/tools/builtin/AutoUVMappingTool.d.ts +34 -0
  87. package/dist-lib/esm/tools/builtin/AutoUVMappingTool.js +54 -0
  88. package/dist-lib/esm/tools/builtin/BakeTexturesTool.d.ts +42 -0
  89. package/dist-lib/esm/tools/builtin/BakeTexturesTool.js +81 -0
  90. package/dist-lib/esm/tools/builtin/BooleanOperationTool.d.ts +51 -0
  91. package/dist-lib/esm/tools/builtin/BooleanOperationTool.js +86 -0
  92. package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.d.ts +78 -0
  93. package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.js +170 -0
  94. package/dist-lib/esm/tools/builtin/CloneArrayTool.d.ts +75 -0
  95. package/dist-lib/esm/tools/builtin/CloneArrayTool.js +115 -0
  96. package/dist-lib/esm/tools/builtin/CreateArchTool.d.ts +118 -0
  97. package/dist-lib/esm/tools/builtin/CreateArchTool.js +89 -0
  98. package/dist-lib/esm/tools/builtin/CreateColumnTool.d.ts +114 -0
  99. package/dist-lib/esm/tools/builtin/CreateColumnTool.js +105 -0
  100. package/dist-lib/esm/tools/builtin/CreateLatheTool.d.ts +87 -0
  101. package/dist-lib/esm/tools/builtin/CreateLatheTool.js +60 -0
  102. package/dist-lib/esm/tools/builtin/CreateMaterialTool.d.ts +114 -0
  103. package/dist-lib/esm/tools/builtin/CreateMaterialTool.js +212 -0
  104. package/dist-lib/esm/tools/builtin/CreateMoldingTool.d.ts +120 -0
  105. package/dist-lib/esm/tools/builtin/CreateMoldingTool.js +95 -0
  106. package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.d.ts +162 -0
  107. package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.js +302 -0
  108. package/dist-lib/esm/tools/builtin/CreateRoofTool.d.ts +120 -0
  109. package/dist-lib/esm/tools/builtin/CreateRoofTool.js +108 -0
  110. package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.d.ts +101 -0
  111. package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.js +79 -0
  112. package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.d.ts +224 -0
  113. package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.js +238 -0
  114. package/dist-lib/esm/tools/builtin/CreateStairsTool.d.ts +135 -0
  115. package/dist-lib/esm/tools/builtin/CreateStairsTool.js +119 -0
  116. package/dist-lib/esm/tools/builtin/CreateTextMeshTool.d.ts +94 -0
  117. package/dist-lib/esm/tools/builtin/CreateTextMeshTool.js +131 -0
  118. package/dist-lib/esm/tools/builtin/CreateTubeTool.d.ts +87 -0
  119. package/dist-lib/esm/tools/builtin/CreateTubeTool.js +59 -0
  120. package/dist-lib/esm/tools/builtin/CreateWallTool.d.ts +145 -0
  121. package/dist-lib/esm/tools/builtin/CreateWallTool.js +124 -0
  122. package/dist-lib/esm/tools/builtin/DecalTool.d.ts +76 -0
  123. package/dist-lib/esm/tools/builtin/DecalTool.js +143 -0
  124. package/dist-lib/esm/tools/builtin/DeleteMeshTool.d.ts +20 -0
  125. package/dist-lib/esm/tools/builtin/DeleteMeshTool.js +42 -0
  126. package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.d.ts +21 -0
  127. package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.js +96 -0
  128. package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.d.ts +114 -0
  129. package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.js +77 -0
  130. package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.d.ts +104 -0
  131. package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.js +68 -0
  132. package/dist-lib/esm/tools/builtin/FacetArcTool.d.ts +36 -0
  133. package/dist-lib/esm/tools/builtin/FacetArcTool.js +57 -0
  134. package/dist-lib/esm/tools/builtin/FacetCutThroughTool.d.ts +30 -0
  135. package/dist-lib/esm/tools/builtin/FacetCutThroughTool.js +49 -0
  136. package/dist-lib/esm/tools/builtin/FacetExtrudeTool.d.ts +30 -0
  137. package/dist-lib/esm/tools/builtin/FacetExtrudeTool.js +49 -0
  138. package/dist-lib/esm/tools/builtin/FacetInsetTool.d.ts +34 -0
  139. package/dist-lib/esm/tools/builtin/FacetInsetTool.js +55 -0
  140. package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.d.ts +131 -0
  141. package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.js +455 -0
  142. package/dist-lib/esm/tools/builtin/GenerateTextureTool.d.ts +87 -0
  143. package/dist-lib/esm/tools/builtin/GenerateTextureTool.js +216 -0
  144. package/dist-lib/esm/tools/builtin/GetSceneInfoTool.d.ts +11 -0
  145. package/dist-lib/esm/tools/builtin/GetSceneInfoTool.js +12 -0
  146. package/dist-lib/esm/tools/builtin/MergeMeshesTool.d.ts +28 -0
  147. package/dist-lib/esm/tools/builtin/MergeMeshesTool.js +56 -0
  148. package/dist-lib/esm/tools/builtin/PlanModelTool.d.ts +87 -0
  149. package/dist-lib/esm/tools/builtin/PlanModelTool.js +155 -0
  150. package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.d.ts +50 -0
  151. package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.js +116 -0
  152. package/dist-lib/esm/tools/builtin/RigWeightTool.d.ts +55 -0
  153. package/dist-lib/esm/tools/builtin/RigWeightTool.js +139 -0
  154. package/dist-lib/esm/tools/builtin/SculptMeshTool.d.ts +138 -0
  155. package/dist-lib/esm/tools/builtin/SculptMeshTool.js +255 -0
  156. package/dist-lib/esm/tools/builtin/SeparateMeshTool.d.ts +21 -0
  157. package/dist-lib/esm/tools/builtin/SeparateMeshTool.js +31 -0
  158. package/dist-lib/esm/tools/builtin/SolidifyMeshTool.d.ts +30 -0
  159. package/dist-lib/esm/tools/builtin/SolidifyMeshTool.js +57 -0
  160. package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.d.ts +66 -0
  161. package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.js +105 -0
  162. package/dist-lib/esm/tools/builtin/SubDSmoothTool.d.ts +23 -0
  163. package/dist-lib/esm/tools/builtin/SubDSmoothTool.js +37 -0
  164. package/dist-lib/esm/tools/builtin/SubdivideMeshTool.d.ts +23 -0
  165. package/dist-lib/esm/tools/builtin/SubdivideMeshTool.js +39 -0
  166. package/dist-lib/esm/tools/builtin/TransformMeshTool.d.ts +78 -0
  167. package/dist-lib/esm/tools/builtin/TransformMeshTool.js +69 -0
  168. package/dist-lib/esm/tools/builtin/UVUnwrapTool.d.ts +48 -0
  169. package/dist-lib/esm/tools/builtin/UVUnwrapTool.js +107 -0
  170. package/dist-lib/esm/tools/builtin/VoxelPainterTool.d.ts +60 -0
  171. package/dist-lib/esm/tools/builtin/VoxelPainterTool.js +153 -0
  172. package/dist-lib/esm/tools/builtin/index.d.ts +44 -0
  173. package/dist-lib/esm/tools/builtin/index.js +44 -0
  174. package/dist-lib/esm/tools/editor/AIAgentEditorTool.d.ts +18 -0
  175. package/dist-lib/esm/tools/editor/AIAgentEditorTool.js +43 -0
  176. package/dist-lib/esm/tools/editor/AITextureEditorTool.d.ts +15 -0
  177. package/dist-lib/esm/tools/editor/AITextureEditorTool.js +28 -0
  178. package/dist-lib/esm/tools/editor/AbstractEditorTool.d.ts +29 -0
  179. package/dist-lib/esm/tools/editor/AbstractEditorTool.js +56 -0
  180. package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.d.ts +17 -0
  181. package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.js +29 -0
  182. package/dist-lib/esm/tools/editor/BakingEditorTool.d.ts +21 -0
  183. package/dist-lib/esm/tools/editor/BakingEditorTool.js +44 -0
  184. package/dist-lib/esm/tools/editor/CSGEditorTool.d.ts +20 -0
  185. package/dist-lib/esm/tools/editor/CSGEditorTool.js +42 -0
  186. package/dist-lib/esm/tools/editor/CompressModelEditorTool.d.ts +20 -0
  187. package/dist-lib/esm/tools/editor/CompressModelEditorTool.js +48 -0
  188. package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.d.ts +17 -0
  189. package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.js +36 -0
  190. package/dist-lib/esm/tools/editor/DecalEditorTool.d.ts +17 -0
  191. package/dist-lib/esm/tools/editor/DecalEditorTool.js +36 -0
  192. package/dist-lib/esm/tools/editor/FacetEditorTool.d.ts +23 -0
  193. package/dist-lib/esm/tools/editor/FacetEditorTool.js +80 -0
  194. package/dist-lib/esm/tools/editor/MaterialEditorTool.d.ts +18 -0
  195. package/dist-lib/esm/tools/editor/MaterialEditorTool.js +43 -0
  196. package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.d.ts +17 -0
  197. package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.js +37 -0
  198. package/dist-lib/esm/tools/editor/OutlinerEditorTool.d.ts +17 -0
  199. package/dist-lib/esm/tools/editor/OutlinerEditorTool.js +34 -0
  200. package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.d.ts +26 -0
  201. package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.js +72 -0
  202. package/dist-lib/esm/tools/editor/RiggingEditorTool.d.ts +27 -0
  203. package/dist-lib/esm/tools/editor/RiggingEditorTool.js +66 -0
  204. package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.d.ts +17 -0
  205. package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.js +35 -0
  206. package/dist-lib/esm/tools/editor/SculptEditorTool.d.ts +28 -0
  207. package/dist-lib/esm/tools/editor/SculptEditorTool.js +70 -0
  208. package/dist-lib/esm/tools/editor/TextMeshEditorTool.d.ts +16 -0
  209. package/dist-lib/esm/tools/editor/TextMeshEditorTool.js +30 -0
  210. package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.d.ts +17 -0
  211. package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.js +28 -0
  212. package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.d.ts +27 -0
  213. package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.js +70 -0
  214. package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.d.ts +26 -0
  215. package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.js +68 -0
  216. package/dist-lib/esm/tools/editor/aiQuickPrompts.d.ts +30 -0
  217. package/dist-lib/esm/tools/editor/aiQuickPrompts.js +228 -0
  218. package/dist-lib/esm/tools/editor/index.d.ts +32 -0
  219. package/dist-lib/esm/tools/editor/index.js +54 -0
  220. package/dist-lib/esm/tools/editor/toolViews.d.ts +10 -0
  221. package/dist-lib/esm/tools/editor/toolViews.js +53 -0
  222. package/dist-lib/esm/tools/editorTools.d.ts +5 -0
  223. package/dist-lib/esm/tools/editorTools.js +5 -0
  224. package/dist-lib/esm/tools/index.d.ts +8 -0
  225. package/dist-lib/esm/tools/index.js +8 -0
  226. package/dist-lib/esm/tools/textureUtils.d.ts +18 -0
  227. package/dist-lib/esm/tools/textureUtils.js +288 -0
  228. package/dist-lib/esm/types.d.ts +164 -0
  229. package/dist-lib/esm/types.js +1 -0
  230. package/dist-lib/esm/uv/UVUnwrapController.d.ts +108 -0
  231. package/dist-lib/esm/uv/UVUnwrapController.js +1022 -0
  232. package/dist-lib/esm/voxel/CustomVoxelMesher.d.ts +15 -0
  233. package/dist-lib/esm/voxel/CustomVoxelMesher.js +169 -0
  234. package/dist-lib/esm/voxel/TextureAtlasManager.d.ts +54 -0
  235. package/dist-lib/esm/voxel/TextureAtlasManager.js +630 -0
  236. package/dist-lib/esm/voxel/VoxelPainterController.d.ts +100 -0
  237. package/dist-lib/esm/voxel/VoxelPainterController.js +671 -0
  238. package/dist-lib/esm/voxel/index.d.ts +4 -0
  239. package/dist-lib/esm/voxel/index.js +4 -0
  240. package/dist-lib/esm/voxel/types.d.ts +78 -0
  241. package/dist-lib/esm/voxel/types.js +1 -0
  242. package/dist-lib/esm/web-component/MeshEditorElement.d.ts +103 -0
  243. package/dist-lib/esm/web-component/MeshEditorElement.js +246 -0
  244. package/dist-lib/esm/web-component/index.d.ts +1 -0
  245. package/dist-lib/esm/web-component/index.js +1 -0
  246. package/dist-lib/index.umd.js +3 -0
  247. package/dist-lib/mesheditor.css +2 -0
  248. package/dist-lib/mesheditor.css.map +1 -0
  249. package/dist-lib/standalone/mesheditor-element.bundle.js +3 -0
  250. package/package.json +114 -4
  251. package/skills/README.md +48 -0
  252. package/skills/figure-sculptor.md +297 -0
  253. package/skills/image-to-mesh.md +18 -0
  254. package/skills/mesh-updater.md +27 -0
  255. package/skills/neural-3d-generator.md +53 -0
  256. package/skills/procedural-modeler.md +267 -0
  257. package/skills/voxel-painter.md +21 -0
  258. package/src/mesheditor.css +6477 -0
@@ -0,0 +1,42 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class BakeTexturesTool extends AbstractTool {
4
+ readonly name = "modeler_bake_textures";
5
+ readonly description = "Bakes High-Poly surface detail onto a Low-Poly game mesh as a Tangent-Space Normal Map and Ambient Occlusion (AO) Map using an automatic extruded Projection Cage.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ lowPolyMeshName: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ highPolyMeshName: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ resolution: {
18
+ type: string;
19
+ enum: number[];
20
+ description: string;
21
+ };
22
+ cageExtrusion: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ paddingPx: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ flipNormalY: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ applyToMaterial: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ };
39
+ required: string[];
40
+ };
41
+ execute(args: any, context: ToolExecutionContext): Promise<string>;
42
+ }
@@ -0,0 +1,81 @@
1
+ import { Mesh } from '@babylonjs/core';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class BakeTexturesTool extends AbstractTool {
4
+ name = 'modeler_bake_textures';
5
+ description = 'Bakes High-Poly surface detail onto a Low-Poly game mesh as a Tangent-Space Normal Map and Ambient Occlusion (AO) Map using an automatic extruded Projection Cage.';
6
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ lowPolyMeshName: {
10
+ type: 'string',
11
+ description: 'Name or ID of the Low-Poly target mesh in the scene.',
12
+ },
13
+ highPolyMeshName: {
14
+ type: 'string',
15
+ description: 'Optional name or ID of the High-Poly source mesh. If omitted, bakes self-detail and cavity/bevel normals.',
16
+ },
17
+ resolution: {
18
+ type: 'integer',
19
+ enum: [128, 256, 512, 1024, 2048],
20
+ description: 'Baked map resolution in pixels (default 512).',
21
+ },
22
+ cageExtrusion: {
23
+ type: 'number',
24
+ description: 'Projection cage extrusion distance along smooth vertex normals in meters (default auto-calculated or 0.04).',
25
+ },
26
+ paddingPx: {
27
+ type: 'integer',
28
+ description: 'UV island border dilation padding in pixels (default 4).',
29
+ },
30
+ flipNormalY: {
31
+ type: 'boolean',
32
+ description: 'If true, flips Green (-Y) channel for DirectX convention (default false = OpenGL).',
33
+ },
34
+ applyToMaterial: {
35
+ type: 'boolean',
36
+ description: 'If true (default), assigns the baked Normal and AO maps directly to the Low-Poly material.',
37
+ },
38
+ },
39
+ required: ['lowPolyMeshName'],
40
+ };
41
+ async execute(args, context) {
42
+ const lowName = String(args.lowPolyMeshName || '').trim();
43
+ const lowMesh = context.findMeshByNameOrId(lowName);
44
+ if (!lowMesh || !(lowMesh instanceof Mesh)) {
45
+ throw new Error(`Low-poly mesh "${lowName}" not found in scene.`);
46
+ }
47
+ let highMesh = null;
48
+ if (args.highPolyMeshName) {
49
+ const found = context.findMeshByNameOrId(String(args.highPolyMeshName).trim());
50
+ if (found instanceof Mesh)
51
+ highMesh = found;
52
+ }
53
+ const baker = context.service.textureBaker;
54
+ const cageExtrusion = args.cageExtrusion !== undefined
55
+ ? Number(args.cageExtrusion)
56
+ : baker.computeAutoCageDistance(lowMesh, highMesh);
57
+ const resolution = (Number(args.resolution) || 512);
58
+ const paddingPx = args.paddingPx !== undefined ? Number(args.paddingPx) : 4;
59
+ const flipNormalY = !!args.flipNormalY;
60
+ const applyToMaterial = args.applyToMaterial !== false;
61
+ const result = await baker.bakeTextures({
62
+ lowPolyMesh: lowMesh,
63
+ highPolyMesh: highMesh,
64
+ resolution,
65
+ cageExtrusion,
66
+ paddingPx,
67
+ flipNormalY,
68
+ applyToMaterial,
69
+ });
70
+ return JSON.stringify({
71
+ status: 'ok',
72
+ lowPolyMeshName: result.lowPolyMeshName,
73
+ highPolyMeshName: result.highPolyMeshName,
74
+ resolution: result.resolution,
75
+ cageExtrusion: result.cageExtrusion,
76
+ rayHitCount: result.rayHitCount,
77
+ coveragePercent: result.coveragePercent,
78
+ appliedToMaterial: result.appliedToMaterial,
79
+ });
80
+ }
81
+ }
@@ -0,0 +1,51 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class BooleanOperationTool extends AbstractTool {
4
+ readonly name = "modeler_boolean_operation";
5
+ readonly description = "Performs a CSG (Constructive Solid Geometry) boolean operation (union, subtract, intersect) between baseMeshName and toolMeshName, with optional non-destructive mode and edge Bevel Modifier (chamfer/fillet).";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ operation: {
10
+ type: string;
11
+ enum: string[];
12
+ };
13
+ baseMeshName: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ toolMeshName: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ newName: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ keepToolMesh: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ nonDestructive: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ bevelWidth: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ bevelSegments: {
38
+ type: string;
39
+ minimum: number;
40
+ maximum: number;
41
+ description: string;
42
+ };
43
+ angleThresholdDeg: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ };
48
+ required: string[];
49
+ };
50
+ execute(args: any, context: ToolExecutionContext): Promise<string>;
51
+ }
@@ -0,0 +1,86 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ export class BooleanOperationTool extends AbstractTool {
3
+ name = 'modeler_boolean_operation';
4
+ description = 'Performs a CSG (Constructive Solid Geometry) boolean operation (union, subtract, intersect) between baseMeshName and toolMeshName, with optional non-destructive mode and edge Bevel Modifier (chamfer/fillet).';
5
+ parameters = {
6
+ type: 'object',
7
+ properties: {
8
+ operation: { type: 'string', enum: ['union', 'subtract', 'intersect'] },
9
+ baseMeshName: {
10
+ type: 'string',
11
+ description: 'Name (or ID) of the base/target mesh in the scene.',
12
+ },
13
+ toolMeshName: {
14
+ type: 'string',
15
+ description: 'Name (or ID) of the tool/cutter mesh in the scene.',
16
+ },
17
+ newName: {
18
+ type: 'string',
19
+ description: 'Optional name for the resulting mesh.',
20
+ },
21
+ keepToolMesh: {
22
+ type: 'boolean',
23
+ description: 'If true, keeps the tool mesh in the scene instead of disposing it (default false).',
24
+ },
25
+ nonDestructive: {
26
+ type: 'boolean',
27
+ description: 'If true (default true), preserves the underlying base mesh snapshot so bevels and boolean cuts can be adjusted or reverted non-destructively.',
28
+ },
29
+ bevelWidth: {
30
+ type: 'number',
31
+ description: 'Optional bevel radius/width in meters (e.g. 0.03) to round sharp boolean intersection edges non-destructively.',
32
+ },
33
+ bevelSegments: {
34
+ type: 'integer',
35
+ minimum: 1,
36
+ maximum: 4,
37
+ description: 'Number of bevel segments (1 = chamfer, 2..4 = smooth rounded fillet). Default 2.',
38
+ },
39
+ angleThresholdDeg: {
40
+ type: 'number',
41
+ description: 'Minimum crease angle in degrees to bevel (default 30).',
42
+ },
43
+ },
44
+ required: ['operation', 'baseMeshName', 'toolMeshName'],
45
+ };
46
+ async execute(args, context) {
47
+ const baseId = args.baseMeshName || args.baseMeshId;
48
+ const toolId = args.toolMeshName || args.toolMeshId;
49
+ const op = (args.operation || 'subtract');
50
+ const keepTool = !!args.keepToolMesh;
51
+ const nonDestructive = args.nonDestructive !== false;
52
+ const bevelWidth = Number(args.bevelWidth) || 0;
53
+ const bevelSegments = Number(args.bevelSegments) || 2;
54
+ const angleThresholdDeg = Number(args.angleThresholdDeg) || 30;
55
+ const baseMesh = context.findMeshByNameOrId(baseId);
56
+ const toolMesh = context.findMeshByNameOrId(toolId);
57
+ if (!baseMesh) {
58
+ throw new Error(`Base mesh "${baseId}" not found in scene.`);
59
+ }
60
+ if (!toolMesh) {
61
+ throw new Error(`Tool mesh "${toolId}" not found in scene.`);
62
+ }
63
+ const resultMesh = await context.service.performCSGOperation(baseMesh, toolMesh, op, keepTool, {
64
+ nonDestructive,
65
+ bevelWidth,
66
+ bevelSegments,
67
+ angleThresholdDeg,
68
+ });
69
+ if (!resultMesh) {
70
+ throw new Error(`CSG ${op} failed between "${baseMesh.name}" and "${toolMesh.name}".`);
71
+ }
72
+ if (args.newName && typeof args.newName === 'string') {
73
+ resultMesh.name = args.newName.replace(/\s+/g, '_');
74
+ }
75
+ const ndMeta = resultMesh.metadata?.nonDestructiveCSG;
76
+ return JSON.stringify({
77
+ status: 'ok',
78
+ operation: op,
79
+ resultMeshName: resultMesh.name,
80
+ vertices: resultMesh.getTotalVertices(),
81
+ nonDestructive: !!ndMeta?.isNonDestructive,
82
+ bevelApplied: bevelWidth > 0,
83
+ sharpEdgeCount: ndMeta?.bevel?.sharpEdgeCount || 0,
84
+ });
85
+ }
86
+ }
@@ -0,0 +1,78 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class BuildVoxelMeshTool extends AbstractTool {
4
+ readonly name = "modeler_build_voxel_mesh";
5
+ readonly description = "Builds a 3D voxel model from a material palette, box regions, and/or individual voxel coordinates, automatically merging blocks by material.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ name: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ voxelSize: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ palette: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ boxes: {
22
+ type: string;
23
+ description: string;
24
+ items: {
25
+ type: string;
26
+ properties: {
27
+ minX: {
28
+ type: string;
29
+ };
30
+ minY: {
31
+ type: string;
32
+ };
33
+ minZ: {
34
+ type: string;
35
+ };
36
+ maxX: {
37
+ type: string;
38
+ };
39
+ maxY: {
40
+ type: string;
41
+ };
42
+ maxZ: {
43
+ type: string;
44
+ };
45
+ paletteKey: {
46
+ type: string;
47
+ };
48
+ };
49
+ required: string[];
50
+ };
51
+ };
52
+ voxels: {
53
+ type: string;
54
+ description: string;
55
+ items: {
56
+ type: string;
57
+ properties: {
58
+ x: {
59
+ type: string;
60
+ };
61
+ y: {
62
+ type: string;
63
+ };
64
+ z: {
65
+ type: string;
66
+ };
67
+ paletteKey: {
68
+ type: string;
69
+ };
70
+ };
71
+ required: string[];
72
+ };
73
+ };
74
+ };
75
+ required: string[];
76
+ };
77
+ execute(args: any, context: ToolExecutionContext): string;
78
+ }
@@ -0,0 +1,170 @@
1
+ import { Mesh, MeshBuilder } from '@babylonjs/core';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class BuildVoxelMeshTool extends AbstractTool {
4
+ name = 'modeler_build_voxel_mesh';
5
+ description = 'Builds a 3D voxel model from a material palette, box regions, and/or individual voxel coordinates, automatically merging blocks by material.';
6
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ name: { type: 'string', description: 'Name of the resulting voxel mesh.' },
10
+ voxelSize: { type: 'number', description: 'World size of 1 voxel cube (default 0.5).' },
11
+ palette: {
12
+ type: 'object',
13
+ description: 'Map of paletteKey -> { color: "#hex", roughness?: number, metallic?: number } (e.g. { "stone": { "color": "#888888" } }).',
14
+ },
15
+ boxes: {
16
+ type: 'array',
17
+ description: 'Filled rectangular box regions of voxels: { minX, minY, minZ, maxX, maxY, maxZ, paletteKey }.',
18
+ items: {
19
+ type: 'object',
20
+ properties: {
21
+ minX: { type: 'number' },
22
+ minY: { type: 'number' },
23
+ minZ: { type: 'number' },
24
+ maxX: { type: 'number' },
25
+ maxY: { type: 'number' },
26
+ maxZ: { type: 'number' },
27
+ paletteKey: { type: 'string' },
28
+ },
29
+ required: ['minX', 'minY', 'minZ', 'maxX', 'maxY', 'maxZ', 'paletteKey'],
30
+ },
31
+ },
32
+ voxels: {
33
+ type: 'array',
34
+ description: 'Individual voxel coordinates: { x, y, z, paletteKey }.',
35
+ items: {
36
+ type: 'object',
37
+ properties: {
38
+ x: { type: 'number' },
39
+ y: { type: 'number' },
40
+ z: { type: 'number' },
41
+ paletteKey: { type: 'string' },
42
+ },
43
+ required: ['x', 'y', 'z', 'paletteKey'],
44
+ },
45
+ },
46
+ },
47
+ required: ['name', 'palette'],
48
+ };
49
+ execute(args, context) {
50
+ const meshName = (args.name || 'voxel_model').replace(/\s+/g, '_');
51
+ const voxelSize = Math.max(0.05, Number(args.voxelSize) || 0.5);
52
+ const paletteObj = args.palette || { default: { color: '#58a6ff' } };
53
+ // Map coordinate "x,y,z" -> paletteKey so overlapping definitions overwrite cleanly
54
+ const grid = new Map();
55
+ if (Array.isArray(args.boxes)) {
56
+ for (const b of args.boxes) {
57
+ const sVec = b.start ? this.parseVec3(b.start, 0) : null;
58
+ const eVec = b.end ? this.parseVec3(b.end, 0) : null;
59
+ const x1 = sVec ? sVec.x : Number(b.minX) || 0;
60
+ const x2 = eVec ? eVec.x : Number(b.maxX) || 0;
61
+ const y1 = sVec ? sVec.y : Number(b.minY) || 0;
62
+ const y2 = eVec ? eVec.y : Number(b.maxY) || 0;
63
+ const z1 = sVec ? sVec.z : Number(b.minZ) || 0;
64
+ const z2 = eVec ? eVec.z : Number(b.maxZ) || 0;
65
+ const minX = Math.min(x1, x2);
66
+ const maxX = Math.max(x1, x2);
67
+ const minY = Math.min(y1, y2);
68
+ const maxY = Math.max(y1, y2);
69
+ const minZ = Math.min(z1, z2);
70
+ const maxZ = Math.max(z1, z2);
71
+ const key = String(b.paletteKey || b.type || Object.keys(paletteObj)[0] || 'default');
72
+ for (let x = minX; x <= maxX; x++) {
73
+ for (let y = minY; y <= maxY; y++) {
74
+ for (let z = minZ; z <= maxZ; z++) {
75
+ if (grid.size > 15000)
76
+ break;
77
+ grid.set(`${x},${y},${z}`, key);
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ if (Array.isArray(args.voxels)) {
84
+ for (const v of args.voxels) {
85
+ if (grid.size > 15000)
86
+ break;
87
+ const x = Math.round(Number(v.x ?? v.pos?.[0]) || 0);
88
+ const y = Math.round(Number(v.y ?? v.pos?.[1]) || 0);
89
+ const z = Math.round(Number(v.z ?? v.pos?.[2]) || 0);
90
+ const key = String(v.paletteKey || v.type || Object.keys(paletteObj)[0] || 'default');
91
+ grid.set(`${x},${y},${z}`, key);
92
+ }
93
+ }
94
+ if (grid.size === 0) {
95
+ throw new Error('No voxels or box regions provided for modeler_build_voxel_mesh.');
96
+ }
97
+ // Group voxel meshes by paletteKey
98
+ const byPalette = new Map();
99
+ let culledInteriorVoxels = 0;
100
+ for (const [coord, palKey] of grid.entries()) {
101
+ // Cull completely interior hidden voxels that have all 6 neighbors occupied
102
+ const [x, y, z] = coord.split(',').map(Number);
103
+ const isInterior = grid.has(`${x + 1},${y},${z}`) &&
104
+ grid.has(`${x - 1},${y},${z}`) &&
105
+ grid.has(`${x},${y + 1},${z}`) &&
106
+ grid.has(`${x},${y - 1},${z}`) &&
107
+ grid.has(`${x},${y},${z + 1}`) &&
108
+ grid.has(`${x},${y},${z - 1}`);
109
+ if (isInterior) {
110
+ culledInteriorVoxels++;
111
+ continue;
112
+ }
113
+ let list = byPalette.get(palKey);
114
+ if (!list) {
115
+ list = [];
116
+ byPalette.set(palKey, list);
117
+ }
118
+ list.push([x, y, z]);
119
+ }
120
+ const paletteMeshes = [];
121
+ for (const [palKey, coords] of byPalette.entries()) {
122
+ const palDef = paletteObj[palKey] || { color: '#58a6ff' };
123
+ const mat = context.getOrCreateMaterial(`vox_${meshName}_${palKey}`, palDef.color, palDef.roughness ?? 0.65, palDef.metallic ?? 0.05);
124
+ const cubes = [];
125
+ for (const [vx, vy, vz] of coords) {
126
+ const c = MeshBuilder.CreateBox('v', { size: voxelSize }, context.scene);
127
+ c.position.set(vx * voxelSize, (vy + 0.5) * voxelSize, vz * voxelSize);
128
+ c.computeWorldMatrix(true);
129
+ cubes.push(c);
130
+ }
131
+ if (cubes.length > 0) {
132
+ const palMerged = Mesh.MergeMeshes(cubes, true, true);
133
+ if (palMerged) {
134
+ palMerged.name = `${meshName}_${palKey}`;
135
+ palMerged.material = mat;
136
+ paletteMeshes.push(palMerged);
137
+ }
138
+ }
139
+ }
140
+ let finalVoxelMesh = null;
141
+ if (paletteMeshes.length === 1) {
142
+ finalVoxelMesh = paletteMeshes[0];
143
+ finalVoxelMesh.name = meshName;
144
+ }
145
+ else if (paletteMeshes.length > 1) {
146
+ finalVoxelMesh = Mesh.MergeMeshes(paletteMeshes, true, true, undefined, false, true);
147
+ if (finalVoxelMesh) {
148
+ finalVoxelMesh.name = meshName;
149
+ }
150
+ }
151
+ if (!finalVoxelMesh) {
152
+ throw new Error('Failed to merge voxel geometry.');
153
+ }
154
+ context.registerCreatedMesh(finalVoxelMesh);
155
+ context.service.centerMeshPivot(finalVoxelMesh);
156
+ // Align bottom to Y = 0
157
+ finalVoxelMesh.computeWorldMatrix(true);
158
+ const minY = finalVoxelMesh.getBoundingInfo().boundingBox.minimumWorld.y;
159
+ finalVoxelMesh.position.y -= minY;
160
+ finalVoxelMesh.computeWorldMatrix(true);
161
+ return JSON.stringify({
162
+ status: 'ok',
163
+ meshName: finalVoxelMesh.name,
164
+ voxelCount: grid.size,
165
+ solidVoxels: grid.size - culledInteriorVoxels,
166
+ culledInteriorVoxels,
167
+ vertices: finalVoxelMesh.getTotalVertices(),
168
+ });
169
+ }
170
+ }
@@ -0,0 +1,75 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class CloneArrayTool extends AbstractTool {
4
+ readonly name = "modeler_clone_array";
5
+ readonly description = "Clones an existing mesh in a linear or radial array pattern (e.g. pillars, gear teeth, stairs, fence posts, windows) and optionally merges them.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ sourceMeshName: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ mode: {
14
+ type: string;
15
+ enum: string[];
16
+ description: string;
17
+ };
18
+ count: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ offset: {
23
+ type: string;
24
+ description: string;
25
+ properties: {
26
+ x: {
27
+ type: string;
28
+ };
29
+ y: {
30
+ type: string;
31
+ };
32
+ z: {
33
+ type: string;
34
+ };
35
+ };
36
+ };
37
+ radius: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ center: {
42
+ type: string;
43
+ description: string;
44
+ properties: {
45
+ x: {
46
+ type: string;
47
+ };
48
+ y: {
49
+ type: string;
50
+ };
51
+ z: {
52
+ type: string;
53
+ };
54
+ };
55
+ };
56
+ arcDegrees: {
57
+ type: string;
58
+ description: string;
59
+ };
60
+ rotateWithAngle: {
61
+ type: string;
62
+ description: string;
63
+ };
64
+ mergeResult: {
65
+ type: string;
66
+ description: string;
67
+ };
68
+ mergedName: {
69
+ type: string;
70
+ };
71
+ };
72
+ required: string[];
73
+ };
74
+ execute(args: any, context: ToolExecutionContext): string;
75
+ }