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,39 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ export class SubdivideMeshTool extends AbstractTool {
3
+ name = 'modeler_subdivide_mesh';
4
+ description = 'Subdivides each triangle of the mesh into 4 smaller subtriangles, increasing geometric resolution uniformly.';
5
+ parameters = {
6
+ type: 'object',
7
+ properties: {
8
+ meshName: {
9
+ type: 'string',
10
+ description: 'Name or ID of the mesh in the scene to subdivide.',
11
+ },
12
+ iterations: {
13
+ type: 'integer',
14
+ minimum: 1,
15
+ maximum: 3,
16
+ description: 'Number of subdivision iterations (default: 1).',
17
+ },
18
+ },
19
+ required: ['meshName'],
20
+ };
21
+ async execute(args, context) {
22
+ const meshName = String(args.meshName || '').trim();
23
+ const mesh = context.findMeshByNameOrId(meshName);
24
+ if (!mesh) {
25
+ throw new Error(`Mesh "${meshName}" not found in scene.`);
26
+ }
27
+ const iters = Math.max(1, Math.min(Number(args.iterations) || 1, 3));
28
+ for (let i = 0; i < iters; i++) {
29
+ context.service.subdivideMesh(mesh);
30
+ }
31
+ return JSON.stringify({
32
+ status: 'ok',
33
+ meshName: mesh.name,
34
+ iterations: iters,
35
+ totalVertices: mesh.getTotalVertices(),
36
+ totalIndices: mesh.getTotalIndices(),
37
+ });
38
+ }
39
+ }
@@ -0,0 +1,78 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class TransformMeshTool extends AbstractTool {
4
+ readonly name = "modeler_transform_mesh";
5
+ readonly description = "Updates an existing mesh in the scene: position, rotationDegrees, scaling, name, visibility, snapToGround, centerPivot, or bakeTransform.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ meshName: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ newName: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ position: {
18
+ type: string;
19
+ properties: {
20
+ x: {
21
+ type: string;
22
+ };
23
+ y: {
24
+ type: string;
25
+ };
26
+ z: {
27
+ type: string;
28
+ };
29
+ };
30
+ };
31
+ rotationDegrees: {
32
+ type: string;
33
+ properties: {
34
+ x: {
35
+ type: string;
36
+ };
37
+ y: {
38
+ type: string;
39
+ };
40
+ z: {
41
+ type: string;
42
+ };
43
+ };
44
+ };
45
+ scaling: {
46
+ type: string;
47
+ properties: {
48
+ x: {
49
+ type: string;
50
+ };
51
+ y: {
52
+ type: string;
53
+ };
54
+ z: {
55
+ type: string;
56
+ };
57
+ };
58
+ };
59
+ visible: {
60
+ type: string;
61
+ };
62
+ snapToGround: {
63
+ type: string;
64
+ description: string;
65
+ };
66
+ centerPivot: {
67
+ type: string;
68
+ description: string;
69
+ };
70
+ bakeTransform: {
71
+ type: string;
72
+ description: string;
73
+ };
74
+ };
75
+ required: string[];
76
+ };
77
+ execute(args: any, context: ToolExecutionContext): string;
78
+ }
@@ -0,0 +1,69 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ export class TransformMeshTool extends AbstractTool {
3
+ name = 'modeler_transform_mesh';
4
+ description = 'Updates an existing mesh in the scene: position, rotationDegrees, scaling, name, visibility, snapToGround, centerPivot, or bakeTransform.';
5
+ parameters = {
6
+ type: 'object',
7
+ properties: {
8
+ meshName: { type: 'string', description: 'Name of the existing mesh to update.' },
9
+ newName: { type: 'string', description: 'Optional new name for the mesh.' },
10
+ position: {
11
+ type: 'object',
12
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
13
+ },
14
+ rotationDegrees: {
15
+ type: 'object',
16
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
17
+ },
18
+ scaling: {
19
+ type: 'object',
20
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
21
+ },
22
+ visible: { type: 'boolean' },
23
+ snapToGround: {
24
+ type: 'boolean',
25
+ description: 'If true, shifts the mesh vertically so its lowest point sits on Y=0.',
26
+ },
27
+ centerPivot: {
28
+ type: 'boolean',
29
+ description: 'If true, centers the mesh pivot to its visual bounding box center.',
30
+ },
31
+ bakeTransform: {
32
+ type: 'boolean',
33
+ description: 'If true, bakes current position/rotation/scale into vertex coordinates.',
34
+ },
35
+ },
36
+ required: ['meshName'],
37
+ };
38
+ execute(args, context) {
39
+ const mesh = context.findMeshByNameOrId(args.meshName);
40
+ if (!mesh) {
41
+ throw new Error(`Mesh "${args.meshName}" not found.`);
42
+ }
43
+ if (args.newName && typeof args.newName === 'string') {
44
+ mesh.name = args.newName.replace(/\s+/g, '_');
45
+ }
46
+ if (args.visible !== undefined) {
47
+ mesh.isVisible = !!args.visible;
48
+ }
49
+ context.applyTransformArgs(mesh, args);
50
+ if (args.centerPivot) {
51
+ context.service.centerMeshPivot(mesh);
52
+ }
53
+ if (args.snapToGround) {
54
+ mesh.computeWorldMatrix(true);
55
+ const lowestY = mesh.getBoundingInfo().boundingBox.minimumWorld.y;
56
+ mesh.position.y -= lowestY;
57
+ mesh.computeWorldMatrix(true);
58
+ }
59
+ if (args.bakeTransform) {
60
+ mesh.bakeCurrentTransformIntoVertices();
61
+ mesh.refreshBoundingInfo();
62
+ }
63
+ return JSON.stringify({
64
+ status: 'ok',
65
+ meshName: mesh.name,
66
+ position: { x: mesh.position.x, y: mesh.position.y, z: mesh.position.z },
67
+ });
68
+ }
69
+ }
@@ -0,0 +1,48 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class UVUnwrapTool extends AbstractTool {
4
+ readonly name = "modeler_uv_unwrap";
5
+ readonly description = "Performs Smart Seam Marking, LSCM/Angle-Based UV Unwrapping, Texel Density Normalization (px/m), and 2D UV Island Bin-Packing on a mesh.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ meshName: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ action: {
14
+ type: string;
15
+ enum: string[];
16
+ description: string;
17
+ };
18
+ method: {
19
+ type: string;
20
+ enum: string[];
21
+ description: string;
22
+ };
23
+ angleThresholdDeg: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ targetTexelDensity: {
28
+ type: string;
29
+ description: string;
30
+ };
31
+ textureResolution: {
32
+ type: string;
33
+ enum: number[];
34
+ description: string;
35
+ };
36
+ marginPx: {
37
+ type: string;
38
+ description: string;
39
+ };
40
+ rotateOptimal: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ };
45
+ required: string[];
46
+ };
47
+ execute(args: any, context: ToolExecutionContext): string;
48
+ }
@@ -0,0 +1,107 @@
1
+ import { Mesh } from '@babylonjs/core';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class UVUnwrapTool extends AbstractTool {
4
+ name = 'modeler_uv_unwrap';
5
+ description = 'Performs Smart Seam Marking, LSCM/Angle-Based UV Unwrapping, Texel Density Normalization (px/m), and 2D UV Island Bin-Packing on a mesh.';
6
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ meshName: {
10
+ type: 'string',
11
+ description: 'Name or ID of the target mesh in the scene.',
12
+ },
13
+ action: {
14
+ type: 'string',
15
+ enum: ['unwrap', 'mark_seams', 'normalize_texel_density', 'pack_islands'],
16
+ description: 'UV action to perform (default "unwrap", which marks smart seams, unwraps, equalizes texel density, and packs islands).',
17
+ },
18
+ method: {
19
+ type: 'string',
20
+ enum: ['smart_seams', 'angle_project', 'cylindrical'],
21
+ description: 'Unwrap projection method (default "smart_seams").',
22
+ },
23
+ angleThresholdDeg: {
24
+ type: 'number',
25
+ description: 'Seam crease angle threshold in degrees (default 60).',
26
+ },
27
+ targetTexelDensity: {
28
+ type: 'number',
29
+ description: 'Target Texel Density in pixels per meter (px/m), e.g. 512 or 1024.',
30
+ },
31
+ textureResolution: {
32
+ type: 'integer',
33
+ enum: [512, 1024, 2048, 4096],
34
+ description: 'Target texture map resolution in pixels (default 1024).',
35
+ },
36
+ marginPx: {
37
+ type: 'integer',
38
+ description: 'Island padding margin in pixels to prevent mipmap bleeding (default 6).',
39
+ },
40
+ rotateOptimal: {
41
+ type: 'boolean',
42
+ description: 'Whether to allow 90-degree island rotation for optimal bin-packing (default true).',
43
+ },
44
+ },
45
+ required: ['meshName'],
46
+ };
47
+ execute(args, context) {
48
+ const meshName = String(args.meshName || '').trim();
49
+ const mesh = context.findMeshByNameOrId(meshName);
50
+ if (!mesh || !(mesh instanceof Mesh)) {
51
+ throw new Error(`Mesh "${meshName}" not found in scene.`);
52
+ }
53
+ const action = args.action || 'unwrap';
54
+ const uvCtrl = context.service.uvUnwrapController;
55
+ const angleThresholdDeg = Number(args.angleThresholdDeg) || 60;
56
+ const textureResolution = Number(args.textureResolution) || 1024;
57
+ const marginPx = args.marginPx !== undefined ? Number(args.marginPx) : 6;
58
+ const rotateOptimal = args.rotateOptimal !== false;
59
+ const targetTexelDensity = Number(args.targetTexelDensity) || 0;
60
+ if (action === 'mark_seams') {
61
+ const res = uvCtrl.markSmartSeams(mesh, angleThresholdDeg);
62
+ const stats = uvCtrl.analyzeUVs(mesh, textureResolution);
63
+ return JSON.stringify({
64
+ status: 'ok',
65
+ action: 'mark_seams',
66
+ meshName: mesh.name,
67
+ seamEdgeCount: res.seamEdgeCount,
68
+ ...stats,
69
+ });
70
+ }
71
+ if (action === 'normalize_texel_density') {
72
+ const density = targetTexelDensity || 512;
73
+ const stats = uvCtrl.normalizeTexelDensity(mesh, density, textureResolution, false);
74
+ return JSON.stringify({
75
+ status: 'ok',
76
+ action: 'normalize_texel_density',
77
+ ...stats,
78
+ });
79
+ }
80
+ if (action === 'pack_islands') {
81
+ const stats = uvCtrl.packUVIslands(mesh, {
82
+ marginPx,
83
+ textureResolution,
84
+ rotateOptimal,
85
+ normalizeScale: true,
86
+ });
87
+ return JSON.stringify({
88
+ status: 'ok',
89
+ action: 'pack_islands',
90
+ ...stats,
91
+ });
92
+ }
93
+ const stats = uvCtrl.unwrapMesh(mesh, {
94
+ method: args.method || 'smart_seams',
95
+ angleThresholdDeg,
96
+ marginPx,
97
+ textureResolution,
98
+ targetTexelDensity: targetTexelDensity > 0 ? targetTexelDensity : undefined,
99
+ rotateOptimal,
100
+ });
101
+ return JSON.stringify({
102
+ status: 'ok',
103
+ action: 'unwrap',
104
+ ...stats,
105
+ });
106
+ }
107
+ }
@@ -0,0 +1,60 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class VoxelPainterTool extends AbstractTool {
4
+ readonly name = "modeler_paint_voxels";
5
+ readonly description = "Interactively adds, paints, or erases voxel blocks, or loads RLE voxel level data with palette or texture atlas support, and bakes them into an optimized 3D scene mesh.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ action: {
10
+ type: string;
11
+ enum: string[];
12
+ description: string;
13
+ };
14
+ voxels: {
15
+ type: string;
16
+ description: string;
17
+ items: {
18
+ type: string;
19
+ properties: {
20
+ x: {
21
+ type: string;
22
+ };
23
+ y: {
24
+ type: string;
25
+ };
26
+ z: {
27
+ type: string;
28
+ };
29
+ paletteId: {
30
+ type: string;
31
+ };
32
+ };
33
+ required: string[];
34
+ };
35
+ };
36
+ paletteId: {
37
+ type: string;
38
+ description: string;
39
+ };
40
+ atlasId: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ voxelSize: {
45
+ type: string;
46
+ description: string;
47
+ };
48
+ meshName: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ rleData: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ };
57
+ required: string[];
58
+ };
59
+ execute(args: any, context: ToolExecutionContext): string;
60
+ }
@@ -0,0 +1,153 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ export class VoxelPainterTool extends AbstractTool {
3
+ name = 'modeler_paint_voxels';
4
+ description = 'Interactively adds, paints, or erases voxel blocks, or loads RLE voxel level data with palette or texture atlas support, and bakes them into an optimized 3D scene mesh.';
5
+ parameters = {
6
+ type: 'object',
7
+ properties: {
8
+ action: {
9
+ type: 'string',
10
+ enum: ['paint', 'erase', 'clear', 'load_data', 'bake_mesh', 'use_atlas', 'get_state'],
11
+ description: 'Voxel operation to perform.',
12
+ },
13
+ voxels: {
14
+ type: 'array',
15
+ description: 'Array of voxel coordinates { x, y, z, paletteId? } to paint or erase.',
16
+ items: {
17
+ type: 'object',
18
+ properties: {
19
+ x: { type: 'number' },
20
+ y: { type: 'number' },
21
+ z: { type: 'number' },
22
+ paletteId: { type: 'string' },
23
+ },
24
+ required: ['x', 'y', 'z'],
25
+ },
26
+ },
27
+ paletteId: {
28
+ type: 'string',
29
+ description: 'Palette ID (e.g. "stone", "dirt", "grass", "wood", or an atlas tile ID) to paint with.',
30
+ },
31
+ atlasId: {
32
+ type: 'string',
33
+ description: 'Optional TextureAtlas ID to activate for voxel painting.',
34
+ },
35
+ voxelSize: {
36
+ type: 'number',
37
+ description: 'Size of each voxel block (default 1.0).',
38
+ },
39
+ meshName: {
40
+ type: 'string',
41
+ description: 'Name for the baked mesh when action is "bake_mesh".',
42
+ },
43
+ rleData: {
44
+ type: 'object',
45
+ description: 'Platformia3D compatible RLE voxel data { version: 1, palette: [...], runs: [...] }.',
46
+ },
47
+ },
48
+ required: ['action'],
49
+ };
50
+ execute(args, context) {
51
+ const painter = context.service.voxelPainter;
52
+ const action = String(args.action || 'get_state').toLowerCase();
53
+ if (args.voxelSize !== undefined) {
54
+ painter.setVoxelSize(Number(args.voxelSize));
55
+ }
56
+ if (args.paletteId) {
57
+ painter.setPaletteItem(String(args.paletteId));
58
+ }
59
+ if (args.atlasId !== undefined) {
60
+ painter.useTextureAtlas(args.atlasId ? String(args.atlasId) : null);
61
+ }
62
+ switch (action) {
63
+ case 'paint': {
64
+ const voxels = Array.isArray(args.voxels) ? args.voxels : [];
65
+ let count = 0;
66
+ for (const v of voxels) {
67
+ const key = `${v.x},${v.y},${v.z}`;
68
+ painter.blocks.set(key, {
69
+ x: Math.round(Number(v.x) || 0),
70
+ y: Math.round(Number(v.y) || 0),
71
+ z: Math.round(Number(v.z) || 0),
72
+ paletteId: String(v.paletteId || args.paletteId || painter.currentPaletteId),
73
+ });
74
+ count++;
75
+ }
76
+ painter.updateThinInstances();
77
+ return JSON.stringify({
78
+ status: 'ok',
79
+ action: 'paint',
80
+ paintedCount: count,
81
+ totalBlocks: painter.blocks.size,
82
+ });
83
+ }
84
+ case 'erase': {
85
+ const voxels = Array.isArray(args.voxels) ? args.voxels : [];
86
+ let count = 0;
87
+ for (const v of voxels) {
88
+ const key = `${v.x},${v.y},${v.z}`;
89
+ if (painter.blocks.delete(key)) {
90
+ count++;
91
+ }
92
+ }
93
+ painter.updateThinInstances();
94
+ return JSON.stringify({
95
+ status: 'ok',
96
+ action: 'erase',
97
+ erasedCount: count,
98
+ totalBlocks: painter.blocks.size,
99
+ });
100
+ }
101
+ case 'clear': {
102
+ painter.clear();
103
+ return JSON.stringify({
104
+ status: 'ok',
105
+ action: 'clear',
106
+ totalBlocks: 0,
107
+ });
108
+ }
109
+ case 'load_data': {
110
+ const data = args.rleData || args;
111
+ const total = painter.loadVoxelData(data);
112
+ return JSON.stringify({
113
+ status: 'ok',
114
+ action: 'load_data',
115
+ totalBlocks: total,
116
+ });
117
+ }
118
+ case 'bake':
119
+ case 'bake_mesh': {
120
+ const name = String(args.meshName || 'Voxel_Model');
121
+ const mesh = painter.bakeToMesh(name);
122
+ if (!mesh) {
123
+ throw new Error('Failed to bake voxel model into scene mesh.');
124
+ }
125
+ return JSON.stringify({
126
+ status: 'ok',
127
+ action: 'bake_mesh',
128
+ meshName: mesh.name,
129
+ vertices: mesh.getTotalVertices(),
130
+ });
131
+ }
132
+ case 'use_atlas': {
133
+ painter.useTextureAtlas(args.atlasId ? String(args.atlasId) : null);
134
+ return JSON.stringify({
135
+ status: 'ok',
136
+ action: 'use_atlas',
137
+ currentAtlasId: painter.currentAtlasId,
138
+ });
139
+ }
140
+ case 'get_state':
141
+ default: {
142
+ return JSON.stringify({
143
+ status: 'ok',
144
+ totalBlocks: painter.blocks.size,
145
+ voxelSize: painter.voxelSize,
146
+ currentPaletteId: painter.currentPaletteId,
147
+ currentAtlasId: painter.currentAtlasId,
148
+ palette: Array.from(painter.palette.keys()),
149
+ });
150
+ }
151
+ }
152
+ }
153
+ }
@@ -0,0 +1,44 @@
1
+ export * from './GetSceneInfoTool';
2
+ export * from './CreatePrimitiveTool';
3
+ export * from './ExtrudePolygonTool';
4
+ export * from './ExtrudeShapeTool';
5
+ export * from './CreateLatheTool';
6
+ export * from './CreateTubeTool';
7
+ export * from './BooleanOperationTool';
8
+ export * from './CreateMaterialTool';
9
+ export * from './ApplyMaterialTool';
10
+ export * from './AutoUVMappingTool';
11
+ export * from './TransformMeshTool';
12
+ export * from './CloneArrayTool';
13
+ export * from './MergeMeshesTool';
14
+ export * from './SeparateMeshTool';
15
+ export * from './DeleteMeshTool';
16
+ export * from './BuildVoxelMeshTool';
17
+ export * from './ExecuteBabylonCodeTool';
18
+ export * from './VoxelPainterTool';
19
+ export * from './SolidifyMeshTool';
20
+ export * from './SubdivideMeshTool';
21
+ export * from './SubDSmoothTool';
22
+ export * from './FacetExtrudeTool';
23
+ export * from './FacetInsetTool';
24
+ export * from './FacetArcTool';
25
+ export * from './FacetCutThroughTool';
26
+ export * from './SpawnBaseMeshTool';
27
+ export * from './RetopologizeMeshTool';
28
+ export * from './SculptMeshTool';
29
+ export * from './CreateSdfMeshTool';
30
+ export * from './CreateRoundedBoxTool';
31
+ export * from './CreateWallTool';
32
+ export * from './CreateArchTool';
33
+ export * from './CreateColumnTool';
34
+ export * from './CreateMoldingTool';
35
+ export * from './CreateStairsTool';
36
+ export * from './CreateRoofTool';
37
+ export * from './PlanModelTool';
38
+ export * from './GenerateNeuralMeshTool';
39
+ export * from './UVUnwrapTool';
40
+ export * from './BakeTexturesTool';
41
+ export * from './RigWeightTool';
42
+ export * from './GenerateTextureTool';
43
+ export * from './CreateTextMeshTool';
44
+ export * from './DecalTool';
@@ -0,0 +1,44 @@
1
+ export * from './GetSceneInfoTool';
2
+ export * from './CreatePrimitiveTool';
3
+ export * from './ExtrudePolygonTool';
4
+ export * from './ExtrudeShapeTool';
5
+ export * from './CreateLatheTool';
6
+ export * from './CreateTubeTool';
7
+ export * from './BooleanOperationTool';
8
+ export * from './CreateMaterialTool';
9
+ export * from './ApplyMaterialTool';
10
+ export * from './AutoUVMappingTool';
11
+ export * from './TransformMeshTool';
12
+ export * from './CloneArrayTool';
13
+ export * from './MergeMeshesTool';
14
+ export * from './SeparateMeshTool';
15
+ export * from './DeleteMeshTool';
16
+ export * from './BuildVoxelMeshTool';
17
+ export * from './ExecuteBabylonCodeTool';
18
+ export * from './VoxelPainterTool';
19
+ export * from './SolidifyMeshTool';
20
+ export * from './SubdivideMeshTool';
21
+ export * from './SubDSmoothTool';
22
+ export * from './FacetExtrudeTool';
23
+ export * from './FacetInsetTool';
24
+ export * from './FacetArcTool';
25
+ export * from './FacetCutThroughTool';
26
+ export * from './SpawnBaseMeshTool';
27
+ export * from './RetopologizeMeshTool';
28
+ export * from './SculptMeshTool';
29
+ export * from './CreateSdfMeshTool';
30
+ export * from './CreateRoundedBoxTool';
31
+ export * from './CreateWallTool';
32
+ export * from './CreateArchTool';
33
+ export * from './CreateColumnTool';
34
+ export * from './CreateMoldingTool';
35
+ export * from './CreateStairsTool';
36
+ export * from './CreateRoofTool';
37
+ export * from './PlanModelTool';
38
+ export * from './GenerateNeuralMeshTool';
39
+ export * from './UVUnwrapTool';
40
+ export * from './BakeTexturesTool';
41
+ export * from './RigWeightTool';
42
+ export * from './GenerateTextureTool';
43
+ export * from './CreateTextMeshTool';
44
+ export * from './DecalTool';
@@ -0,0 +1,18 @@
1
+ import { AbstractEditorTool } from './AbstractEditorTool';
2
+ /**
3
+ * AI Mesh Agent Tool.
4
+ * Text-to-Mesh and Image-to-Mesh generator and conversational scene assistant.
5
+ */
6
+ export declare class AIAgentEditorTool extends AbstractEditorTool {
7
+ readonly name = "ai_agent";
8
+ readonly dialogId = "dialog-ai-agent";
9
+ readonly triggerButtonId = "btnToggleAIAgent";
10
+ readonly menuId = "menuTools";
11
+ readonly menuLabel = "AI Mesh Agent";
12
+ readonly icon = "bot";
13
+ readonly order = 2;
14
+ readonly defaultOpen = false;
15
+ readonly description = "Text-to-Mesh and Image-to-Mesh generator and conversational scene assistant.";
16
+ readonly helpText: string;
17
+ isActive(app: any): boolean;
18
+ }