mesheditor 0.0.0-stage → 1.0.2
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.
- package/LICENSE +201 -0
- package/README.md +853 -2
- package/dist-lib/esm/AIAgentService.d.ts +107 -0
- package/dist-lib/esm/AIAgentService.d.ts.map +1 -0
- package/dist-lib/esm/AIAgentService.js +1471 -0
- package/dist-lib/esm/AIAgentService.js.map +1 -0
- package/dist-lib/esm/MeshEditorApp.d.ts +413 -0
- package/dist-lib/esm/MeshEditorApp.d.ts.map +1 -0
- package/dist-lib/esm/MeshEditorApp.js +9093 -0
- package/dist-lib/esm/MeshEditorApp.js.map +1 -0
- package/dist-lib/esm/MeshEditorService.d.ts +460 -0
- package/dist-lib/esm/MeshEditorService.d.ts.map +1 -0
- package/dist-lib/esm/MeshEditorService.js +7084 -0
- package/dist-lib/esm/MeshEditorService.js.map +1 -0
- package/dist-lib/esm/Neural3DGeneratorService.d.ts +89 -0
- package/dist-lib/esm/Neural3DGeneratorService.d.ts.map +1 -0
- package/dist-lib/esm/Neural3DGeneratorService.js +1398 -0
- package/dist-lib/esm/Neural3DGeneratorService.js.map +1 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.d.ts +17 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.d.ts.map +1 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.js +26 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.js.map +1 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.d.ts +33 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.d.ts.map +1 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.js +337 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.js.map +1 -0
- package/dist-lib/esm/adapters/HostAppAdapter.d.ts +55 -0
- package/dist-lib/esm/adapters/HostAppAdapter.d.ts.map +1 -0
- package/dist-lib/esm/adapters/HostAppAdapter.js +76 -0
- package/dist-lib/esm/adapters/HostAppAdapter.js.map +1 -0
- package/dist-lib/esm/adapters/PlatformAdapter.d.ts +99 -0
- package/dist-lib/esm/adapters/PlatformAdapter.d.ts.map +1 -0
- package/dist-lib/esm/adapters/PlatformAdapter.js +2 -0
- package/dist-lib/esm/adapters/PlatformAdapter.js.map +1 -0
- package/dist-lib/esm/adapters/index.d.ts +14 -0
- package/dist-lib/esm/adapters/index.d.ts.map +1 -0
- package/dist-lib/esm/adapters/index.js +16 -0
- package/dist-lib/esm/adapters/index.js.map +1 -0
- package/dist-lib/esm/assets/fonts/Droid_Sans_Bold.json +1 -0
- package/dist-lib/esm/assets/fonts/Droid_Sans_Regular.json +1 -0
- package/dist-lib/esm/assets/fonts/Kenney_Future_Regular.json +1 -0
- package/dist-lib/esm/baking/TextureBaker.d.ts +85 -0
- package/dist-lib/esm/baking/TextureBaker.d.ts.map +1 -0
- package/dist-lib/esm/baking/TextureBaker.js +710 -0
- package/dist-lib/esm/baking/TextureBaker.js.map +1 -0
- package/dist-lib/esm/builtInSkills.d.ts +20 -0
- package/dist-lib/esm/builtInSkills.d.ts.map +1 -0
- package/dist-lib/esm/builtInSkills.js +187 -0
- package/dist-lib/esm/builtInSkills.js.map +1 -0
- package/dist-lib/esm/compression/ModelCompressor.d.ts +88 -0
- package/dist-lib/esm/compression/ModelCompressor.d.ts.map +1 -0
- package/dist-lib/esm/compression/ModelCompressor.js +554 -0
- package/dist-lib/esm/compression/ModelCompressor.js.map +1 -0
- package/dist-lib/esm/decals/DecalController.d.ts +148 -0
- package/dist-lib/esm/decals/DecalController.d.ts.map +1 -0
- package/dist-lib/esm/decals/DecalController.js +1032 -0
- package/dist-lib/esm/decals/DecalController.js.map +1 -0
- package/dist-lib/esm/decals/decalAssetUrls.d.ts +2 -0
- package/dist-lib/esm/decals/decalAssetUrls.d.ts.map +1 -0
- package/dist-lib/esm/decals/decalAssetUrls.js +17 -0
- package/dist-lib/esm/decals/decalAssetUrls.js.map +1 -0
- package/dist-lib/esm/geometry/architecture.d.ts +115 -0
- package/dist-lib/esm/geometry/architecture.d.ts.map +1 -0
- package/dist-lib/esm/geometry/architecture.js +832 -0
- package/dist-lib/esm/geometry/architecture.js.map +1 -0
- package/dist-lib/esm/geometry/bevelModifier.d.ts +60 -0
- package/dist-lib/esm/geometry/bevelModifier.d.ts.map +1 -0
- package/dist-lib/esm/geometry/bevelModifier.js +346 -0
- package/dist-lib/esm/geometry/bevelModifier.js.map +1 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.d.ts +128 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.d.ts.map +1 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.js +677 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.js.map +1 -0
- package/dist-lib/esm/geometry/roundedBox.d.ts +16 -0
- package/dist-lib/esm/geometry/roundedBox.d.ts.map +1 -0
- package/dist-lib/esm/geometry/roundedBox.js +134 -0
- package/dist-lib/esm/geometry/roundedBox.js.map +1 -0
- package/dist-lib/esm/index.d.ts +22 -0
- package/dist-lib/esm/index.d.ts.map +1 -0
- package/dist-lib/esm/index.js +51 -0
- package/dist-lib/esm/index.js.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.d.ts +60 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.d.ts.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.js +484 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.js.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.d.ts +77 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.d.ts.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.js +1793 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.js.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.d.ts +96 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.d.ts.map +1 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.js +628 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.js.map +1 -0
- package/dist-lib/esm/pathExtrusion/index.d.ts +5 -0
- package/dist-lib/esm/pathExtrusion/index.d.ts.map +1 -0
- package/dist-lib/esm/pathExtrusion/index.js +5 -0
- package/dist-lib/esm/pathExtrusion/index.js.map +1 -0
- package/dist-lib/esm/pathExtrusion/types.d.ts +51 -0
- package/dist-lib/esm/pathExtrusion/types.d.ts.map +1 -0
- package/dist-lib/esm/pathExtrusion/types.js +2 -0
- package/dist-lib/esm/pathExtrusion/types.js.map +1 -0
- package/dist-lib/esm/plugin.d.ts +251 -0
- package/dist-lib/esm/plugin.d.ts.map +1 -0
- package/dist-lib/esm/plugin.js +145 -0
- package/dist-lib/esm/plugin.js.map +1 -0
- package/dist-lib/esm/rigging/WeightPaintController.d.ts +163 -0
- package/dist-lib/esm/rigging/WeightPaintController.d.ts.map +1 -0
- package/dist-lib/esm/rigging/WeightPaintController.js +1422 -0
- package/dist-lib/esm/rigging/WeightPaintController.js.map +1 -0
- package/dist-lib/esm/sculpting/SculptController.d.ts +147 -0
- package/dist-lib/esm/sculpting/SculptController.d.ts.map +1 -0
- package/dist-lib/esm/sculpting/SculptController.js +2039 -0
- package/dist-lib/esm/sculpting/SculptController.js.map +1 -0
- package/dist-lib/esm/sdf/index.d.ts +3 -0
- package/dist-lib/esm/sdf/index.d.ts.map +1 -0
- package/dist-lib/esm/sdf/index.js +3 -0
- package/dist-lib/esm/sdf/index.js.map +1 -0
- package/dist-lib/esm/sdf/sdfPrimitives.d.ts +98 -0
- package/dist-lib/esm/sdf/sdfPrimitives.d.ts.map +1 -0
- package/dist-lib/esm/sdf/sdfPrimitives.js +403 -0
- package/dist-lib/esm/sdf/sdfPrimitives.js.map +1 -0
- package/dist-lib/esm/sdf/surfaceNets.d.ts +30 -0
- package/dist-lib/esm/sdf/surfaceNets.d.ts.map +1 -0
- package/dist-lib/esm/sdf/surfaceNets.js +400 -0
- package/dist-lib/esm/sdf/surfaceNets.js.map +1 -0
- package/dist-lib/esm/styles.d.ts +12 -0
- package/dist-lib/esm/styles.d.ts.map +1 -0
- package/dist-lib/esm/styles.js +33 -0
- package/dist-lib/esm/styles.js.map +1 -0
- package/dist-lib/esm/template.d.ts +13 -0
- package/dist-lib/esm/template.d.ts.map +1 -0
- package/dist-lib/esm/template.js +20 -0
- package/dist-lib/esm/template.js.map +1 -0
- package/dist-lib/esm/textMesh/TextMeshController.d.ts +62 -0
- package/dist-lib/esm/textMesh/TextMeshController.d.ts.map +1 -0
- package/dist-lib/esm/textMesh/TextMeshController.js +405 -0
- package/dist-lib/esm/textMesh/TextMeshController.js.map +1 -0
- package/dist-lib/esm/textures/AITextureGenerator.d.ts +120 -0
- package/dist-lib/esm/textures/AITextureGenerator.d.ts.map +1 -0
- package/dist-lib/esm/textures/AITextureGenerator.js +946 -0
- package/dist-lib/esm/textures/AITextureGenerator.js.map +1 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.d.ts +63 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.d.ts.map +1 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.js +880 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.js.map +1 -0
- package/dist-lib/esm/tools/AbstractTool.d.ts +69 -0
- package/dist-lib/esm/tools/AbstractTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/AbstractTool.js +129 -0
- package/dist-lib/esm/tools/AbstractTool.js.map +1 -0
- package/dist-lib/esm/tools/ToolExecutionContext.d.ts +41 -0
- package/dist-lib/esm/tools/ToolExecutionContext.d.ts.map +1 -0
- package/dist-lib/esm/tools/ToolExecutionContext.js +2 -0
- package/dist-lib/esm/tools/ToolExecutionContext.js.map +1 -0
- package/dist-lib/esm/tools/ToolInterface.d.ts +105 -0
- package/dist-lib/esm/tools/ToolInterface.d.ts.map +1 -0
- package/dist-lib/esm/tools/ToolInterface.js +2 -0
- package/dist-lib/esm/tools/ToolInterface.js.map +1 -0
- package/dist-lib/esm/tools/ToolRegistry.d.ts +44 -0
- package/dist-lib/esm/tools/ToolRegistry.d.ts.map +1 -0
- package/dist-lib/esm/tools/ToolRegistry.js +116 -0
- package/dist-lib/esm/tools/ToolRegistry.js.map +1 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.d.ts +35 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.js +49 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.d.ts +35 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.js +55 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.d.ts +43 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.js +82 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.d.ts +52 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.js +87 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.d.ts +79 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.js +171 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.d.ts +76 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.js +116 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.d.ts +119 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.js +90 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.d.ts +115 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.js +106 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.d.ts +88 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.js +61 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.d.ts +115 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.js +213 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.d.ts +121 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.js +96 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.d.ts +163 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.js +303 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.d.ts +121 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.js +109 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.d.ts +102 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.js +80 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.d.ts +225 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.js +239 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.d.ts +136 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.js +120 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.d.ts +95 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.js +132 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.d.ts +88 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.js +60 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.d.ts +146 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.js +125 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/DecalTool.d.ts +77 -0
- package/dist-lib/esm/tools/builtin/DecalTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/DecalTool.js +144 -0
- package/dist-lib/esm/tools/builtin/DecalTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.d.ts +21 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.js +43 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.d.ts +22 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.js +96 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.d.ts +115 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.js +77 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.d.ts +105 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.js +69 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.d.ts +37 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.js +58 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.d.ts +31 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.js +50 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.d.ts +31 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.js +50 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.d.ts +35 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.js +56 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.d.ts +132 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.js +456 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.d.ts +88 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.js +217 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.d.ts +12 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.js +13 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.d.ts +29 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.js +57 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.d.ts +88 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.js +156 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.d.ts +51 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.js +117 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.d.ts +56 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.js +140 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.d.ts +139 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.js +256 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.d.ts +22 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.js +32 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.d.ts +31 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.js +58 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.d.ts +67 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.js +106 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.d.ts +24 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.js +38 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.d.ts +24 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.js +40 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.d.ts +79 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.js +70 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.d.ts +49 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.js +108 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.d.ts +61 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.js +154 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.js.map +1 -0
- package/dist-lib/esm/tools/builtin/index.d.ts +45 -0
- package/dist-lib/esm/tools/builtin/index.d.ts.map +1 -0
- package/dist-lib/esm/tools/builtin/index.js +45 -0
- package/dist-lib/esm/tools/builtin/index.js.map +1 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.d.ts +19 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.js +44 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.d.ts +16 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.js +29 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.d.ts +30 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.js +57 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.js +30 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.d.ts +22 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.js +45 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.d.ts +21 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.js +43 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.d.ts +21 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.js +49 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.js +37 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.js +37 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.d.ts +24 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.js +81 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.d.ts +19 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.js +44 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.js +38 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.js +35 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.d.ts +27 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.js +73 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.d.ts +28 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.js +67 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.js +36 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.d.ts +29 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.js +71 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.js +31 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.js +29 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.d.ts +28 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.js +71 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.d.ts +27 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.js +69 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.js.map +1 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.d.ts +31 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.js +229 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.js.map +1 -0
- package/dist-lib/esm/tools/editor/index.d.ts +33 -0
- package/dist-lib/esm/tools/editor/index.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/index.js +55 -0
- package/dist-lib/esm/tools/editor/index.js.map +1 -0
- package/dist-lib/esm/tools/editor/toolViews.d.ts +11 -0
- package/dist-lib/esm/tools/editor/toolViews.d.ts.map +1 -0
- package/dist-lib/esm/tools/editor/toolViews.js +54 -0
- package/dist-lib/esm/tools/editor/toolViews.js.map +1 -0
- package/dist-lib/esm/tools/editorTools.d.ts +6 -0
- package/dist-lib/esm/tools/editorTools.d.ts.map +1 -0
- package/dist-lib/esm/tools/editorTools.js +6 -0
- package/dist-lib/esm/tools/editorTools.js.map +1 -0
- package/dist-lib/esm/tools/index.d.ts +9 -0
- package/dist-lib/esm/tools/index.d.ts.map +1 -0
- package/dist-lib/esm/tools/index.js +9 -0
- package/dist-lib/esm/tools/index.js.map +1 -0
- package/dist-lib/esm/tools/textureUtils.d.ts +19 -0
- package/dist-lib/esm/tools/textureUtils.d.ts.map +1 -0
- package/dist-lib/esm/tools/textureUtils.js +289 -0
- package/dist-lib/esm/tools/textureUtils.js.map +1 -0
- package/dist-lib/esm/types.d.ts +165 -0
- package/dist-lib/esm/types.d.ts.map +1 -0
- package/dist-lib/esm/types.js +2 -0
- package/dist-lib/esm/types.js.map +1 -0
- package/dist-lib/esm/uv/UVUnwrapController.d.ts +109 -0
- package/dist-lib/esm/uv/UVUnwrapController.d.ts.map +1 -0
- package/dist-lib/esm/uv/UVUnwrapController.js +1023 -0
- package/dist-lib/esm/uv/UVUnwrapController.js.map +1 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.d.ts +16 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.d.ts.map +1 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.js +170 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.js.map +1 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.d.ts +55 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.d.ts.map +1 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.js +631 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.js.map +1 -0
- package/dist-lib/esm/voxel/VoxelPainterController.d.ts +101 -0
- package/dist-lib/esm/voxel/VoxelPainterController.d.ts.map +1 -0
- package/dist-lib/esm/voxel/VoxelPainterController.js +672 -0
- package/dist-lib/esm/voxel/VoxelPainterController.js.map +1 -0
- package/dist-lib/esm/voxel/index.d.ts +5 -0
- package/dist-lib/esm/voxel/index.d.ts.map +1 -0
- package/dist-lib/esm/voxel/index.js +5 -0
- package/dist-lib/esm/voxel/index.js.map +1 -0
- package/dist-lib/esm/voxel/types.d.ts +79 -0
- package/dist-lib/esm/voxel/types.d.ts.map +1 -0
- package/dist-lib/esm/voxel/types.js +2 -0
- package/dist-lib/esm/voxel/types.js.map +1 -0
- package/dist-lib/esm/web-component/MeshEditorElement.d.ts +104 -0
- package/dist-lib/esm/web-component/MeshEditorElement.d.ts.map +1 -0
- package/dist-lib/esm/web-component/MeshEditorElement.js +247 -0
- package/dist-lib/esm/web-component/MeshEditorElement.js.map +1 -0
- package/dist-lib/esm/web-component/index.d.ts +2 -0
- package/dist-lib/esm/web-component/index.d.ts.map +1 -0
- package/dist-lib/esm/web-component/index.js +2 -0
- package/dist-lib/esm/web-component/index.js.map +1 -0
- package/dist-lib/index.umd.js +3 -0
- package/dist-lib/mesheditor.css +2 -0
- package/dist-lib/standalone/mesheditor-element.bundle.js +3 -0
- package/package.json +113 -4
- package/skills/README.md +48 -0
- package/skills/figure-sculptor.md +297 -0
- package/skills/image-to-mesh.md +18 -0
- package/skills/mesh-updater.md +27 -0
- package/skills/neural-3d-generator.md +53 -0
- package/skills/procedural-modeler.md +267 -0
- package/skills/voxel-painter.md +21 -0
- package/src/mesheditor.css +6477 -0
package/README.md
CHANGED
|
@@ -1,3 +1,854 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 3D Mesh Editor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://www.babylonjs.com/)
|
|
6
|
+
[](tests/integration/)
|
|
7
|
+
[](https://www.electronjs.org/)
|
|
8
|
+
|
|
9
|
+
A modular 3D model studio and mesh manipulation workbench built with **TypeScript** and **Babylon.js 9.x**. Engineered from the ground up to function across multiple deployment targets through a decoupled **Platform Adapter Architecture**:
|
|
10
|
+
|
|
11
|
+
1. **Standalone Web Application** (Full-featured browser 3D studio with local dev server)
|
|
12
|
+
2. **NPM Library & Web Component** (`<mesh-editor>` Custom Element + modular ESM / UMD TypeScript classes)
|
|
13
|
+
3. **Desktop Application** (Cross-platform native macOS `.dmg`, Windows `.exe`, and Linux `.AppImage`/`.deb` via Electron)
|
|
14
|
+
|
|
15
|
+
Distributed under the **[Apache License 2.0](LICENSE)**.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
|
|
21
|
+
- [Architectural Overview](#architectural-overview)
|
|
22
|
+
- [Directory Structure](#directory-structure)
|
|
23
|
+
- [Core Design Principles](#core-design-principles)
|
|
24
|
+
- [Viewport Navigation & Keyboard Shortcuts](#viewport-navigation--keyboard-shortcuts)
|
|
25
|
+
- [Decentralized Modular Tool Architecture](#decentralized-modular-tool-architecture)
|
|
26
|
+
- [Built-In Editor Tools](#built-in-editor-tools)
|
|
27
|
+
- [Authoring Guide: Adding a New Editor Tool](#authoring-guide-adding-a-new-editor-tool)
|
|
28
|
+
- [Procedural & AI-Callable Tool Pipeline](#procedural--ai-callable-tool-pipeline)
|
|
29
|
+
- [Built-In AI Modeling Tools](#built-in-ai-modeling-tools)
|
|
30
|
+
- [ToolRegistry & OpenAI Function Schemas](#toolregistry--openai-function-schemas)
|
|
31
|
+
- [Bring-Your-Own-AI (BYO-AI) & Modeling Skills](#bring-your-own-ai-byo-ai--modeling-skills)
|
|
32
|
+
- [Supported LLM / VLM Endpoints](#supported-llm--vlm-endpoints)
|
|
33
|
+
- [Antigravity Local CLI Bridge (`agy`)](#antigravity-local-cli-bridge-agy)
|
|
34
|
+
- [Domain-Specific Modeling Skills](#domain-specific-modeling-skills)
|
|
35
|
+
- [Hybrid Neural 3D Generators (TRELLIS 2, Hunyuan3D, Hi3D)](#hybrid-neural-3d-generators-trellis-2-hunyuan3d-hi3d)
|
|
36
|
+
- [Multi-Provider Protocols](#multi-provider-protocols)
|
|
37
|
+
- [Procedural + Neural Composition Workflow](#procedural--neural-composition-workflow)
|
|
38
|
+
- [Web Component & NPM Library Integration](#web-component--npm-library-integration)
|
|
39
|
+
- [Using `<mesh-editor>` Custom Element](#using-mesh-editor-custom-element)
|
|
40
|
+
- [Programmatic TypeScript Integration](#programmatic-typescript-integration)
|
|
41
|
+
- [Extensibility & Custom Plugin System](#extensibility--custom-plugin-system)
|
|
42
|
+
- [Desktop Application (Electron)](#desktop-application-electron)
|
|
43
|
+
- [Testing Architecture & Test Suites](#testing-architecture--test-suites)
|
|
44
|
+
- [Headless 3D Integration Tests (Vitest + NullEngine)](#headless-3d-integration-tests-vitest--nullengine)
|
|
45
|
+
- [Browser E2E Tests (Playwright)](#browser-e2e-tests-playwright)
|
|
46
|
+
- [Developer Scripts & Build Workflow](#developer-scripts--build-workflow)
|
|
47
|
+
- [CI/CD & GitHub Actions Workflows](#cicd--github-actions-workflows)
|
|
48
|
+
- [License](#license)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Architectural Overview
|
|
53
|
+
|
|
54
|
+
The Mesh Editor is structured into decoupled layers to ensure complete isolation from project-specific assets, APIs, and host environments:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
mesheditor/
|
|
58
|
+
├── src/
|
|
59
|
+
│ ├── index.ts # Public API exports, <mesh-editor> registration, auto-bootstrapper
|
|
60
|
+
│ ├── types.ts # Shared data types, AI & Neural 3D provider configs, events
|
|
61
|
+
│ ├── plugin.ts # Plugin interfaces (MeshEditorPlugin, Context, PluginManager)
|
|
62
|
+
│ ├── template.ts # Compiled HTML UI template (synced from mesheditor.ejs & tool views)
|
|
63
|
+
│ ├── styles.ts # Auto-injected CSS stylesheet for Web Component / NPM bundles
|
|
64
|
+
│ ├── builtInSkills.ts # Compiled AI modeling skills (synced from skills/*.md)
|
|
65
|
+
│ ├── AIAgentService.ts # Multi-turn BYO-AI agent orchestrator, SSE streaming, multi-provider client
|
|
66
|
+
│ ├── Neural3DGeneratorService.ts # Multi-provider Neural 3D client (TRELLIS 2, Hunyuan3D, Hi3D)
|
|
67
|
+
│ ├── MeshEditorService.ts # Core 3D engine: meshes, gizmos, CSG2, facets, transforms, export
|
|
68
|
+
│ ├── MeshEditorApp.ts # UI coordinator: outliner tree sync, layout modes, window manager
|
|
69
|
+
│ ├── tools/ # Modular tool system
|
|
70
|
+
│ │ ├── ToolInterface.ts # Tool contracts, metadata, lifecycle hooks, AI function schemas
|
|
71
|
+
│ │ ├── AbstractTool.ts # Base tool with scene, math, and mesh helper utilities
|
|
72
|
+
│ │ ├── ToolRegistry.ts # Runtime registry & execution dispatcher (44 built-in + 20 editor tools)
|
|
73
|
+
│ │ ├── ToolExecutionContext.ts # Execution context passed to tools during execution
|
|
74
|
+
│ │ ├── editor/ # Decentralized editor tools & EJS view templates
|
|
75
|
+
│ │ │ ├── AbstractEditorTool.ts # Base editor tool with dynamic DOM mounting & EJS compilation
|
|
76
|
+
│ │ │ ├── toolViews.ts # Auto-compiled EJS view templates
|
|
77
|
+
│ │ │ ├── OutlinerEditorTool.ts / .ejs
|
|
78
|
+
│ │ │ ├── CreatePrimitiveEditorTool.ts / .ejs
|
|
79
|
+
│ │ │ ├── CSGEditorTool.ts / .ejs
|
|
80
|
+
│ │ │ ├── FacetEditorTool.ts / .ejs
|
|
81
|
+
│ │ │ ├── SculptEditorTool.ts / .ejs
|
|
82
|
+
│ │ │ ├── VoxelPainterEditorTool.ts / .ejs
|
|
83
|
+
│ │ │ ├── PathExtrusionEditorTool.ts / .ejs
|
|
84
|
+
│ │ │ ├── AIAgentEditorTool.ts / .ejs
|
|
85
|
+
│ │ │ ├── MeshPropertiesEditorTool.ts / .ejs
|
|
86
|
+
│ │ │ ├── MaterialEditorTool.ts / .ejs
|
|
87
|
+
│ │ │ ├── UVUnwrapEditorTool.ts / .ejs
|
|
88
|
+
│ │ │ ├── BakingEditorTool.ts / .ejs
|
|
89
|
+
│ │ │ ├── TextureOptimizerEditorTool.ts / .ejs
|
|
90
|
+
│ │ │ ├── CompressModelEditorTool.ts / .ejs
|
|
91
|
+
│ │ │ ├── SceneEnvironmentEditorTool.ts / .ejs
|
|
92
|
+
│ │ │ ├── AnimationPlayerEditorTool.ts / .ejs
|
|
93
|
+
│ │ │ ├── RiggingEditorTool.ts / .ejs
|
|
94
|
+
│ │ │ ├── AITextureEditorTool.ts / .ejs
|
|
95
|
+
│ │ │ ├── TextMeshEditorTool.ts / .ejs
|
|
96
|
+
│ │ │ └── DecalEditorTool.ts / .ejs
|
|
97
|
+
│ │ └── builtin/ # 44 AI-callable procedural & manipulation tools
|
|
98
|
+
│ ├── voxel/ # Voxel painter engine (custom mesher, palette, texture atlas)
|
|
99
|
+
│ ├── pathExtrusion/ # Spline path factory, extrusion controller, 2D profiles
|
|
100
|
+
│ ├── sculpting/ # Dynamic topology sculpt controller & brush falloffs
|
|
101
|
+
│ ├── uv/ # UV unwrapping (LSCM, ABF conformal, seam management)
|
|
102
|
+
│ ├── baking/ # Texture baking (normal maps, ambient occlusion, diffuse)
|
|
103
|
+
│ ├── rigging/ # Skeletal bone authoring & vertex weight painting
|
|
104
|
+
│ ├── textures/ # AI texture generator, external image service, WebP optimizer
|
|
105
|
+
│ ├── textMesh/ # 3D vector text generation using typeface JSON fonts
|
|
106
|
+
│ ├── decals/ # Decal projection onto arbitrary 3D mesh surfaces
|
|
107
|
+
│ ├── compression/ # QEM polygon decimation & WebP texture compression
|
|
108
|
+
│ ├── sdf/ # Signed Distance Fields & Surface Nets polygonizer
|
|
109
|
+
│ ├── geometry/ # Bevel modifier, architecture helpers, rounded boxes, facet math
|
|
110
|
+
│ ├── adapters/ # Multi-platform runtime bridges
|
|
111
|
+
│ │ ├── PlatformAdapter.ts # Adapter contract (native file open/save dialogs, menu bridge)
|
|
112
|
+
│ │ ├── BrowserPlatformAdapter.ts # Standalone browser file input & download adapter
|
|
113
|
+
│ │ ├── ElectronPlatformAdapter.ts # Native desktop adapter (macOS, Windows, Linux native dialogs)
|
|
114
|
+
│ │ └── HostAppAdapter.ts # Embedded host application adapter (custom save callbacks)
|
|
115
|
+
│ ├── web-component/ # <mesh-editor> Custom Element implementation
|
|
116
|
+
│ ├── mesheditor.ejs # Entry HTML template with decentralized tool includes
|
|
117
|
+
│ └── mesheditor.css # Dark theme styles, floating & stackpanel layouts, tool widgets
|
|
118
|
+
├── skills/ # Domain-specific AI modeling skills (Markdown)
|
|
119
|
+
│ ├── figure-sculptor.md # Organic anatomy blockouts, dynamic sculpting, game retopology
|
|
120
|
+
│ ├── procedural-modeler.md # CSG2 booleans, lathe, spline extrusion, architectural construction
|
|
121
|
+
│ ├── mesh-updater.md # Scene inspection, targeted geometry updates, hierarchy maintenance
|
|
122
|
+
│ ├── neural-3d-generator.md # TRELLIS 2, Hunyuan3D, Hi3D delegation, normalization & grounding
|
|
123
|
+
│ ├── voxel-painter.md # Voxel grids, multi-layer palettes, custom meshing
|
|
124
|
+
│ └── image-to-mesh.md # Vision-guided 2D reference reconstruction
|
|
125
|
+
├── electron/
|
|
126
|
+
│ ├── main.js # Electron main process (native menus, file I/O, IPC bridge)
|
|
127
|
+
│ └── preload.js # Context-isolated secure preload bridge (`window.meshEditorElectron`)
|
|
128
|
+
├── scripts/
|
|
129
|
+
│ ├── antigravity-bridge.js # Local OpenAI-compatible proxy bridge to Antigravity CLI (`agy`)
|
|
130
|
+
│ ├── sync-templates.js # Compiles decentralized `.ejs` views into `toolViews.ts` & `template.ts`
|
|
131
|
+
│ ├── sync-skills.js # Injects markdown skills into `src/builtInSkills.ts`
|
|
132
|
+
│ ├── sync-styles.js # Injects `src/mesheditor.css` into `src/styles.ts`
|
|
133
|
+
│ ├── generate-icons.js # Generates desktop `.icns`, `.ico`, and `.png` icons
|
|
134
|
+
│ └── prepare-pages.js # Prepares distribution bundle for GitHub Pages
|
|
135
|
+
└── tests/
|
|
136
|
+
├── integration/ # 15 Vitest headless 3D test suites with Babylon NullEngine (211 tests)
|
|
137
|
+
└── e2e/ # Playwright Chromium real-browser WebGL workflow tests
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Core Design Principles
|
|
141
|
+
|
|
142
|
+
1. **Engine Decoupling (`MeshEditorService`)**: Encapsulates Babylon.js engine setup, `UniversalCamera`, lighting, gizmo managers, CSG2 boolean operations, vertex/facet editing, and import/export formats (`.glb`, `.gltf`, `.obj`, `.stl`). It operates on pure DOM canvas elements, files, and binary Blobs without hardcoded asset URLs.
|
|
143
|
+
2. **Headless Engine Ingestion (`customEngine`)**: Both `MeshEditorService` and `MeshEditorApp` support constructor injection of Babylon's headless **`NullEngine`**, enabling full 3D integration testing directly inside Node.js without requiring a physical GPU or display.
|
|
144
|
+
3. **UI Coordination (`MeshEditorApp`)**: Manages floating vs. stackpanel layouts, window dragging and docking, the hierarchical Outliner tree, dropdown menus, and modal dialogs.
|
|
145
|
+
4. **Decentralized Tool Isolation**: Every editor tool lives in its own self-contained module containing its TypeScript class, dedicated EJS view, in-app documentation, and lifecycle hooks.
|
|
146
|
+
5. **Zero Host Couplings in Core**: Project-specific features (such as custom asset browsers, database sync, or proprietary authentication) are implemented as clean external plugins via the `MeshEditorPlugin` API.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Viewport Navigation & Keyboard Shortcuts
|
|
151
|
+
|
|
152
|
+
### Mouse Controls
|
|
153
|
+
|
|
154
|
+
| Action | Control | Description |
|
|
155
|
+
| :--- | :--- | :--- |
|
|
156
|
+
| **Orbit Camera** | `Right Click + Drag` | Free look and orbital rotation around the scene or target |
|
|
157
|
+
| **Pan Camera** | `Middle Click + Drag` | Pan camera view horizontally and vertically |
|
|
158
|
+
| **Select / Manipulate** | `Left Click` | Select mesh, pick vertices/facets, or drag gizmo handles |
|
|
159
|
+
| **Zoom View** | `Mouse Wheel` | Smooth forward and backward camera zoom |
|
|
160
|
+
|
|
161
|
+
### Keyboard Navigation
|
|
162
|
+
|
|
163
|
+
| Key | Action |
|
|
164
|
+
| :--- | :--- |
|
|
165
|
+
| **W / Up Arrow** | Move camera forward |
|
|
166
|
+
| **S / Down Arrow** | Move camera backward |
|
|
167
|
+
| **A / Left Arrow** | Move camera left (strafe) |
|
|
168
|
+
| **D / Right Arrow** | Move camera right (strafe) |
|
|
169
|
+
|
|
170
|
+
### Transformation Gizmos & Editing Shortcuts
|
|
171
|
+
|
|
172
|
+
| Key Shortcut | Tool / Action | Description |
|
|
173
|
+
| :--- | :--- | :--- |
|
|
174
|
+
| **M** | Move Gizmo | Activates 3D translation gizmo |
|
|
175
|
+
| **E** | Rotate Gizmo | Activates 3D rotation gizmo |
|
|
176
|
+
| **R** | Scale Gizmo | Activates 3D uniform & axis scale gizmo |
|
|
177
|
+
| **B** | Bounds Gizmo | Activates bounding-box sizing handles |
|
|
178
|
+
| **F** | Focus View | Centers and focuses camera on selected mesh |
|
|
179
|
+
| **Del / Backspace** | Delete | Removes selected mesh, group, or hierarchy node |
|
|
180
|
+
| **⌘Z / Ctrl+Z** | Undo | Reverts last transformation, creation, or CSG operation |
|
|
181
|
+
| **⇧⌘Z / Ctrl+Y** | Redo | Re-applies undone operation |
|
|
182
|
+
| **⌘G / Ctrl+G** | Group | Groups selected meshes under a new parent transform |
|
|
183
|
+
| **⇧⌘G / Ctrl+Shift+G** | Ungroup | Dissolves group and restores world transforms |
|
|
184
|
+
| **⌘C / Ctrl+C** | Copy | Copies selected mesh to clipboard |
|
|
185
|
+
| **⌘V / Ctrl+V** | Paste | Pastes copied mesh at cursor or scene origin |
|
|
186
|
+
| **⌘D / Ctrl+D** | Duplicate | Duplicates selected mesh in place |
|
|
187
|
+
| **Esc** | Cancel / Close | Cancels active Pick & Place mode or closes open popups |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Decentralized Modular Tool Architecture
|
|
192
|
+
|
|
193
|
+
The Mesh Editor employs a **Decentralized Modular Tool Architecture**. Rather than hardcoding tool logic and dialog markup into monolithic files, every tool is an independent, self-contained unit encapsulating its logic, HTML view, in-app help guide, and lifecycle management.
|
|
194
|
+
|
|
195
|
+
### Built-In Editor Tools
|
|
196
|
+
|
|
197
|
+
The editor ships with **20 decentralized editor tools** located in [`src/tools/editor/`](src/tools/editor/):
|
|
198
|
+
|
|
199
|
+
| Tool Class | View Template | Category | Description |
|
|
200
|
+
| :--- | :--- | :--- | :--- |
|
|
201
|
+
| **`OutlinerEditorTool`** | `OutlinerEditorTool.ejs` | Scene Graph | Hierarchical scene tree with nesting, search filter, visibility toggle, and deletion |
|
|
202
|
+
| **`CreatePrimitiveEditorTool`** | `CreatePrimitiveEditorTool.ejs` | Modeling | Parametric primitives (Box, Sphere, Cylinder, Capsule, Torus, Plane, Ground, Polyhedron) |
|
|
203
|
+
| **`CSGEditorTool`** | `CSGEditorTool.ejs` | Modeling | Real-time boolean operations (Union, Subtract, Intersect) powered by Babylon CSG2 |
|
|
204
|
+
| **`FacetEditorTool`** | `FacetEditorTool.ejs` | Modeling | Sub-mesh editing: triangular facet selection, extrude, inset, arc, cut-through, normal flipping |
|
|
205
|
+
| **`SculptEditorTool`** | `SculptEditorTool.ejs` | Sculpting | Dynamic topology sculpting brushes (Grab, Clay, Smooth, Inflate, Flatten, Crease) |
|
|
206
|
+
| **`VoxelPainterEditorTool`** | `VoxelPainterEditorTool.ejs` | Voxel | 3D voxel placement/erasing, color palettes, custom meshing, and texture atlas generation |
|
|
207
|
+
| **`PathExtrusionEditorTool`** | `PathExtrusionEditorTool.ejs` | Modeling | Extrudes 2D profiles (circle, star, rectangle, n-gon) along 3D Catmull-Rom & linear splines |
|
|
208
|
+
| **`AIAgentEditorTool`** | `AIAgentEditorTool.ejs` | AI Co-Pilot | Multi-turn AI assistant with SSE streaming, tool-calling execution, and prompt examples |
|
|
209
|
+
| **`MeshPropertiesEditorTool`** | `MeshPropertiesEditorTool.ejs` | Geometry | Precise transform inputs, origin recentering, snap-to-ground ($Y \ge 0$), and transform baking |
|
|
210
|
+
| **`MaterialEditorTool`** | `MaterialEditorTool.ejs` | Shading | PBR material authoring (albedo, roughness, metallic, emissive, UV scale/offset, planar mapping) |
|
|
211
|
+
| **`UVUnwrapEditorTool`** | `UVUnwrapEditorTool.ejs` | UV Pipeline | Conformal UV unwrapping (LSCM / ABF), seam marking, and UV island layout |
|
|
212
|
+
| **`BakingEditorTool`** | `BakingEditorTool.ejs` | Baking | Texture baker for high-to-low poly normal maps, ambient occlusion, and diffuse baking |
|
|
213
|
+
| **`TextureOptimizerEditorTool`** | `TextureOptimizerEditorTool.ejs` | Optimization | Interactive WebP texture conversion, downsampling, and VRAM footprint inspector |
|
|
214
|
+
| **`CompressModelEditorTool`** | `CompressModelEditorTool.ejs` | Optimization | Geometry decimation (QEM), WebP compression, and optimized GLB export |
|
|
215
|
+
| **`SceneEnvironmentEditorTool`** | `SceneEnvironmentEditorTool.ejs` | Environment | Skybox, HDR environment lighting, ground grid customization, directional lights, and FOV |
|
|
216
|
+
| **`AnimationPlayerEditorTool`** | `AnimationPlayerEditorTool.ejs` | Animation | Timeline scrubber, playback controls, animation group selector, and bone inspection |
|
|
217
|
+
| **`RiggingEditorTool`** | `RiggingEditorTool.ejs` | Rigging | Skeletal bone generation, joint hierarchy, and interactive vertex weight painting |
|
|
218
|
+
| **`AITextureEditorTool`** | `AITextureEditorTool.ejs` | AI Generation | AI-assisted procedural and neural texture generation with seamless tiling synthesis |
|
|
219
|
+
| **`TextMeshEditorTool`** | `TextMeshEditorTool.ejs` | Modeling | 3D extruded vector text generation using typeface JSON fonts |
|
|
220
|
+
| **`DecalEditorTool`** | `DecalEditorTool.ejs` | Materials | Decal stamp projection onto arbitrary 3D mesh surfaces with orientation and size controls |
|
|
221
|
+
|
|
222
|
+
### Architectural Guidelines for Editor Tools
|
|
223
|
+
|
|
224
|
+
- **Top Toolbar Policy**: The top toolbar (`#top-toolbar`) is reserved for branding, dropdown menus, undo/redo, transformation gizmos, and the help modal shortcut. Never add quick-toggle buttons to `#top-toolbar`. All editor tools are accessed exclusively through the dynamically built **Tools** dropdown menu (`#menuTools`).
|
|
225
|
+
- **Dynamic Menu Generation**: `#menuTools` is built 100% dynamically at runtime via `MeshEditorApp.renderToolsMenu()`. Registering a tool class in `createBuiltinEditorTools()` automatically creates its menu entry, Lucide icon, label, ordering, and click toggling.
|
|
226
|
+
- **Exclusive Viewport Clicks**: Tools that capture 3D viewport clicks (e.g. Voxel Painter, Sculpting, Spline editing) set `isExclusive3DTool: true`. Activating one exclusive tool automatically deactivates 3D editing on other exclusive tools without closing their dialogs.
|
|
227
|
+
- **Unified Dark Theme CSS**: All floating dialogs use unified classes: `.tool-control-group`, `.tool-row`, `.tool-label`, `.tool-select`, `.tool-input`, `.tool-action-btn`, and `.tool-btn-primary`.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### Authoring Guide: Adding a New Editor Tool
|
|
232
|
+
|
|
233
|
+
Follow this step-by-step checklist to build and register a new tool:
|
|
234
|
+
|
|
235
|
+
#### Step 1: Create the EJS View Template
|
|
236
|
+
|
|
237
|
+
Create `src/tools/editor/MyCustomEditorTool.ejs`:
|
|
238
|
+
|
|
239
|
+
```html
|
|
240
|
+
<div id="dialog-my-custom-tool" class="floating-dialog" style="top: 100px; left: 348px; width: 340px; display: none">
|
|
241
|
+
<div class="dialog-header">
|
|
242
|
+
<span class="dialog-title"><i class="app-icon" data-lucide="wand-2"></i> Custom Generator</span>
|
|
243
|
+
<div class="dialog-actions">
|
|
244
|
+
<button class="dialog-btn btn-help" title="Help & Tool Guide" aria-label="Help"><i class="app-icon" data-lucide="help-circle"></i></button>
|
|
245
|
+
<button class="dialog-btn btn-min" title="Minimize"><i class="app-icon" data-lucide="minus"></i></button>
|
|
246
|
+
<button class="dialog-btn btn-close" title="Close"><i class="app-icon" data-lucide="x"></i></button>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
<div class="dialog-body my-custom-tool-body">
|
|
250
|
+
<div class="tool-control-group">
|
|
251
|
+
<div class="tool-row">
|
|
252
|
+
<label class="tool-label" for="customSize">Mesh Radius:</label>
|
|
253
|
+
<input type="number" id="customSize" class="tool-input tool-number" value="1.0" min="0.1" max="20.0" step="0.5" />
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<button class="tool-action-btn tool-btn-primary" id="btnExecuteCustomTool" style="width: 100%">
|
|
257
|
+
<i class="app-icon" data-lucide="play"></i> Generate Mesh
|
|
258
|
+
</button>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Step 2: Implement the Tool Class
|
|
264
|
+
|
|
265
|
+
Create `src/tools/editor/MyCustomEditorTool.ts` extending `AbstractEditorTool`:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
import { AbstractEditorTool } from './AbstractEditorTool';
|
|
269
|
+
import { ToolExecutionContext } from '../ToolExecutionContext';
|
|
270
|
+
|
|
271
|
+
export class MyCustomEditorTool extends AbstractEditorTool {
|
|
272
|
+
public readonly name = 'my_custom_tool';
|
|
273
|
+
public readonly dialogId = 'dialog-my-custom-tool';
|
|
274
|
+
public readonly triggerButtonId = 'btnToggleMyCustomTool';
|
|
275
|
+
public readonly menuId = 'menuTools';
|
|
276
|
+
public readonly menuLabel = 'Custom Generator';
|
|
277
|
+
public readonly icon = 'wand-2';
|
|
278
|
+
public readonly order = 21;
|
|
279
|
+
public readonly isExclusive3DTool = false;
|
|
280
|
+
public readonly description = 'Generates custom parametric geometry in the active scene.';
|
|
281
|
+
|
|
282
|
+
public readonly helpText = `
|
|
283
|
+
<h4><i class="app-icon" data-lucide="info"></i> Overview</h4>
|
|
284
|
+
<p>Procedurally generates custom geometries and places them at the scene origin.</p>
|
|
285
|
+
<h4><i class="app-icon" data-lucide="mouse-pointer"></i> Controls</h4>
|
|
286
|
+
<ul>
|
|
287
|
+
<li>Adjust <strong>Mesh Radius</strong> to configure dimensions.</li>
|
|
288
|
+
<li>Click <strong>Generate Mesh</strong> to instantiate into the scene.</li>
|
|
289
|
+
</ul>
|
|
290
|
+
`.trim();
|
|
291
|
+
|
|
292
|
+
public onOpen(app: any): void {
|
|
293
|
+
const btn = document.getElementById('btnExecuteCustomTool');
|
|
294
|
+
if (btn) {
|
|
295
|
+
btn.onclick = () => {
|
|
296
|
+
const radius = parseFloat((document.getElementById('customSize') as HTMLInputElement)?.value || '1.0');
|
|
297
|
+
app.getService().createSphere(`custom_sphere_${Date.now()}`, { diameter: radius * 2 });
|
|
298
|
+
app.showToast('Custom mesh generated successfully.', 'success');
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public onClose(app: any): void {
|
|
304
|
+
// Teardown event listeners or interactive viewport helpers
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
public onUpdateUI(app: any): void {
|
|
308
|
+
// Synchronize dialog inputs with the active selection
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### Step 3: Include in `src/mesheditor.ejs`
|
|
314
|
+
|
|
315
|
+
Add the partial include inside `#stackpanelRightSidebar` in `src/mesheditor.ejs`:
|
|
316
|
+
|
|
317
|
+
```html
|
|
318
|
+
<div id="stackpanelRightSidebar" class="stackpanel-sidebar">
|
|
319
|
+
...
|
|
320
|
+
<%- include('./tools/editor/MyCustomEditorTool.ejs') %>
|
|
321
|
+
</div>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
*(Note: Even if omitted from `mesheditor.ejs`, `tool.renderView()` automatically mounts the dialog into the sidebar at runtime).*
|
|
325
|
+
|
|
326
|
+
#### Step 4: Register in `src/tools/editor/index.ts`
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
import { MyCustomEditorTool } from './MyCustomEditorTool';
|
|
330
|
+
|
|
331
|
+
export {
|
|
332
|
+
...
|
|
333
|
+
MyCustomEditorTool,
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export function createBuiltinEditorTools(): ToolInterface[] {
|
|
337
|
+
return [
|
|
338
|
+
...
|
|
339
|
+
new MyCustomEditorTool(),
|
|
340
|
+
];
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
#### Step 5: Synchronize Templates & Compile
|
|
345
|
+
|
|
346
|
+
Run the template compilation script:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
npm run sync:templates
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
This compiles your `.ejs` template into `src/tools/editor/toolViews.ts` and updates `src/template.ts` for Web Component and library bundles. Verify with the test suite:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npm run type-check
|
|
356
|
+
npm test
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Procedural & AI-Callable Tool Pipeline
|
|
362
|
+
|
|
363
|
+
The Mesh Editor includes **44 built-in procedural modeling tools** located in [`src/tools/builtin/`](src/tools/builtin/). Every tool implements the `ToolInterface` contract, providing:
|
|
364
|
+
|
|
365
|
+
- A unique snake_case `name` (e.g. `csg_boolean`, `extrude_polygon`, `retopologize_mesh`)
|
|
366
|
+
- A strict JSON Schema definition for `parameters` compatible with the OpenAI Function Calling standard
|
|
367
|
+
- An asynchronous `execute(args, context)` method operating on `ToolExecutionContext`
|
|
368
|
+
|
|
369
|
+
### Built-In AI Modeling Tools
|
|
370
|
+
|
|
371
|
+
| Tool Identifier | Implementation File | Primary Function |
|
|
372
|
+
| :--- | :--- | :--- |
|
|
373
|
+
| `modeler_get_scene_info` | `GetSceneInfoTool.ts` | Inspects all scene meshes, hierarchies, dimensions, vertices, and materials |
|
|
374
|
+
| `modeler_create_primitive` | `CreatePrimitiveTool.ts` | Spawns parametric primitives (box, sphere, cylinder, cone, capsule, torus, etc.) |
|
|
375
|
+
| `csg_boolean` | `BooleanOperationTool.ts` | Performs CSG2 Boolean Union, Subtract, or Intersect between meshes |
|
|
376
|
+
| `modeler_extrude_polygon` | `ExtrudePolygonTool.ts` | Extrudes 2D polygon vertex loops into 3D solid geometry with depth |
|
|
377
|
+
| `modeler_extrude_shape` | `ExtrudeShapeTool.ts` | Extrudes 2D cross-section shapes along 3D Catmull-Rom spline paths |
|
|
378
|
+
| `modeler_create_lathe` | `CreateLatheTool.ts` | Revolves 2D profile paths around the Y-axis (vases, chalices, domes) |
|
|
379
|
+
| `modeler_create_tube` | `CreateTubeTool.ts` | Generates 3D tubes and pipes along 3D path vectors with variable radius |
|
|
380
|
+
| `modeler_transform_mesh` | `TransformMeshTool.ts` | Applies translation, rotation (degrees), uniform scale, or origin recentering |
|
|
381
|
+
| `modeler_create_material` | `CreateMaterialTool.ts` | Creates PBR materials with albedo color, roughness, metallic, and emissive |
|
|
382
|
+
| `modeler_apply_material` | `ApplyMaterialTool.ts` | Assigns existing or newly created PBR materials to scene meshes |
|
|
383
|
+
| `modeler_auto_uv` | `AutoUVMappingTool.ts` | Generates Triplanar, Planar, or Cylindrical UV coordinates |
|
|
384
|
+
| `modeler_clone_array` | `CloneArrayTool.ts` | Spawns linear, grid, or circular radial arrays of meshes |
|
|
385
|
+
| `modeler_merge_meshes` | `MergeMeshesTool.ts` | Bakes multiple child meshes into a single unified mesh geometry |
|
|
386
|
+
| `modeler_separate_mesh` | `SeparateMeshTool.ts` | Splits disconnected mesh components into independent meshes |
|
|
387
|
+
| `modeler_delete_mesh` | `DeleteMeshTool.ts` | Deletes specified meshes or hierarchy nodes from the scene |
|
|
388
|
+
| `modeler_build_voxel_mesh`| `BuildVoxelMeshTool.ts` | Constructs optimized voxel meshes from coordinate lists and palette indices |
|
|
389
|
+
| `modeler_execute_code` | `ExecuteBabylonCodeTool.ts`| Executes sandboxed Babylon.js code directly on the active `Scene` |
|
|
390
|
+
| `modeler_solidify_mesh` | `SolidifyMeshTool.ts` | Thickens two-sided open surfaces by extruding boundary normals |
|
|
391
|
+
| `modeler_subdivide_mesh` | `SubdivideMeshTool.ts` | Subdivides mesh geometry to increase polygon density for deformation |
|
|
392
|
+
| `modeler_subd_smooth` | `SubDSmoothTool.ts` | Applies Catmull-Clark style smoothing to hard polygonal surfaces |
|
|
393
|
+
| `facet_extrude` | `FacetExtrudeTool.ts` | Extrudes selected triangular facets along face normals |
|
|
394
|
+
| `facet_inset` | `FacetInsetTool.ts` | Insets boundaries of selected facets to create inner facet borders |
|
|
395
|
+
| `facet_arc` | `FacetArcTool.ts` | Extrudes facets along smooth curved arcs for arches and handles |
|
|
396
|
+
| `facet_cut_through` | `FacetCutThroughTool.ts` | Slices through mesh geometry between opposing facet selections |
|
|
397
|
+
| `modeler_spawn_base_mesh` | `SpawnBaseMeshTool.ts` | Spawns anatomical base meshes (humanoid, quadruped, bust) for sculpting |
|
|
398
|
+
| `modeler_retopologize` | `RetopologizeMeshTool.ts` | Runs Quadric Error Metrics (QEM) decimation to target triangle budgets |
|
|
399
|
+
| `modeler_sculpt_mesh` | `SculptMeshTool.ts` | Applies localized brush sculpting deformations at specific 3D coordinates |
|
|
400
|
+
| `modeler_create_sdf_mesh` | `CreateSdfMeshTool.ts` | Evaluates Signed Distance Fields and polygonizes via Surface Nets |
|
|
401
|
+
| `modeler_create_rounded_box`| `CreateRoundedBoxTool.ts`| Generates parametric boxes with rounded bevel edges |
|
|
402
|
+
| `modeler_create_wall` | `CreateWallTool.ts` | Creates architectural walls with integrated window and door openings |
|
|
403
|
+
| `modeler_create_arch` | `CreateArchTool.ts` | Builds Roman, Gothic, or Horseshoe architectural arches |
|
|
404
|
+
| `modeler_create_column` | `CreateColumnTool.ts` | Constructs classical Doric, Ionic, or Corinthian columns with fluting |
|
|
405
|
+
| `modeler_create_molding` | `CreateMoldingTool.ts` | Extrudes crown molding, baseboards, and cornices along room paths |
|
|
406
|
+
| `modeler_create_stairs` | `CreateStairsTool.ts` | Generates straight, L-shaped, U-shaped, or spiral staircases |
|
|
407
|
+
| `modeler_create_roof` | `CreateRoofTool.ts` | Builds gable, hip, mansard, or shed roofs over building perimeters |
|
|
408
|
+
| `modeler_plan_model` | `PlanModelTool.ts` | Generates structured multi-step construction plans prior to execution |
|
|
409
|
+
| `modeler_generate_neural_mesh`| `GenerateNeuralMeshTool.ts`| Delegates generation to external Neural 3D backends (TRELLIS 2, Hunyuan3D, Hi3D) |
|
|
410
|
+
| `modeler_uv_unwrap` | `UVUnwrapTool.ts` | Performs conformal UV unwrapping and packs UV islands into $[0, 1]$ |
|
|
411
|
+
| `modeler_bake_textures` | `BakeTexturesTool.ts` | Bakes normal, ambient occlusion, and diffuse maps from high to low poly |
|
|
412
|
+
| `modeler_rig_weight` | `RigWeightTool.ts` | Generates bone skeletons and computes vertex skinning weights |
|
|
413
|
+
| `modeler_generate_texture`| `GenerateTextureTool.ts`| Generates procedural or neural textures and assigns them to materials |
|
|
414
|
+
| `modeler_create_text_mesh`| `CreateTextMeshTool.ts` | Extrudes 3D text meshes using typeface vector definitions |
|
|
415
|
+
| `modeler_decal` | `DecalTool.ts` | Projects 2D decal textures onto mesh surfaces at specified positions |
|
|
416
|
+
|
|
417
|
+
### ToolRegistry & OpenAI Function Schemas
|
|
418
|
+
|
|
419
|
+
The [`ToolRegistry`](src/tools/ToolRegistry.ts) aggregates all tools and generates OpenAI-compatible tool definitions via `getOpenAITools()`:
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import { ToolRegistry } from 'mesheditor';
|
|
423
|
+
|
|
424
|
+
const registry = new ToolRegistry();
|
|
425
|
+
const openAITools = registry.getOpenAITools();
|
|
426
|
+
|
|
427
|
+
// Execute a tool safely by name with argument validation
|
|
428
|
+
const resultJson = await registry.execute(
|
|
429
|
+
'modeler_create_primitive',
|
|
430
|
+
{ type: 'cylinder', diameter: 2.0, height: 4.0, name: 'pillar' },
|
|
431
|
+
executionContext
|
|
432
|
+
);
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Bring-Your-Own-AI (BYO-AI) & Modeling Skills
|
|
438
|
+
|
|
439
|
+
The Mesh Editor features a **Bring Your Own AI (BYO-AI)** architecture with zero proprietary lock-in. The built-in AI Mesh Agent (`✨`) acts as an intelligent co-pilot capable of reasoning about 3D space, planning multi-step modeling sequences, executing tool calls, and iteratively refining geometries based on visual feedback.
|
|
440
|
+
|
|
441
|
+
### Supported LLM / VLM Endpoints
|
|
442
|
+
|
|
443
|
+
Open **Tools → AI Mesh Agent (`✨`)** and click **Settings (`⚙`)** to configure any OpenAI-compatible API endpoint:
|
|
444
|
+
|
|
445
|
+
| Endpoint Preset | Base URL | Recommended Models | Description |
|
|
446
|
+
| :--- | :--- | :--- | :--- |
|
|
447
|
+
| **Antigravity Bridge** | `http://127.0.0.1:8317/v1` | `gemini-3.8-flash-high`, `claude-sonnet-5-5-high` | Direct zero-config bridge to authenticated local Antigravity CLI (`agy`) |
|
|
448
|
+
| **oMLX (Local)** | `http://localhost:8000/v1` | `mlx-community/Qwen2.5-Coder-32B-Instruct` | Local Apple Silicon MLX inference server |
|
|
449
|
+
| **Ollama (Local)** | `http://localhost:11434/v1` | `qwen2.5-coder:32b`, `llama3.3:70b` | Local Ollama server |
|
|
450
|
+
| **LM Studio** | `http://localhost:1234/v1` | Any loaded GGUF model | Local LM Studio OpenAI-compatible server |
|
|
451
|
+
| **Google Gemini** | `https://generativelanguage.googleapis.com/v1beta/openai` | `gemini-2.5-pro`, `gemini-2.5-flash` | Cloud Gemini via OpenAI compatibility layer |
|
|
452
|
+
| **OpenAI** | `https://api.openai.com/v1` | `gpt-4o`, `o3-mini` | Cloud OpenAI API |
|
|
453
|
+
| **OpenRouter** | `https://openrouter.ai/api/v1` | `anthropic/claude-3.7-sonnet`, `deepseek/deepseek-r1` | Universal gateway for open and proprietary models |
|
|
454
|
+
|
|
455
|
+
### Antigravity Local CLI Bridge (`agy`)
|
|
456
|
+
|
|
457
|
+
The repository includes a dedicated proxy script ([`scripts/antigravity-bridge.js`](scripts/antigravity-bridge.js)) that translates OpenAI `/v1/chat/completions` and `/v1/models` requests into local Antigravity CLI commands. This enables developers to run the AI Mesh Agent using their active Antigravity account without needing separate cloud API keys:
|
|
458
|
+
|
|
459
|
+
```bash
|
|
460
|
+
# Run standalone Antigravity bridge server on port 8787
|
|
461
|
+
npm run ai:bridge
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
*(Note: During `npm run dev`, the Webpack Dev Server automatically mounts the bridge proxy at `/api/antigravity/v1/`).*
|
|
465
|
+
|
|
466
|
+
### Domain-Specific Modeling Skills
|
|
467
|
+
|
|
468
|
+
AI agent instructions and modeling principles are authored as clean Markdown files in [`skills/`](skills/). During the build process, `npm run sync:skills` compiles these markdown files into [`src/builtInSkills.ts`](src/builtInSkills.ts), allowing dynamic skill injection based on user prompts:
|
|
469
|
+
|
|
470
|
+
1. **[`procedural-modeler.md`](skills/procedural-modeler.md)**: Rules for spatial proportions, ground snapping ($Y \ge 0$), CSG2 boolean subtraction, lathe profiles, and parametric architectural construction.
|
|
471
|
+
2. **[`figure-sculptor.md`](skills/figure-sculptor.md)**: Anatomical base mesh blockouts, progressive brush sculpting, quad subdivision, and QEM polygon decimation.
|
|
472
|
+
3. **[`mesh-updater.md`](skills/mesh-updater.md)**: Inspecting existing scene hierarchies, targeted component modifications, and preserving transformations without destructive scene clearing.
|
|
473
|
+
4. **[`neural-3d-generator.md`](skills/neural-3d-generator.md)**: Guidelines for delegating organic hero subtasks to TRELLIS 2, Hunyuan3D, or Hi3D, followed by automatic bounding-box normalization and ground alignment.
|
|
474
|
+
5. **[`voxel-painter.md`](skills/voxel-painter.md)**: 3D grid voxel modeling, palette coordination, and textured chunk assembly.
|
|
475
|
+
6. **[`image-to-mesh.md`](skills/image-to-mesh.md)**: Reconstructing 3D proportions and silhouette geometries from uploaded 2D reference images.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## Hybrid Neural 3D Generators (TRELLIS 2, Hunyuan3D, Hi3D)
|
|
480
|
+
|
|
481
|
+
In addition to deterministic procedural 3D modeling, the AI Mesh Agent can delegate full 3D generation or organic subtasks to external **Neural 3D Generators**.
|
|
482
|
+
|
|
483
|
+
### Multi-Provider Protocols
|
|
484
|
+
|
|
485
|
+
Under **Settings (`⚙`) → Neural 3D Generators**, developers can configure one or more backends:
|
|
486
|
+
|
|
487
|
+
| Backend | Protocol Options | Best Use Cases |
|
|
488
|
+
| :--- | :--- | :--- |
|
|
489
|
+
| **TRELLIS 2 / TRELLIS** | `omlx`, `local_rest`, `gradio`, `fal` | **Clean SLAT Mesh Structures & High Visual Fidelity**: Statues, creatures, foliage, and intricate organic props |
|
|
490
|
+
| **Hunyuan3D** | `omlx`, `local_rest`, `gradio`, `fal` | **Fast Textured Objects (`DiT` + `Paint`)**: Rapid generation of pre-textured game assets with baked UV albedo |
|
|
491
|
+
| **Hi3D (V1.0–V3.0)** | `omlx`, `local_rest`, `gradio`, `replicate` | **Watertight 2K Meshes (`2k_print`)**: High-resolution, dense manifold geometry ready for direct 3D printing |
|
|
492
|
+
|
|
493
|
+
Supported communication protocols:
|
|
494
|
+
- **`omlx`**: Connects to a local Apple Silicon MLX server (`http://localhost:8000/v1/3d/generations`).
|
|
495
|
+
- **`local_rest`**: Connects to custom FastAPI microservices returning `.glb`, `.obj`, `.stl`, or Base64 JSON.
|
|
496
|
+
- **`gradio`**: Connects to Gradio WebUIs (`/api/predict` or `/run/predict`) and resolves generated mesh file paths.
|
|
497
|
+
- **`fal` & `replicate`**: Connects to cloud serverless endpoints using personal API keys stored in `localStorage`.
|
|
498
|
+
|
|
499
|
+
### Procedural + Neural Composition Workflow
|
|
500
|
+
|
|
501
|
+
Rather than treating neural generation as an isolated black box, the agent combines procedural precision with neural organic modeling:
|
|
502
|
+
|
|
503
|
+
```mermaid
|
|
504
|
+
flowchart TD
|
|
505
|
+
A["User Prompt: 'Build a marble pedestal with a bronze lion statue on top'"] --> B["AI Mesh Agent (AIAgentService)"]
|
|
506
|
+
B --> C["Step 1: Procedural Precision<br/>Builds stepped plinth & pedestal (height = 1.5m) via CSG & Primitives"]
|
|
507
|
+
B --> D["Step 2: Neural Delegation<br/>Calls modeler_generate_neural_mesh(prompt: 'bronze lion statue', targetHeight: 1.8)"]
|
|
508
|
+
D --> E["GenerateNeuralMeshTool<br/>Imports binary .glb into Babylon Scene"]
|
|
509
|
+
E --> F["Bounding Box Normalization<br/>Scales asset uniformly to exactly 1.8m height"]
|
|
510
|
+
F --> G["Ground Alignment & Positioning<br/>Aligns base to Y = 0, then translates to [0, 1.5, 0]"]
|
|
511
|
+
G --> H["QEM Polygon Decimation<br/>Decimates to target polygon budget while preserving UVs"]
|
|
512
|
+
C --> I["Completed Hybrid 3D Scene"]
|
|
513
|
+
H --> I
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## Web Component & NPM Library Integration
|
|
519
|
+
|
|
520
|
+
### Using `<mesh-editor>` Custom Element
|
|
521
|
+
|
|
522
|
+
#### Installation via NPM
|
|
523
|
+
|
|
524
|
+
You can install Mesh Editor via NPM in multiple ways:
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
# 1. Direct install from GitHub Release tarball (No npm registry needed):
|
|
528
|
+
npm install https://github.com/peer2p/mesheditor/releases/download/v1.0.1/mesheditor-1.0.1.tgz
|
|
529
|
+
|
|
530
|
+
# 2. From local downloaded tarball:
|
|
531
|
+
npm install ./mesheditor-1.0.1.tgz
|
|
532
|
+
|
|
533
|
+
# 3. From extracted release directory:
|
|
534
|
+
npm install ./MeshEditor-1.0.1-webcomponent-lib
|
|
535
|
+
|
|
536
|
+
# 4. Standard registry install (once published to npmjs):
|
|
537
|
+
npm install mesheditor
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
> [!TIP]
|
|
541
|
+
> - **Interactive StackBlitz Showcase**: Open and run the standalone Vite + Web Component showcase with one click in your browser: [](https://stackblitz.com/github/peer2p/mesheditor/tree/main/examples/web-component-showcase) (Source code in [`examples/web-component-showcase/`](examples/web-component-showcase/))
|
|
542
|
+
> - **Live Integration Example**: Check out the interactive [Host Application & Plugin Integration Demo](https://peer2p.github.io/mesheditor/webcomponent-example.html) (or locally in `docs/webcomponent-example.html`) showcasing live plugins, telemetry, and two-way host communication.
|
|
543
|
+
|
|
544
|
+
Import and embed `<mesh-editor>` anywhere in your HTML application:
|
|
545
|
+
|
|
546
|
+
```html
|
|
547
|
+
<script type="module">
|
|
548
|
+
import 'mesheditor';
|
|
549
|
+
import 'mesheditor/style.css';
|
|
550
|
+
</script>
|
|
551
|
+
|
|
552
|
+
<div style="width: 100vw; height: 100vh;">
|
|
553
|
+
<mesh-editor
|
|
554
|
+
id="editor"
|
|
555
|
+
src="/models/character.glb"
|
|
556
|
+
layout="stackpanel"
|
|
557
|
+
grid="true"
|
|
558
|
+
save-button-label="Save to Server"
|
|
559
|
+
suppress-download
|
|
560
|
+
></mesh-editor>
|
|
561
|
+
</div>
|
|
562
|
+
|
|
563
|
+
<script type="module">
|
|
564
|
+
const editor = document.getElementById('editor');
|
|
565
|
+
|
|
566
|
+
// Intercept save button clicks
|
|
567
|
+
editor.addEventListener('model-saved', async (event) => {
|
|
568
|
+
const { blob, filename } = event.detail;
|
|
569
|
+
console.log(`Received model save for ${filename} (${blob.size} bytes)`);
|
|
570
|
+
|
|
571
|
+
// Upload to server
|
|
572
|
+
const formData = new FormData();
|
|
573
|
+
formData.append('file', blob, filename);
|
|
574
|
+
await fetch('/api/models/save', { method: 'POST', body: formData });
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
// Track model exports (.glb, .gltf, .obj, .stl)
|
|
578
|
+
editor.addEventListener('model-exported', (event) => {
|
|
579
|
+
const { blob, filename, format } = event.detail;
|
|
580
|
+
console.log(`Exported ${format}: ${filename}`);
|
|
581
|
+
});
|
|
582
|
+
</script>
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
#### Custom Element Attributes & Properties
|
|
586
|
+
|
|
587
|
+
| Attribute | Type | Default | Description |
|
|
588
|
+
| :--- | :--- | :--- | :--- |
|
|
589
|
+
| `src` | `string` | `""` | URL of a `.glb`, `.gltf`, `.obj`, or `.stl` model to load automatically on startup |
|
|
590
|
+
| `layout` | `"floating" \| "stackpanel"` | `"floating"` | UI layout mode: floating draggable windows or dockable right sidebar stackpanel |
|
|
591
|
+
| `grid` | `"true" \| "false"` | `"true"` | Controls visibility of the 3D ground reference grid |
|
|
592
|
+
| `save-button-label` | `string` | `""` | When set, renders a primary Save button in the top toolbar with this label |
|
|
593
|
+
| `suppress-download` | `boolean` | `false` | When true, suppresses automatic browser file downloads and dispatches `model-saved` event |
|
|
594
|
+
|
|
595
|
+
#### Programmatic Methods on `<mesh-editor>`
|
|
596
|
+
|
|
597
|
+
- `editor.openModel(source: File | Blob | string, name?: string): Promise<void>`
|
|
598
|
+
- `editor.importModel(source: File | Blob | string, name?: string): Promise<void>`
|
|
599
|
+
- `editor.exportGLB(filename?: string): Promise<Blob>`
|
|
600
|
+
- `editor.getScene(): BABYLON.Scene`
|
|
601
|
+
- `editor.getApp(): MeshEditorApp`
|
|
602
|
+
- `editor.getService(): MeshEditorService`
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
### Programmatic TypeScript Integration
|
|
607
|
+
|
|
608
|
+
Integrate `MeshEditorApp` directly into custom DOM containers with the `HostAppAdapter`:
|
|
609
|
+
|
|
610
|
+
```typescript
|
|
611
|
+
import { MeshEditorApp, HostAppAdapter } from 'mesheditor';
|
|
612
|
+
|
|
613
|
+
const container = document.getElementById('editor-mount')!;
|
|
614
|
+
|
|
615
|
+
const app = new MeshEditorApp({
|
|
616
|
+
container: container,
|
|
617
|
+
layoutMode: 'stackpanel',
|
|
618
|
+
adapter: new HostAppAdapter({
|
|
619
|
+
saveButtonLabel: 'Save Asset',
|
|
620
|
+
suppressBrowserDownload: true,
|
|
621
|
+
onSaveToHost: async (blob: Blob, filename: string) => {
|
|
622
|
+
console.log(`Saved ${filename} to host application`);
|
|
623
|
+
},
|
|
624
|
+
onModelLoaded: (filename: string) => {
|
|
625
|
+
console.log(`Loaded model: ${filename}`);
|
|
626
|
+
},
|
|
627
|
+
onModelExported: (blob: Blob, filename: string, format: string) => {
|
|
628
|
+
console.log(`Exported ${format} file: ${filename}`);
|
|
629
|
+
},
|
|
630
|
+
}),
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
// Access underlying Babylon.js scene
|
|
634
|
+
const scene = app.getService().getScene();
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## Extensibility & Custom Plugin System
|
|
640
|
+
|
|
641
|
+
The Mesh Editor provides a clean plugin architecture (`MeshEditorPlugin`) enabling host applications to inject custom menus, toolbar actions, modals, and asset browsers without modifying core code.
|
|
642
|
+
|
|
643
|
+
```typescript
|
|
644
|
+
import { MeshEditorPlugin, MeshEditorPluginContext } from 'mesheditor';
|
|
645
|
+
|
|
646
|
+
export class AssetCatalogPlugin implements MeshEditorPlugin {
|
|
647
|
+
public readonly id = 'company-asset-catalog';
|
|
648
|
+
public readonly name = 'Asset Catalog';
|
|
649
|
+
public readonly version = '1.0.0';
|
|
650
|
+
|
|
651
|
+
private context!: MeshEditorPluginContext;
|
|
652
|
+
|
|
653
|
+
public initialize(context: MeshEditorPluginContext): void {
|
|
654
|
+
this.context = context;
|
|
655
|
+
|
|
656
|
+
// Register an action in the File dropdown menu
|
|
657
|
+
context.registerFileMenuItem({
|
|
658
|
+
id: 'menuOpenFileCatalog',
|
|
659
|
+
label: 'Browse Asset Catalog...',
|
|
660
|
+
icon: 'folder',
|
|
661
|
+
onClick: () => this.openCatalogModal(),
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// Register a shortcut in the Actions dropdown menu
|
|
665
|
+
context.registerActionMenuItem({
|
|
666
|
+
id: 'menuActionQuickAnalyze',
|
|
667
|
+
label: 'Calculate Scene Complexity',
|
|
668
|
+
icon: 'activity',
|
|
669
|
+
shortcut: '⌥C',
|
|
670
|
+
onClick: () => this.calculateComplexity(),
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
private calculateComplexity(): void {
|
|
675
|
+
const scene = this.context.getScene();
|
|
676
|
+
let totalTriangles = 0;
|
|
677
|
+
for (const mesh of scene.meshes) {
|
|
678
|
+
if (mesh.getTotalIndices) {
|
|
679
|
+
totalTriangles += mesh.getTotalIndices() / 3;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
this.context.showToast(
|
|
683
|
+
`Scene Complexity: ${scene.meshes.length} meshes, ${totalTriangles.toLocaleString()} triangles.`,
|
|
684
|
+
'info'
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
private openCatalogModal(): void {
|
|
689
|
+
// Open custom modal and load models via this.context.openModel(...)
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
public dispose(): void {
|
|
693
|
+
// Teardown custom DOM elements or event listeners
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Register into app instance
|
|
698
|
+
await app.use(new AssetCatalogPlugin());
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
---
|
|
702
|
+
|
|
703
|
+
## Desktop Application (Electron)
|
|
704
|
+
|
|
705
|
+
The Mesh Editor includes a complete Electron desktop integration (`electron/main.js`, `electron/preload.js`, and `ElectronPlatformAdapter`) providing:
|
|
706
|
+
|
|
707
|
+
- Native OS File Open and Import dialogs with automatic companion file resolution (`.bin` and textures for `.gltf`)
|
|
708
|
+
- Native OS File Save dialogs (`⌘S` / `Ctrl+S`) writing directly to local disk paths
|
|
709
|
+
- Native macOS, Windows, and Linux Application Menu Bar with keyboard shortcuts
|
|
710
|
+
- Secure context isolation (`contextIsolation: true`, `nodeIntegration: false`) via `window.meshEditorElectron` IPC bridge
|
|
711
|
+
|
|
712
|
+
```bash
|
|
713
|
+
# Launch desktop app connected to local dev server
|
|
714
|
+
npm run desktop:dev
|
|
715
|
+
|
|
716
|
+
# Build web assets and launch desktop app locally
|
|
717
|
+
npm run desktop:start
|
|
718
|
+
|
|
719
|
+
# Package native macOS app (.dmg and .zip for Apple Silicon & Intel)
|
|
720
|
+
npm run desktop:build:mac
|
|
721
|
+
|
|
722
|
+
# Package native Windows installer (.exe NSIS & Portable)
|
|
723
|
+
npm run desktop:build:win
|
|
724
|
+
|
|
725
|
+
# Package native Linux app (.AppImage & .deb)
|
|
726
|
+
npm run desktop:build:linux
|
|
727
|
+
|
|
728
|
+
# Package all desktop platforms in one run
|
|
729
|
+
npm run desktop:build:all
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
> [!NOTE]
|
|
733
|
+
> **macOS Gatekeeper & Apple Silicon Signing Note**:
|
|
734
|
+
> Because the application is distributed as an open-source binary without an Apple Developer ID certificate (\$99/yr), macOS attaches the `com.apple.quarantine` extended attribute to files downloaded via web browsers. On macOS Sonoma/Sequoia, Gatekeeper will report:
|
|
735
|
+
> *"Mesh Editor.app is damaged and can't be opened. You should move it to the Trash."*
|
|
736
|
+
>
|
|
737
|
+
> To resolve this and open the app:
|
|
738
|
+
> 1. **Terminal Command (Instant Fix)**:
|
|
739
|
+
> ```bash
|
|
740
|
+
> xattr -cr "/Applications/Mesh Editor.app"
|
|
741
|
+
> ```
|
|
742
|
+
> *(Or `xattr -cr ~/Downloads/"Mesh Editor.app"` if running directly from Downloads).*
|
|
743
|
+
> 2. **System Settings**: Go to **System Settings > Privacy & Security**, scroll to the **Security** section, and click **"Open Anyway"**.
|
|
744
|
+
> 3. **Ad-Hoc Signing**: In `electron-builder.yml`, `identity: "-"` is explicitly configured to sign the entire bundle structure ad-hoc, ensuring Mach-O binary validation and sealed resources pass verification on Apple Silicon.
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## Testing Architecture & Test Suites
|
|
749
|
+
|
|
750
|
+
Testing a 3D WebGL application requires balancing **fast, deterministic execution** of scene math, vertex buffers, and undo/redo stacks with **real browser verification** of WebGL canvases, DOM menus, and custom elements.
|
|
751
|
+
|
|
752
|
+
The repository employs a **two-tier testing strategy**:
|
|
753
|
+
|
|
754
|
+
```
|
|
755
|
+
tests/
|
|
756
|
+
├── integration/ # Stage 1: Fast Headless 3D tests (Vitest + Babylon NullEngine + jsdom)
|
|
757
|
+
│ ├── service.test.ts # Core 3D engine: primitives, gizmos, transforms, CSG2, undo/redo (35 tests)
|
|
758
|
+
│ ├── app-and-plugins.test.ts # UI orchestration, Outliner sync, PluginManager, HostAppAdapter (14 tests)
|
|
759
|
+
│ ├── tools.test.ts # ToolRegistry, 44 built-in tools, OpenAI function schemas (25 tests)
|
|
760
|
+
│ ├── ai-agent.test.ts # Multi-turn BYO-AI agent, SSE streaming, multi-provider presets (17 tests)
|
|
761
|
+
│ ├── electron-adapter.test.ts # Native file dialogs, companion file resolution, IPC bridge (7 tests)
|
|
762
|
+
│ ├── scene-hierarchy-and-separation.test.ts # Groups, loose-parts separation, outliner search (9 tests)
|
|
763
|
+
│ ├── gaming-pipeline-tools.test.ts # UV unwrapping, baking, rigging, weight paint, decals (11 tests)
|
|
764
|
+
│ ├── architecture-tools.test.ts # Walls, openings, arches, columns, moldings, stairs (11 tests)
|
|
765
|
+
│ ├── sdf-modeling.test.ts # Signed Distance Fields & Surface Nets polygonizer (3 tests)
|
|
766
|
+
│ ├── voxel-painter.test.ts # Voxel grids, palettes, meshing, and chunk operations (24 tests)
|
|
767
|
+
│ ├── path-extrusion.test.ts # Spline path factory, extrusion controller, 2D profiles (8 tests)
|
|
768
|
+
│ ├── sculpt-retopo.test.ts # Dynamic sculpt brushes, quad decimation, subdivision (12 tests)
|
|
769
|
+
│ ├── compress-model.test.ts # QEM geometry decimation & WebP texture compression (9 tests)
|
|
770
|
+
│ ├── ai-texture-generator.test.ts # Procedural and neural texture synthesis workflows (20 tests)
|
|
771
|
+
│ └── prompt-help.test.ts # Prompt help, vision inputs, and modeling skills (13 tests)
|
|
772
|
+
└── e2e/
|
|
773
|
+
└── editor.spec.ts # Stage 2: Real-browser WebGL E2E smoke tests (Playwright Chromium)
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### Headless 3D Integration Tests (Vitest + NullEngine)
|
|
777
|
+
|
|
778
|
+
By injecting Babylon's headless **`NullEngine`**, the integration test suite executes real 3D matrix math, bounding box calculations, vertex buffer transformations, and CSG2 booleans directly in Node.js without needing a physical GPU (~30 seconds for all **211 tests**):
|
|
779
|
+
|
|
780
|
+
```bash
|
|
781
|
+
# Run headless 3D integration tests
|
|
782
|
+
npm test
|
|
783
|
+
|
|
784
|
+
# Run tests in interactive watch mode
|
|
785
|
+
npm run test:watch
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
### Browser E2E Tests (Playwright)
|
|
789
|
+
|
|
790
|
+
Stage 2 launches the compiled application inside a real Chromium browser with WebGL enabled to verify end-to-end user workflows:
|
|
791
|
+
|
|
792
|
+
- WebGL canvas initialization and `<mesh-editor>` custom element mounting
|
|
793
|
+
- Spawning primitives via GUI panels and verifying live Outliner updates
|
|
794
|
+
- Interactive mesh deletion and toolbar Undo (`#btnUndo`) / Redo (`#btnRedo`)
|
|
795
|
+
- Switching between Floating and Stackpanel layout modes
|
|
796
|
+
- Opening and closing modals and floating dialogs
|
|
797
|
+
|
|
798
|
+
```bash
|
|
799
|
+
# Run browser E2E tests (automatically boots webpack dev server on port 8080)
|
|
800
|
+
npm run test:e2e
|
|
801
|
+
|
|
802
|
+
# Run all integration tests followed by browser E2E tests
|
|
803
|
+
npm run test:all
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
---
|
|
807
|
+
|
|
808
|
+
## Developer Scripts & Build Workflow
|
|
809
|
+
|
|
810
|
+
| NPM Script | Command | Purpose |
|
|
811
|
+
| :--- | :--- | :--- |
|
|
812
|
+
| `npm run dev` | `webpack serve --mode development` | Starts Webpack Dev Server with hot reload on `http://localhost:8080` |
|
|
813
|
+
| `npm run build` | `webpack --mode production` | Compiles production standalone web app into `dist/` |
|
|
814
|
+
| `npm run build:lib` | *Multiple build steps* | Builds ESM (`dist-lib/esm/`), UMD (`dist-lib/index.umd.js`), `.d.ts`, and standalone Web Component bundle (`dist-lib/standalone/`) |
|
|
815
|
+
| `npm run type-check` | `tsc --noEmit` | Validates TypeScript types across the entire project |
|
|
816
|
+
| `npm test` | `vitest run` | Runs all 15 headless 3D integration test suites (211 tests) |
|
|
817
|
+
| `npm run test:watch` | `vitest` | Runs Vitest in interactive watch mode |
|
|
818
|
+
| `npm run test:e2e` | `playwright test` | Executes Playwright Chromium browser E2E tests |
|
|
819
|
+
| `npm run test:all` | `vitest run && playwright test` | Executes full test suite (Integration + E2E) |
|
|
820
|
+
| `npm run sync:templates` | `node scripts/sync-templates.js` | Synchronizes decentralized `.ejs` views into `toolViews.ts` and `src/template.ts` |
|
|
821
|
+
| `npm run sync:skills` | `node scripts/sync-skills.js` | Compiles markdown skills (`skills/*.md`) into `src/builtInSkills.ts` |
|
|
822
|
+
| `npm run ai:bridge` | `node scripts/antigravity-bridge.js` | Starts local OpenAI-compatible bridge to Antigravity CLI (`agy`) on port 8787 |
|
|
823
|
+
| `npm run desktop:dev` | `electron electron/main.js --dev` | Launches Electron connected to the live dev server |
|
|
824
|
+
| `npm run desktop:start` | `npm run build && electron ...` | Builds web app and launches desktop app locally |
|
|
825
|
+
| `npm run desktop:build:mac` | `electron-builder --mac ...` | Packages macOS application (`.dmg` & `.zip` for Apple Silicon & Intel) |
|
|
826
|
+
| `npm run desktop:build:win` | `electron-builder --win ...` | Packages Windows application (NSIS installer & portable `.exe`) |
|
|
827
|
+
| `npm run desktop:build:linux`| `electron-builder --linux ...` | Packages Linux application (`.AppImage` & `.deb`) |
|
|
828
|
+
| `npm run desktop:build:all` | `electron-builder -mwl ...` | Packages macOS, Windows, and Linux apps in a single run into `release/` |
|
|
829
|
+
| `npm run icons:generate` | `node scripts/generate-icons.js` | Generates desktop app icons (`.icns`, `.ico`, `.png`) from `icon.png` |
|
|
830
|
+
| `npm run clean` | `rm -rf dist dist-lib release` | Cleans all build and release output directories |
|
|
831
|
+
|
|
832
|
+
---
|
|
833
|
+
|
|
834
|
+
## CI/CD & GitHub Actions Workflows
|
|
835
|
+
|
|
836
|
+
Automated build and testing pipelines are defined in [`.github/workflows/`](.github/workflows/):
|
|
837
|
+
|
|
838
|
+
- **CI (`ci.yml`)**: Triggered on push and pull requests to `main`, `master`, and `develop`. Executes `type-check`, runs the Vitest integration test suite, builds the standalone web application (`dist/`) and NPM library (`dist-lib/`), and archives build artifacts.
|
|
839
|
+
- **Release (`release.yml`)**: Triggered by semantic version tags (`v*.*.*`). Builds and packages native installers for **macOS** (`arm64` + `x64`), **Windows** (`.exe`), **Linux** (`.AppImage` + `.deb`), compiles the standalone web bundle (`.zip`) and NPM library package (`.tgz`), computes SHA-256 checksums (`SHA256SUMS.txt`), and drafts a GitHub Release.
|
|
840
|
+
- **Pages (`pages.yml`)**: Automatically deploys the standalone web application to **GitHub Pages** on commits to `main`/`master`.
|
|
841
|
+
|
|
842
|
+
---
|
|
843
|
+
|
|
844
|
+
## License
|
|
845
|
+
|
|
846
|
+
This project is licensed under the **Apache License, Version 2.0** (the "License"). You may obtain a copy of the License in the [LICENSE](LICENSE) file or at:
|
|
847
|
+
|
|
848
|
+
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
849
|
+
|
|
850
|
+
### Summary of Terms
|
|
851
|
+
|
|
852
|
+
- **Permitted**: Commercial use, modification, distribution, patent grant, and private use.
|
|
853
|
+
- **Conditions**: Inclusion of the original copyright notice, attribution, and license text.
|
|
854
|
+
- **Warranty**: Software is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|