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,115 @@
1
+ import { Mesh, Vector3 } from '@babylonjs/core';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class CloneArrayTool extends AbstractTool {
4
+ name = 'modeler_clone_array';
5
+ 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
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ sourceMeshName: { type: 'string', description: 'Name of the mesh to clone.' },
10
+ mode: { type: 'string', enum: ['linear', 'radial'], description: 'Array pattern mode.' },
11
+ count: { type: 'number', description: 'Total number of items in the array (2 to 64).' },
12
+ offset: {
13
+ type: 'object',
14
+ description: 'For linear mode: step offset { x, y, z } between each clone.',
15
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
16
+ },
17
+ radius: {
18
+ type: 'number',
19
+ description: 'For radial mode: distance from center in the XZ plane.',
20
+ },
21
+ center: {
22
+ type: 'object',
23
+ description: 'For radial mode: center point { x, y, z } (default {0,0,0}).',
24
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
25
+ },
26
+ arcDegrees: {
27
+ type: 'number',
28
+ description: 'For radial mode: total angle span in degrees (default 360).',
29
+ },
30
+ rotateWithAngle: {
31
+ type: 'boolean',
32
+ description: 'For radial mode: rotate each clone around Y to face outward/inward (default true).',
33
+ },
34
+ mergeResult: {
35
+ type: 'boolean',
36
+ description: 'If true, merges all clones (and source) into a single mesh.',
37
+ },
38
+ mergedName: { type: 'string' },
39
+ },
40
+ required: ['sourceMeshName', 'mode', 'count'],
41
+ };
42
+ execute(args, context) {
43
+ const source = context.findMeshByNameOrId(args.sourceMeshName);
44
+ if (!source) {
45
+ throw new Error(`Source mesh "${args.sourceMeshName}" not found.`);
46
+ }
47
+ const count = Math.max(2, Math.min(64, Math.round(Number(args.count) || 2)));
48
+ const mode = args.mode === 'radial' ? 'radial' : 'linear';
49
+ const createdClones = [source];
50
+ if (mode === 'linear') {
51
+ const offVec = this.parseVec3(args.offset, 0);
52
+ const ox = offVec.x;
53
+ const oy = offVec.y;
54
+ const oz = offVec.z;
55
+ for (let i = 1; i < count; i++) {
56
+ const clone = source.clone(`${source.name}_arr_${i}`, source.parent);
57
+ if (clone) {
58
+ clone.position.set(source.position.x + ox * i, source.position.y + oy * i, source.position.z + oz * i);
59
+ context.registerCreatedMesh(clone);
60
+ createdClones.push(clone);
61
+ }
62
+ }
63
+ }
64
+ else {
65
+ const radius = args.radius !== undefined ? Number(args.radius) : 2.0;
66
+ const centerVec = args.center ? this.parseVec3(args.center, 0) : new Vector3(0, source.position.y, 0);
67
+ const cx = centerVec.x;
68
+ const cy = centerVec.y;
69
+ const cz = centerVec.z;
70
+ const totalDeg = Number(args.arcDegrees) || 360;
71
+ const rotateWithAngle = args.rotateWithAngle !== false;
72
+ // Position source at index 0 on the circle
73
+ source.position.set(cx + radius, cy, cz);
74
+ if (rotateWithAngle) {
75
+ source.rotationQuaternion = null;
76
+ source.rotation.y = 0;
77
+ }
78
+ source.computeWorldMatrix(true);
79
+ for (let i = 1; i < count; i++) {
80
+ const angleRad = (((totalDeg / count) * i) * Math.PI) / 180;
81
+ const clone = source.clone(`${source.name}_rad_${i}`, source.parent);
82
+ if (clone) {
83
+ clone.position.set(cx + Math.cos(angleRad) * radius, cy, cz + Math.sin(angleRad) * radius);
84
+ if (rotateWithAngle) {
85
+ clone.rotationQuaternion = null;
86
+ clone.rotation.y = -angleRad;
87
+ }
88
+ context.registerCreatedMesh(clone);
89
+ createdClones.push(clone);
90
+ }
91
+ }
92
+ }
93
+ if (args.mergeResult && createdClones.length > 1) {
94
+ const merged = Mesh.MergeMeshes(createdClones, true, true, undefined, false, true);
95
+ if (merged) {
96
+ merged.name = (args.mergedName || args.newName || `${source.name}_array`).replace(/\s+/g, '_');
97
+ for (const c of createdClones) {
98
+ const idx = context.service.importedMeshes.indexOf(c);
99
+ if (idx !== -1)
100
+ context.service.importedMeshes.splice(idx, 1);
101
+ }
102
+ context.registerCreatedMesh(merged);
103
+ return JSON.stringify({
104
+ status: 'ok',
105
+ mergedMeshName: merged.name,
106
+ count,
107
+ });
108
+ }
109
+ }
110
+ return JSON.stringify({
111
+ status: 'ok',
112
+ createdMeshes: createdClones.map((m) => m.name),
113
+ });
114
+ }
115
+ }
@@ -0,0 +1,118 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class CreateArchTool extends AbstractTool {
4
+ readonly name = "modeler_create_arch";
5
+ readonly description = "Creates a freestanding architectural arch or portal standing on Y = 0 (bottom-aligned), complete with side piers, plinth bases, impost capitals, curved voussoir arch ring, and protruding keystone. Supports Roman round, Gothic pointed, segmental, horseshoe, and flat styles.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ name: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ style: {
14
+ type: string;
15
+ enum: string[];
16
+ description: string;
17
+ };
18
+ span: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ pierHeight: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ pierWidth: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ rise: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ thickness: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ depth: {
39
+ type: string;
40
+ description: string;
41
+ };
42
+ segments: {
43
+ type: string;
44
+ minimum: number;
45
+ maximum: number;
46
+ description: string;
47
+ };
48
+ keystone: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ impostCap: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ position: {
57
+ type: string;
58
+ description: string;
59
+ properties: {
60
+ x: {
61
+ type: string;
62
+ };
63
+ y: {
64
+ type: string;
65
+ };
66
+ z: {
67
+ type: string;
68
+ };
69
+ };
70
+ };
71
+ rotationDegrees: {
72
+ type: string;
73
+ properties: {
74
+ x: {
75
+ type: string;
76
+ };
77
+ y: {
78
+ type: string;
79
+ };
80
+ z: {
81
+ type: string;
82
+ };
83
+ };
84
+ };
85
+ scaling: {
86
+ type: string;
87
+ properties: {
88
+ x: {
89
+ type: string;
90
+ };
91
+ y: {
92
+ type: string;
93
+ };
94
+ z: {
95
+ type: string;
96
+ };
97
+ };
98
+ };
99
+ color: {
100
+ type: string;
101
+ description: string;
102
+ };
103
+ roughness: {
104
+ type: string;
105
+ description: string;
106
+ };
107
+ metallic: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ materialName: {
112
+ type: string;
113
+ description: string;
114
+ };
115
+ };
116
+ };
117
+ execute(args: any, context: ToolExecutionContext): string;
118
+ }
@@ -0,0 +1,89 @@
1
+ import { buildArchMesh } from '../../geometry/architecture';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class CreateArchTool extends AbstractTool {
4
+ name = 'modeler_create_arch';
5
+ description = 'Creates a freestanding architectural arch or portal standing on Y = 0 (bottom-aligned), complete with side piers, plinth bases, impost capitals, curved voussoir arch ring, and protruding keystone. Supports Roman round, Gothic pointed, segmental, horseshoe, and flat styles.';
6
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ name: { type: 'string', description: 'Descriptive name for the arch mesh.' },
10
+ style: {
11
+ type: 'string',
12
+ enum: ['round', 'pointed', 'segmental', 'horseshoe', 'flat'],
13
+ description: 'Arch profile style: "round" (Roman semicircle), "pointed" (Gothic lancet), "segmental" (shallow), "horseshoe" (Moorish), or "flat". Default: "round".',
14
+ },
15
+ span: { type: 'number', description: 'Inner clear opening width between piers in meters (default: 2.0).' },
16
+ pierHeight: { type: 'number', description: 'Height of vertical side piers up to the arch spring line in meters (default: 1.8; set 0 for arch ring only).' },
17
+ pierWidth: { type: 'number', description: 'Width of each side pier in meters (default: 0.35).' },
18
+ rise: { type: 'number', description: 'Arch height above the pier spring line in meters (default: span/2 for round, 0.65*span for pointed).' },
19
+ thickness: { type: 'number', description: 'Radial thickness of the arch ring in meters (default: 0.35).' },
20
+ depth: { type: 'number', description: 'Depth of the arch along Z-axis in meters (default: 0.4).' },
21
+ segments: { type: 'integer', minimum: 6, maximum: 48, description: 'Curve segments along the arch ring (default: 16).' },
22
+ keystone: { type: 'boolean', description: 'Whether to add a protruding keystone at the crown (default: true).' },
23
+ impostCap: { type: 'boolean', description: 'Whether to add molded impost capitals at the top of the piers (default: true).' },
24
+ position: {
25
+ type: 'object',
26
+ description: 'Base center position { x, y, z } in meters.',
27
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
28
+ },
29
+ rotationDegrees: {
30
+ type: 'object',
31
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
32
+ },
33
+ scaling: {
34
+ type: 'object',
35
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
36
+ },
37
+ color: { type: 'string', description: 'Hex color string, e.g. "#cbbba0".' },
38
+ roughness: { type: 'number', description: 'PBR roughness (default: 0.7).' },
39
+ metallic: { type: 'number', description: 'PBR metallic (default: 0.02).' },
40
+ materialName: { type: 'string', description: 'Optional existing material name.' },
41
+ },
42
+ };
43
+ execute(args, context) {
44
+ const baseName = String(args.name || 'stone_arch').replace(/\s+/g, '_');
45
+ const uniqueName = context.findMeshByNameOrId(baseName)
46
+ ? `${baseName}_${Date.now().toString().slice(-4)}`
47
+ : baseName;
48
+ const mesh = buildArchMesh(context.scene, uniqueName, {
49
+ style: args.style,
50
+ span: args.span,
51
+ pierHeight: args.pierHeight,
52
+ pierWidth: args.pierWidth,
53
+ rise: args.rise,
54
+ thickness: args.thickness,
55
+ depth: args.depth,
56
+ segments: args.segments,
57
+ keystone: args.keystone,
58
+ impostCap: args.impostCap,
59
+ });
60
+ mesh.material = context.getOrCreateMaterial(args.materialName, args.color || '#cbbba0', args.roughness ?? 0.7, args.metallic ?? 0.02, uniqueName);
61
+ context.applyTransformArgs(mesh, args);
62
+ context.registerCreatedMesh(mesh);
63
+ const bb = mesh.getBoundingInfo().boundingBox;
64
+ return JSON.stringify({
65
+ status: 'ok',
66
+ meshName: mesh.name,
67
+ style: args.style || 'round',
68
+ vertices: mesh.getTotalVertices(),
69
+ triangles: Math.floor(mesh.getTotalIndices() / 3),
70
+ bounds: {
71
+ min: {
72
+ x: Number(bb.minimumWorld.x.toFixed(3)),
73
+ y: Number(bb.minimumWorld.y.toFixed(3)),
74
+ z: Number(bb.minimumWorld.z.toFixed(3)),
75
+ },
76
+ max: {
77
+ x: Number(bb.maximumWorld.x.toFixed(3)),
78
+ y: Number(bb.maximumWorld.y.toFixed(3)),
79
+ z: Number(bb.maximumWorld.z.toFixed(3)),
80
+ },
81
+ size: {
82
+ x: Number((bb.maximumWorld.x - bb.minimumWorld.x).toFixed(3)),
83
+ y: Number((bb.maximumWorld.y - bb.minimumWorld.y).toFixed(3)),
84
+ z: Number((bb.maximumWorld.z - bb.minimumWorld.z).toFixed(3)),
85
+ },
86
+ },
87
+ });
88
+ }
89
+ }
@@ -0,0 +1,114 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class CreateColumnTool extends AbstractTool {
4
+ readonly name = "modeler_create_column";
5
+ readonly description = "Creates a classical or modern architectural column standing on Y = 0 up to Y = height, featuring a square plinth, torus/scotia molded base, tapered shaft with classical entasis curvature and carved vertical flutes, necking ring, echinus capital, and square abacus (plus Ionic volutes when order=\"ionic\").";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ name: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ order: {
14
+ type: string;
15
+ enum: string[];
16
+ description: string;
17
+ };
18
+ height: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ radius: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ taper: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ entasis: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ flutes: {
35
+ type: string;
36
+ minimum: number;
37
+ maximum: number;
38
+ description: string;
39
+ };
40
+ fluteDepth: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ position: {
45
+ type: string;
46
+ description: string;
47
+ properties: {
48
+ x: {
49
+ type: string;
50
+ };
51
+ y: {
52
+ type: string;
53
+ };
54
+ z: {
55
+ type: string;
56
+ };
57
+ };
58
+ };
59
+ rotationDegrees: {
60
+ type: string;
61
+ properties: {
62
+ x: {
63
+ type: string;
64
+ };
65
+ y: {
66
+ type: string;
67
+ };
68
+ z: {
69
+ type: string;
70
+ };
71
+ };
72
+ };
73
+ scaling: {
74
+ type: string;
75
+ properties: {
76
+ x: {
77
+ type: string;
78
+ };
79
+ y: {
80
+ type: string;
81
+ };
82
+ z: {
83
+ type: string;
84
+ };
85
+ };
86
+ };
87
+ color: {
88
+ type: string;
89
+ description: string;
90
+ };
91
+ roughness: {
92
+ type: string;
93
+ description: string;
94
+ };
95
+ metallic: {
96
+ type: string;
97
+ description: string;
98
+ };
99
+ materialName: {
100
+ type: string;
101
+ description: string;
102
+ };
103
+ texturePrompt: {
104
+ type: string;
105
+ description: string;
106
+ };
107
+ uvScale: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ };
112
+ };
113
+ execute(args: any, context: ToolExecutionContext): string;
114
+ }
@@ -0,0 +1,105 @@
1
+ import { buildColumnMesh } from '../../geometry/architecture';
2
+ import { AbstractTool } from '../AbstractTool';
3
+ export class CreateColumnTool extends AbstractTool {
4
+ name = 'modeler_create_column';
5
+ description = 'Creates a classical or modern architectural column standing on Y = 0 up to Y = height, featuring a square plinth, torus/scotia molded base, tapered shaft with classical entasis curvature and carved vertical flutes, necking ring, echinus capital, and square abacus (plus Ionic volutes when order="ionic").';
6
+ parameters = {
7
+ type: 'object',
8
+ properties: {
9
+ name: { type: 'string', description: 'Descriptive name for the column mesh.' },
10
+ order: {
11
+ type: 'string',
12
+ enum: ['doric', 'tuscan', 'ionic', 'corinthian', 'modern'],
13
+ description: 'Architectural order: "doric" (20 flutes), "tuscan" (smooth classical), "ionic" (24 flutes + volute scrolls), "corinthian" (24 flutes + tall flared capital), or "modern" (clean cylindrical pillar). Default: "doric".',
14
+ },
15
+ height: { type: 'number', description: 'Total column height from base (Y=0) to top of abacus in meters (default: 3.2).' },
16
+ radius: { type: 'number', description: 'Lower shaft radius in meters (default: 0.24).' },
17
+ taper: { type: 'number', description: 'Top-to-bottom shaft radius ratio (default: 0.85).' },
18
+ entasis: { type: 'number', description: 'Convex mid-shaft bulge factor (default: 0.025).' },
19
+ flutes: { type: 'integer', minimum: 0, maximum: 40, description: 'Number of carved vertical concave flutes (0 for smooth shaft, 20 for Doric, 24 for Ionic/Corinthian).' },
20
+ fluteDepth: { type: 'number', description: 'Depth of each carved flute in meters (default: auto from radius).' },
21
+ position: {
22
+ type: 'object',
23
+ description: 'Base center position { x, y, z } in meters.',
24
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
25
+ },
26
+ rotationDegrees: {
27
+ type: 'object',
28
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
29
+ },
30
+ scaling: {
31
+ type: 'object',
32
+ properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
33
+ },
34
+ color: { type: 'string', description: 'Hex color string, e.g. "#e8e4dc".' },
35
+ roughness: { type: 'number', description: 'PBR roughness (default: 0.55).' },
36
+ metallic: { type: 'number', description: 'PBR metallic (default: 0.02).' },
37
+ materialName: { type: 'string', description: 'Optional existing material name.' },
38
+ texturePrompt: {
39
+ type: 'string',
40
+ description: 'Optional natural language prompt to generate and apply an AI PBR texture (e.g. "White fluted Carrara marble", "Weathered Roman limestone").',
41
+ },
42
+ uvScale: {
43
+ type: 'number',
44
+ description: 'Texture UV tiling scale factor (default: 2.0).',
45
+ },
46
+ },
47
+ };
48
+ execute(args, context) {
49
+ const baseName = String(args.name || 'classical_column').replace(/\s+/g, '_');
50
+ const uniqueName = context.findMeshByNameOrId(baseName)
51
+ ? `${baseName}_${Date.now().toString().slice(-4)}`
52
+ : baseName;
53
+ const mesh = buildColumnMesh(context.scene, uniqueName, {
54
+ order: args.order,
55
+ height: args.height,
56
+ radius: args.radius,
57
+ taper: args.taper,
58
+ entasis: args.entasis,
59
+ flutes: args.flutes,
60
+ fluteDepth: args.fluteDepth,
61
+ radialSegments: args.radialSegments,
62
+ });
63
+ mesh.material = context.getOrCreateMaterial(args.materialName, args.color || '#e8e4dc', args.roughness ?? 0.55, args.metallic ?? 0.02, uniqueName);
64
+ context.applyTransformArgs(mesh, args);
65
+ context.registerCreatedMesh(mesh);
66
+ if (args.texturePrompt && context.service.aiTextureGenerator) {
67
+ context.service.aiTextureGenerator
68
+ .generateTexture({
69
+ prompt: args.texturePrompt,
70
+ applyToMesh: mesh.name,
71
+ uvScale: typeof args.uvScale === 'number' ? args.uvScale : 2.0,
72
+ useAI: true,
73
+ fallbackToProcedural: true,
74
+ })
75
+ .catch((err) => {
76
+ console.warn(`Texture generation for ${mesh.name} failed:`, err);
77
+ });
78
+ }
79
+ const bb = mesh.getBoundingInfo().boundingBox;
80
+ return JSON.stringify({
81
+ status: 'ok',
82
+ meshName: mesh.name,
83
+ order: args.order || 'doric',
84
+ vertices: mesh.getTotalVertices(),
85
+ triangles: Math.floor(mesh.getTotalIndices() / 3),
86
+ bounds: {
87
+ min: {
88
+ x: Number(bb.minimumWorld.x.toFixed(3)),
89
+ y: Number(bb.minimumWorld.y.toFixed(3)),
90
+ z: Number(bb.minimumWorld.z.toFixed(3)),
91
+ },
92
+ max: {
93
+ x: Number(bb.maximumWorld.x.toFixed(3)),
94
+ y: Number(bb.maximumWorld.y.toFixed(3)),
95
+ z: Number(bb.maximumWorld.z.toFixed(3)),
96
+ },
97
+ size: {
98
+ x: Number((bb.maximumWorld.x - bb.minimumWorld.x).toFixed(3)),
99
+ y: Number((bb.maximumWorld.y - bb.minimumWorld.y).toFixed(3)),
100
+ z: Number((bb.maximumWorld.z - bb.minimumWorld.z).toFixed(3)),
101
+ },
102
+ },
103
+ });
104
+ }
105
+ }
@@ -0,0 +1,87 @@
1
+ import { AbstractTool } from '../AbstractTool';
2
+ import { ToolExecutionContext } from '../ToolExecutionContext';
3
+ export declare class CreateLatheTool extends AbstractTool {
4
+ readonly name = "modeler_create_lathe";
5
+ readonly description = "Creates a rotationally symmetric 3D mesh (vase, goblet, pillar, bottle, chess piece, dome, wheel) by revolving a 2D profile in the XY plane (x >= 0 as radius, y as height) around the Y axis.";
6
+ readonly parameters: {
7
+ type: string;
8
+ properties: {
9
+ name: {
10
+ type: string;
11
+ };
12
+ shape: {
13
+ type: string;
14
+ description: string;
15
+ items: {
16
+ type: string;
17
+ properties: {
18
+ x: {
19
+ type: string;
20
+ };
21
+ y: {
22
+ type: string;
23
+ };
24
+ z: {
25
+ type: string;
26
+ };
27
+ };
28
+ required: string[];
29
+ };
30
+ };
31
+ radius: {
32
+ type: string;
33
+ description: string;
34
+ };
35
+ tessellation: {
36
+ type: string;
37
+ description: string;
38
+ };
39
+ arc: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ position: {
44
+ type: string;
45
+ properties: {
46
+ x: {
47
+ type: string;
48
+ };
49
+ y: {
50
+ type: string;
51
+ };
52
+ z: {
53
+ type: string;
54
+ };
55
+ };
56
+ };
57
+ rotationDegrees: {
58
+ type: string;
59
+ properties: {
60
+ x: {
61
+ type: string;
62
+ };
63
+ y: {
64
+ type: string;
65
+ };
66
+ z: {
67
+ type: string;
68
+ };
69
+ };
70
+ };
71
+ color: {
72
+ type: string;
73
+ };
74
+ roughness: {
75
+ type: string;
76
+ };
77
+ metallic: {
78
+ type: string;
79
+ };
80
+ materialName: {
81
+ type: string;
82
+ };
83
+ };
84
+ required: string[];
85
+ };
86
+ execute(args: any, context: ToolExecutionContext): string;
87
+ }