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,5 @@
1
+ /**
2
+ * Built-in 3D editor panel tools.
3
+ * Delegated to decentralized individual tool classes in `./editor/`.
4
+ */
5
+ export * from './editor';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Built-in 3D editor panel tools.
3
+ * Delegated to decentralized individual tool classes in `./editor/`.
4
+ */
5
+ export * from './editor';
@@ -0,0 +1,8 @@
1
+ export * from './ToolInterface';
2
+ export * from './ToolExecutionContext';
3
+ export * from './AbstractTool';
4
+ export * from './ToolRegistry';
5
+ export * from './textureUtils';
6
+ export * from './builtin';
7
+ export * from './editor';
8
+ export * from './editorTools';
@@ -0,0 +1,8 @@
1
+ export * from './ToolInterface';
2
+ export * from './ToolExecutionContext';
3
+ export * from './AbstractTool';
4
+ export * from './ToolRegistry';
5
+ export * from './textureUtils';
6
+ export * from './builtin';
7
+ export * from './editor';
8
+ export * from './editorTools';
@@ -0,0 +1,18 @@
1
+ export type ProceduralTextureType = 'wood' | 'stone' | 'sand' | 'tiles' | 'grass' | 'fabric' | 'marble' | 'brick' | 'metal' | 'checker' | 'grid' | 'noise' | 'gradient';
2
+ export interface ProceduralTextureOptions {
3
+ type: ProceduralTextureType;
4
+ primaryColor?: string;
5
+ secondaryColor?: string;
6
+ scale?: number;
7
+ }
8
+ export interface ProceduralNormalMapOptions {
9
+ type: ProceduralTextureType;
10
+ scale?: number;
11
+ strength?: number;
12
+ invertY?: boolean;
13
+ }
14
+ export declare const FALLBACK_FLAT_NORMAL_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
15
+ export declare function sampleProceduralHeight(type: ProceduralTextureType, x: number, y: number, size: number, scale: number): number;
16
+ export declare function generateProceduralTextureDataUrl(opts: ProceduralTextureOptions): string;
17
+ export declare function generateProceduralNormalMapDataUrl(opts: ProceduralNormalMapOptions): string;
18
+ export declare function generateNormalMapFromCanvas(sourceCanvas: HTMLCanvasElement, strength?: number, invertY?: boolean): string;
@@ -0,0 +1,288 @@
1
+ export const FALLBACK_FLAT_NORMAL_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==';
2
+ function hexToRgb(hex) {
3
+ const clean = (hex || '#888888').replace(/^#/, '');
4
+ const full = clean.length === 3
5
+ ? clean
6
+ .split('')
7
+ .map((c) => c + c)
8
+ .join('')
9
+ : clean.padEnd(6, '8');
10
+ const num = parseInt(full.slice(0, 6), 16) || 0x888888;
11
+ return [(num >> 16) & 255, (num >> 8) & 255, num & 255];
12
+ }
13
+ // Simple deterministic pseudo-random noise helper
14
+ function pseudoNoise(x, y) {
15
+ const n = Math.sin(x * 12.9898 + y * 78.233) * 43758.5453;
16
+ return n - Math.floor(n);
17
+ }
18
+ function smoothNoise(x, y) {
19
+ const ix = Math.floor(x);
20
+ const iy = Math.floor(y);
21
+ const fx = x - ix;
22
+ const fy = y - iy;
23
+ const u = fx * fx * (3 - 2 * fx);
24
+ const v = fy * fy * (3 - 2 * fy);
25
+ const a = pseudoNoise(ix, iy);
26
+ const b = pseudoNoise(ix + 1, iy);
27
+ const c = pseudoNoise(ix, iy + 1);
28
+ const d = pseudoNoise(ix + 1, iy + 1);
29
+ return a * (1 - u) * (1 - v) + b * u * (1 - v) + c * (1 - u) * v + d * u * v;
30
+ }
31
+ export function sampleProceduralHeight(type, x, y, size, scale) {
32
+ const nx = (x / size) * scale;
33
+ const ny = (y / size) * scale;
34
+ switch (type) {
35
+ case 'wood': {
36
+ const n = smoothNoise(nx * 8, ny * 2) * 0.35;
37
+ return 0.5 + 0.5 * Math.sin((nx * 18 + n * 6) * Math.PI * 2);
38
+ }
39
+ case 'sand': {
40
+ const grain = pseudoNoise(x, y) * 0.45;
41
+ const wave = smoothNoise(nx * 8, ny * 4) * 0.35;
42
+ const ripple = 0.5 + 0.5 * Math.sin((nx * 14 + wave * 3) * Math.PI * 2);
43
+ return Math.min(1, Math.max(0, grain * 0.5 + ripple * 0.3 + wave * 0.2));
44
+ }
45
+ case 'tiles': {
46
+ const count = Math.max(2, Math.round(6 * scale));
47
+ const step = size / count;
48
+ const border = 3;
49
+ const isGrout = x % step < border || y % step < border;
50
+ const n = (smoothNoise(x * 0.1, y * 0.1) - 0.5) * 0.1;
51
+ return isGrout ? 1.0 : Math.min(1, Math.max(0, 0.2 + n));
52
+ }
53
+ case 'grass': {
54
+ const n1 = smoothNoise(nx * 16, ny * 16) * 0.5;
55
+ const n2 = smoothNoise(nx * 32, ny * 32) * 0.3;
56
+ const blades = pseudoNoise(x, y) * 0.2;
57
+ return Math.min(1, Math.max(0, n1 + n2 + blades));
58
+ }
59
+ case 'fabric': {
60
+ const freq = Math.max(4, Math.round(30 * scale));
61
+ const wx = Math.sin((x / size) * freq * Math.PI * 2);
62
+ const wy = Math.sin((y / size) * freq * Math.PI * 2);
63
+ return 0.5 + 0.25 * wx - 0.25 * wy;
64
+ }
65
+ case 'stone':
66
+ case 'noise': {
67
+ const n1 = smoothNoise(nx * 12, ny * 12) * 0.6;
68
+ const n2 = smoothNoise(nx * 28, ny * 28) * 0.3;
69
+ const n3 = pseudoNoise(x, y) * 0.1;
70
+ return Math.min(1, Math.max(0, n1 + n2 + n3));
71
+ }
72
+ case 'marble': {
73
+ const turb = smoothNoise(nx * 6, ny * 6) * 0.5 +
74
+ smoothNoise(nx * 12, ny * 12) * 0.25 +
75
+ smoothNoise(nx * 24, ny * 24) * 0.125;
76
+ return Math.pow(0.5 + 0.5 * Math.sin((nx * 6 + ny * 4 + turb * 5) * Math.PI), 0.65);
77
+ }
78
+ case 'brick': {
79
+ const rows = Math.round(8 * scale);
80
+ const cols = Math.round(4 * scale);
81
+ const rowH = size / rows;
82
+ const colW = size / cols;
83
+ const rowIdx = Math.floor(y / rowH);
84
+ const offsetX = (rowIdx % 2) * (colW * 0.5);
85
+ const localY = y % rowH;
86
+ const localX = (x + offsetX) % colW;
87
+ const mortar = localY < 3 || localX < 3;
88
+ const n = (smoothNoise(x * 0.15, y * 0.15) - 0.5) * 0.18;
89
+ return mortar ? 1.0 : Math.min(0.85, Math.max(0, 0.15 + n));
90
+ }
91
+ case 'metal': {
92
+ const streak = smoothNoise(x * 0.03, y * 0.8) * 0.6 + pseudoNoise(0, y) * 0.25;
93
+ const spec = 0.5 + 0.5 * Math.sin((nx * 2 + ny * 0.5) * Math.PI * 2);
94
+ return Math.min(1, Math.max(0, streak * 0.6 + spec * 0.4));
95
+ }
96
+ case 'checker': {
97
+ const cells = Math.max(2, Math.round(8 * scale));
98
+ const cx = Math.floor((x / size) * cells);
99
+ const cy = Math.floor((y / size) * cells);
100
+ return (cx + cy) % 2 === 0 ? 0 : 1;
101
+ }
102
+ case 'grid': {
103
+ const cells = Math.max(2, Math.round(8 * scale));
104
+ const cellSize = size / cells;
105
+ const isLine = x % cellSize < 2 || y % cellSize < 2;
106
+ return isLine ? 1 : 0;
107
+ }
108
+ case 'gradient':
109
+ default: {
110
+ return y / (size - 1);
111
+ }
112
+ }
113
+ }
114
+ export function generateProceduralTextureDataUrl(opts) {
115
+ const FALLBACK_1X1_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR4nGP4DwQACfsD/fteaysAAAAASUVORK5CYII=';
116
+ if (typeof document === 'undefined') {
117
+ return FALLBACK_1X1_PNG;
118
+ }
119
+ try {
120
+ const size = 256;
121
+ const canvas = document.createElement('canvas');
122
+ canvas.width = size;
123
+ canvas.height = size;
124
+ const ctx = canvas.getContext('2d');
125
+ if (!ctx)
126
+ return FALLBACK_1X1_PNG;
127
+ const defaults = {
128
+ wood: ['#8b5a2b', '#5c3a1b'],
129
+ stone: ['#888c94', '#585c64'],
130
+ sand: ['#c2b280', '#9c8c5a'],
131
+ tiles: ['#e2e8f0', '#94a3b8'],
132
+ grass: ['#4d7c0f', '#2d5a07'],
133
+ fabric: ['#3b82f6', '#1d4ed8'],
134
+ marble: ['#f0eee9', '#9aa0a8'],
135
+ brick: ['#a64232', '#c8c2b8'],
136
+ metal: ['#9aa2ad', '#626a75'],
137
+ checker: ['#e6edf3', '#2d333b'],
138
+ grid: ['#1f242c', '#58a6ff'],
139
+ noise: ['#999999', '#444444'],
140
+ gradient: ['#58a6ff', '#1f6feb'],
141
+ };
142
+ const [defPrimary, defSecondary] = defaults[opts.type] || ['#cccccc', '#666666'];
143
+ const c1 = hexToRgb(opts.primaryColor || defPrimary);
144
+ const c2 = hexToRgb(opts.secondaryColor || defSecondary);
145
+ const scale = Math.max(0.25, opts.scale || 1.0);
146
+ const imgData = ctx.createImageData(size, size);
147
+ const data = imgData.data;
148
+ for (let y = 0; y < size; y++) {
149
+ for (let x = 0; x < size; x++) {
150
+ const t = sampleProceduralHeight(opts.type, x, y, size, scale);
151
+ const idx = (y * size + x) * 4;
152
+ data[idx] = Math.round(c1[0] * (1 - t) + c2[0] * t);
153
+ data[idx + 1] = Math.round(c1[1] * (1 - t) + c2[1] * t);
154
+ data[idx + 2] = Math.round(c1[2] * (1 - t) + c2[2] * t);
155
+ data[idx + 3] = 255;
156
+ }
157
+ }
158
+ ctx.putImageData(imgData, 0, 0);
159
+ const dataUrl = canvas.toDataURL('image/png');
160
+ return dataUrl && dataUrl.startsWith('data:image') ? dataUrl : FALLBACK_1X1_PNG;
161
+ }
162
+ catch {
163
+ return FALLBACK_1X1_PNG;
164
+ }
165
+ }
166
+ export function generateProceduralNormalMapDataUrl(opts) {
167
+ if (typeof document === 'undefined') {
168
+ return FALLBACK_FLAT_NORMAL_PNG;
169
+ }
170
+ try {
171
+ const size = 256;
172
+ const canvas = document.createElement('canvas');
173
+ canvas.width = size;
174
+ canvas.height = size;
175
+ const ctx = canvas.getContext('2d');
176
+ if (!ctx)
177
+ return FALLBACK_FLAT_NORMAL_PNG;
178
+ const scale = Math.max(0.25, opts.scale || 1.0);
179
+ const strength = typeof opts.strength === 'number' ? opts.strength : 2.0;
180
+ const invertY = !!opts.invertY;
181
+ // 1. Compute heights
182
+ const heights = new Float32Array(size * size);
183
+ for (let y = 0; y < size; y++) {
184
+ for (let x = 0; x < size; x++) {
185
+ heights[y * size + x] = sampleProceduralHeight(opts.type, x, y, size, scale);
186
+ }
187
+ }
188
+ // 2. Compute normal map with central differences
189
+ const imgData = ctx.createImageData(size, size);
190
+ const data = imgData.data;
191
+ for (let y = 0; y < size; y++) {
192
+ const yUp = (y - 1 + size) % size;
193
+ const yDown = (y + 1) % size;
194
+ for (let x = 0; x < size; x++) {
195
+ const xLeft = (x - 1 + size) % size;
196
+ const xRight = (x + 1) % size;
197
+ const hL = heights[y * size + xLeft];
198
+ const hR = heights[y * size + xRight];
199
+ const hU = heights[yUp * size + x];
200
+ const hD = heights[yDown * size + x];
201
+ const hCenter = heights[y * size + x];
202
+ const dx = (hR - hL) * strength;
203
+ const dy = (hD - hU) * strength * (invertY ? -1 : 1);
204
+ const dz = 1.0;
205
+ const len = Math.sqrt(dx * dx + dy * dy + dz * dz) || 1.0;
206
+ const nx = -dx / len;
207
+ const ny = -dy / len;
208
+ const nz = dz / len;
209
+ const idx = (y * size + x) * 4;
210
+ data[idx] = Math.round((nx * 0.5 + 0.5) * 255);
211
+ data[idx + 1] = Math.round((ny * 0.5 + 0.5) * 255);
212
+ data[idx + 2] = Math.round((nz * 0.5 + 0.5) * 255);
213
+ // Alpha stores height for Babylon Parallax / Parallax Occlusion Mapping
214
+ data[idx + 3] = Math.round(Math.min(1, Math.max(0, hCenter)) * 255);
215
+ }
216
+ }
217
+ ctx.putImageData(imgData, 0, 0);
218
+ const dataUrl = canvas.toDataURL('image/png');
219
+ return dataUrl && dataUrl.startsWith('data:image') ? dataUrl : FALLBACK_FLAT_NORMAL_PNG;
220
+ }
221
+ catch {
222
+ return FALLBACK_FLAT_NORMAL_PNG;
223
+ }
224
+ }
225
+ export function generateNormalMapFromCanvas(sourceCanvas, strength = 2.0, invertY = false) {
226
+ if (typeof document === 'undefined') {
227
+ return FALLBACK_FLAT_NORMAL_PNG;
228
+ }
229
+ try {
230
+ const w = sourceCanvas.width;
231
+ const h = sourceCanvas.height;
232
+ const srcCtx = sourceCanvas.getContext('2d');
233
+ if (!srcCtx)
234
+ return FALLBACK_FLAT_NORMAL_PNG;
235
+ const srcImgData = srcCtx.getImageData(0, 0, w, h);
236
+ const srcData = srcImgData.data;
237
+ // Convert luminance to height
238
+ const heights = new Float32Array(w * h);
239
+ for (let i = 0, len = w * h; i < len; i++) {
240
+ const idx = i * 4;
241
+ heights[i] = (srcData[idx] * 0.299 + srcData[idx + 1] * 0.587 + srcData[idx + 2] * 0.114) / 255.0;
242
+ }
243
+ const outCanvas = document.createElement('canvas');
244
+ outCanvas.width = w;
245
+ outCanvas.height = h;
246
+ const outCtx = outCanvas.getContext('2d');
247
+ if (!outCtx)
248
+ return FALLBACK_FLAT_NORMAL_PNG;
249
+ const outImgData = outCtx.createImageData(w, h);
250
+ const outData = outImgData.data;
251
+ for (let y = 0; y < h; y++) {
252
+ const yUp = (y - 1 + h) % h;
253
+ const yDown = (y + 1) % h;
254
+ for (let x = 0; x < w; x++) {
255
+ const xLeft = (x - 1 + w) % w;
256
+ const xRight = (x + 1) % w;
257
+ // Sobel filter for smooth gradient
258
+ const tl = heights[yUp * w + xLeft];
259
+ const t = heights[yUp * w + x];
260
+ const tr = heights[yUp * w + xRight];
261
+ const l = heights[y * w + xLeft];
262
+ const r = heights[y * w + xRight];
263
+ const bl = heights[yDown * w + xLeft];
264
+ const b = heights[yDown * w + x];
265
+ const br = heights[yDown * w + xRight];
266
+ const center = heights[y * w + x];
267
+ const dx = (tr + 2 * r + br - (tl + 2 * l + bl)) * (strength / 8);
268
+ const dy = (bl + 2 * b + br - (tl + 2 * t + tr)) * (strength / 8) * (invertY ? -1 : 1);
269
+ const dz = 1.0;
270
+ const len = Math.sqrt(dx * dx + dy * dy + dz * dz) || 1.0;
271
+ const nx = -dx / len;
272
+ const ny = -dy / len;
273
+ const nz = dz / len;
274
+ const idx = (y * w + x) * 4;
275
+ outData[idx] = Math.round((nx * 0.5 + 0.5) * 255);
276
+ outData[idx + 1] = Math.round((ny * 0.5 + 0.5) * 255);
277
+ outData[idx + 2] = Math.round((nz * 0.5 + 0.5) * 255);
278
+ outData[idx + 3] = 255;
279
+ }
280
+ }
281
+ outCtx.putImageData(outImgData, 0, 0);
282
+ const dataUrl = outCanvas.toDataURL('image/png');
283
+ return dataUrl && dataUrl.startsWith('data:image') ? dataUrl : FALLBACK_FLAT_NORMAL_PNG;
284
+ }
285
+ catch {
286
+ return FALLBACK_FLAT_NORMAL_PNG;
287
+ }
288
+ }
@@ -0,0 +1,164 @@
1
+ import { Nullable, Quaternion, TransformNode, Vector3, Mesh, AnimationGroup } from '@babylonjs/core';
2
+ export interface TextureOptimizationInfo {
3
+ name: string;
4
+ originalSize: number;
5
+ newSize: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface TransformSnapshot {
10
+ position: Vector3;
11
+ rotation: Vector3;
12
+ rotationQuaternion: Nullable<Quaternion>;
13
+ scaling: Vector3;
14
+ }
15
+ export interface ActionRecord {
16
+ name: string;
17
+ undo: () => void;
18
+ redo: () => void;
19
+ }
20
+ export type PrimitiveShape = 'Box' | 'Sphere' | 'Cylinder' | 'Cone' | 'Capsule' | 'Torus' | 'TorusKnot' | 'Plane' | 'Disc' | 'Ground' | 'Polyhedron';
21
+ export interface PrimitiveConfig {
22
+ shape: PrimitiveShape;
23
+ name?: string;
24
+ size?: number;
25
+ width?: number;
26
+ height?: number;
27
+ depth?: number;
28
+ diameter?: number;
29
+ thickness?: number;
30
+ subdivisions?: number;
31
+ tessellation?: number;
32
+ polyType?: number;
33
+ color?: string;
34
+ roughness?: number;
35
+ metallic?: number;
36
+ }
37
+ export type CSGOperationType = 'subtract' | 'union' | 'intersect' | 'slice';
38
+ export interface ExportOptions {
39
+ format: 'glb' | 'gltf' | 'obj' | 'stl' | 'babylon';
40
+ filename: string;
41
+ selectedOnly?: boolean;
42
+ }
43
+ export interface MeshEditorServiceEvents {
44
+ onSelectionChanged?: (nodes: TransformNode[], activeMesh: Mesh | null, subMeshId: number | null) => void;
45
+ onSceneModified?: () => void;
46
+ onHistoryChanged?: (canUndo: boolean, canRedo: boolean) => void;
47
+ onStatusChanged?: (text: string, isBusy?: boolean) => void;
48
+ onToast?: (message: string, type: 'info' | 'success' | 'warning' | 'error') => void;
49
+ onModelLoaded?: (filename: string) => void;
50
+ onStatsUpdated?: (meshCount: number, polyCount: number) => void;
51
+ onFaceSelected?: (faceId: number | null, isQuad?: boolean) => void;
52
+ onVertexSelected?: (vertexIndex: number | null, position?: Vector3) => void;
53
+ onFacetEditModeChanged?: (mode: 'face' | 'vertex') => void;
54
+ onFacetEditorStateChanged?: (active: boolean) => void;
55
+ onAnimationsLoaded?: (names: string[], currentGroup: AnimationGroup | null) => void;
56
+ onAnimProgress?: (currentFrame: number) => void;
57
+ onExportModel?: (blob: Blob, filename: string, format: ExportOptions['format']) => Promise<boolean> | boolean;
58
+ }
59
+ export type Neural3DBackendId = 'trellis' | 'hunyuan3d' | 'hi3d';
60
+ export type Neural3DProtocol = 'omlx' | 'local_rest' | 'gradio' | 'fal' | 'replicate';
61
+ export interface Neural3DProviderConfig {
62
+ id: Neural3DBackendId;
63
+ name: string;
64
+ enabled: boolean;
65
+ protocol: Neural3DProtocol;
66
+ endpointUrl: string;
67
+ apiKey?: string;
68
+ modelId?: string;
69
+ }
70
+ export type Neural3DProvidersMap = Record<Neural3DBackendId, Neural3DProviderConfig>;
71
+ export type ImageGeneratorBackendId = 'pollinations' | 'openai' | 'imagen' | 'fal' | 'replicate' | 'sd_webui' | 'comfyui' | 'custom';
72
+ export type ImageGeneratorProtocol = 'pollinations' | 'openai' | 'imagen' | 'fal' | 'replicate' | 'sd_webui' | 'comfyui' | 'custom_rest';
73
+ export interface ImageGeneratorProviderConfig {
74
+ id: ImageGeneratorBackendId;
75
+ name: string;
76
+ enabled: boolean;
77
+ protocol: ImageGeneratorProtocol;
78
+ endpointUrl: string;
79
+ apiKey?: string;
80
+ modelId?: string;
81
+ }
82
+ export type ImageGeneratorProvidersMap = Record<ImageGeneratorBackendId, ImageGeneratorProviderConfig>;
83
+ export interface ImageGenerationRequest {
84
+ backend?: ImageGeneratorBackendId | 'auto';
85
+ prompt: string;
86
+ size?: number;
87
+ seamless?: boolean;
88
+ seed?: number;
89
+ enhancePrompt?: boolean;
90
+ signal?: AbortSignal;
91
+ }
92
+ export interface ImageGenerationResult {
93
+ providerId: ImageGeneratorBackendId;
94
+ providerName: string;
95
+ dataUrl: string;
96
+ width: number;
97
+ height: number;
98
+ }
99
+ export interface AIAgentEndpointConfig {
100
+ baseUrl: string;
101
+ apiKey: string;
102
+ model: string;
103
+ temperature?: number;
104
+ maxIterations?: number;
105
+ minPolygons?: number;
106
+ maxPolygons?: number;
107
+ createTextures?: boolean;
108
+ createNormalMaps?: boolean;
109
+ visualCritique?: boolean;
110
+ neural3DProviders?: Neural3DProvidersMap;
111
+ imageGeneratorEnabled?: boolean;
112
+ imageGeneratorActiveBackend?: ImageGeneratorBackendId | 'procedural';
113
+ imageGeneratorProviders?: ImageGeneratorProvidersMap;
114
+ }
115
+ export interface AIAgentSkillDefinition {
116
+ id: string;
117
+ name: string;
118
+ description: string;
119
+ instructions: string;
120
+ enabled: boolean;
121
+ }
122
+ export interface AIAgentToolExecutionStep {
123
+ id: string;
124
+ toolName: string;
125
+ args: Record<string, any>;
126
+ result: string;
127
+ isError?: boolean;
128
+ durationMs?: number;
129
+ }
130
+ export interface AIAgentChatMessage {
131
+ id: string;
132
+ role: 'user' | 'assistant' | 'system';
133
+ content: string;
134
+ images?: string[];
135
+ toolSteps?: AIAgentToolExecutionStep[];
136
+ timestamp: number;
137
+ }
138
+ export interface AIAgentRequestOptions {
139
+ prompt: string;
140
+ images?: string[];
141
+ mode?: 'create_or_update' | 'replace_scene';
142
+ includeViewportSnapshot?: boolean;
143
+ visualCritique?: boolean;
144
+ signal?: AbortSignal;
145
+ onStep?: (step: AIAgentToolExecutionStep) => void;
146
+ onStatus?: (statusText: string) => void;
147
+ }
148
+ export interface MeshEditorVoxelProjectState {
149
+ voxelSize: number;
150
+ paletteId: string;
151
+ atlasId?: string | null;
152
+ voxelData: any;
153
+ }
154
+ export interface MeshEditorProjectData {
155
+ version: number;
156
+ generator?: string;
157
+ timestamp?: number;
158
+ tools?: {
159
+ voxelPainter?: MeshEditorVoxelProjectState;
160
+ pathExtrusion?: any[];
161
+ pathWays?: any[];
162
+ [key: string]: any;
163
+ };
164
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,108 @@
1
+ import { Mesh, Nullable, Scene, Vector3 } from '@babylonjs/core';
2
+ import { MeshEditorService } from '../MeshEditorService';
3
+ export interface UVAnalysisResult {
4
+ meshName: string;
5
+ islandCount: number;
6
+ seamEdgeCount: number;
7
+ worldSurfaceAreaM2: number;
8
+ uvSurfaceArea: number;
9
+ texelDensityPxPerMeter: number;
10
+ uvCoveragePercent: number;
11
+ overlapDetected: boolean;
12
+ textureResolution: number;
13
+ }
14
+ export interface UVUnwrapOptions {
15
+ method?: 'smart_seams' | 'angle_project' | 'cubic' | 'cylindrical';
16
+ angleThresholdDeg?: number;
17
+ marginPx?: number;
18
+ textureResolution?: number;
19
+ targetTexelDensity?: number;
20
+ rotateOptimal?: boolean;
21
+ }
22
+ /**
23
+ * Controller for Smart Seam Marking, LSCM/Angle-Based UV Unwrapping,
24
+ * Texel Density Normalization (px/m), and 2D UV Island Bin-Packing.
25
+ */
26
+ export declare class UVUnwrapController {
27
+ service: MeshEditorService;
28
+ scene: Scene;
29
+ isActive: boolean;
30
+ seamPickMode: boolean;
31
+ angleThresholdDeg: number;
32
+ textureResolution: number;
33
+ targetTexelDensity: number;
34
+ marginPx: number;
35
+ rotateOptimal: boolean;
36
+ checkerPreviewActive: boolean;
37
+ private seamOverlayMesh;
38
+ private savedMaterials;
39
+ private checkerMaterial;
40
+ onStateChanged?: (isActive: boolean) => void;
41
+ onUVModified?: (mesh: Mesh, stats: UVAnalysisResult) => void;
42
+ constructor(service: MeshEditorService);
43
+ setActive(active: boolean): void;
44
+ getActiveTargetMesh(): Nullable<Mesh>;
45
+ /**
46
+ * Interactive 3D viewport click handler for manual seam edge marking.
47
+ */
48
+ private initPointerHandling;
49
+ /**
50
+ * Builds canonical vertex mapping so split vertices at identical 3D positions share topological edges.
51
+ */
52
+ private buildCanonicalVertices;
53
+ private makeEdgeKey;
54
+ /**
55
+ * Toggles the seam state of the triangle edge closest to `worldHitPoint`.
56
+ */
57
+ toggleNearestEdgeSeam(mesh: Mesh, worldHitPoint: Vector3, faceId?: number): boolean;
58
+ /**
59
+ * Automatically detects and marks Smart UV Seams along sharp crease angles, open boundaries,
60
+ * and cylindrical longitudinal seams.
61
+ */
62
+ markSmartSeams(mesh: Mesh, angleThresholdDeg?: number): {
63
+ seamEdgeCount: number;
64
+ seamKeys: string[];
65
+ };
66
+ clearSeams(mesh: Mesh): void;
67
+ clearSeamOverlay(): void;
68
+ /**
69
+ * Renders marked UV seams as a bright orange-red 3D wireframe overlay in the viewport.
70
+ */
71
+ refreshSeamOverlay(mesh: Mesh): void;
72
+ /**
73
+ * Performs Seam-Aware Chart Unwrapping, Texel Density Normalization, and 2D UV Island Bin-Packing.
74
+ */
75
+ unwrapMesh(mesh: Mesh, options?: UVUnwrapOptions): UVAnalysisResult;
76
+ /**
77
+ * Extracts connected 2D UV islands from the mesh's current UV buffer.
78
+ */
79
+ private extractUVIslands;
80
+ /**
81
+ * Normalizes Texel Density so all UV islands match a target Pixels-Per-Meter (px/m) resolution.
82
+ */
83
+ normalizeTexelDensity(mesh: Mesh, targetPxPerMeter?: number, textureResolution?: number, fitInsideZeroOne?: boolean): UVAnalysisResult;
84
+ /**
85
+ * Packs 2D UV islands into the [0, 1] x [0, 1] UV square using a Shelf / Skyline 2D Bin-Packer
86
+ * with pixel padding and optional 90-degree rotation optimization.
87
+ */
88
+ packUVIslands(mesh: Mesh, options?: {
89
+ marginPx?: number;
90
+ textureResolution?: number;
91
+ rotateOptimal?: boolean;
92
+ normalizeScale?: boolean;
93
+ }): UVAnalysisResult;
94
+ /**
95
+ * Computes comprehensive UV & Texel Density metrics for a mesh.
96
+ */
97
+ analyzeUVs(mesh: Mesh, textureResolution?: number): UVAnalysisResult;
98
+ /**
99
+ * Toggles a high-contrast numbered UV Checkerboard preview material on the selected mesh.
100
+ */
101
+ toggleCheckerPreview(mesh: Mesh, forceState?: boolean): boolean;
102
+ private createCheckerboardMaterial;
103
+ /**
104
+ * Renders the 2D UV map wireframe, islands, and grid into a <canvas> element.
105
+ */
106
+ renderUVLayoutToCanvas(mesh: Nullable<Mesh>, canvas: HTMLCanvasElement): void;
107
+ dispose(): void;
108
+ }