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.
- package/LICENSE +201 -0
- package/README.md +853 -2
- package/dist-lib/esm/AIAgentService.d.ts +106 -0
- package/dist-lib/esm/AIAgentService.js +1471 -0
- package/dist-lib/esm/MeshEditorApp.d.ts +412 -0
- package/dist-lib/esm/MeshEditorApp.js +9092 -0
- package/dist-lib/esm/MeshEditorService.d.ts +459 -0
- package/dist-lib/esm/MeshEditorService.js +7083 -0
- package/dist-lib/esm/Neural3DGeneratorService.d.ts +88 -0
- package/dist-lib/esm/Neural3DGeneratorService.js +1397 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.d.ts +16 -0
- package/dist-lib/esm/adapters/BrowserPlatformAdapter.js +25 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.d.ts +32 -0
- package/dist-lib/esm/adapters/ElectronPlatformAdapter.js +336 -0
- package/dist-lib/esm/adapters/HostAppAdapter.d.ts +54 -0
- package/dist-lib/esm/adapters/HostAppAdapter.js +75 -0
- package/dist-lib/esm/adapters/PlatformAdapter.d.ts +98 -0
- package/dist-lib/esm/adapters/PlatformAdapter.js +1 -0
- package/dist-lib/esm/adapters/index.d.ts +13 -0
- package/dist-lib/esm/adapters/index.js +15 -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 +84 -0
- package/dist-lib/esm/baking/TextureBaker.js +709 -0
- package/dist-lib/esm/builtInSkills.d.ts +19 -0
- package/dist-lib/esm/builtInSkills.js +186 -0
- package/dist-lib/esm/compression/ModelCompressor.d.ts +87 -0
- package/dist-lib/esm/compression/ModelCompressor.js +553 -0
- package/dist-lib/esm/decals/DecalController.d.ts +147 -0
- package/dist-lib/esm/decals/DecalController.js +1031 -0
- package/dist-lib/esm/decals/decalAssetUrls.d.ts +1 -0
- package/dist-lib/esm/decals/decalAssetUrls.js +16 -0
- package/dist-lib/esm/geometry/architecture.d.ts +114 -0
- package/dist-lib/esm/geometry/architecture.js +832 -0
- package/dist-lib/esm/geometry/bevelModifier.d.ts +59 -0
- package/dist-lib/esm/geometry/bevelModifier.js +345 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.d.ts +127 -0
- package/dist-lib/esm/geometry/facetSurfaceUtils.js +676 -0
- package/dist-lib/esm/geometry/roundedBox.d.ts +15 -0
- package/dist-lib/esm/geometry/roundedBox.js +133 -0
- package/dist-lib/esm/index.d.ts +21 -0
- package/dist-lib/esm/index.js +50 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.d.ts +59 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionController.js +483 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.d.ts +76 -0
- package/dist-lib/esm/pathExtrusion/PathExtrusionStudio.js +1792 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.d.ts +95 -0
- package/dist-lib/esm/pathExtrusion/PathFactory.js +627 -0
- package/dist-lib/esm/pathExtrusion/index.d.ts +4 -0
- package/dist-lib/esm/pathExtrusion/index.js +4 -0
- package/dist-lib/esm/pathExtrusion/types.d.ts +50 -0
- package/dist-lib/esm/pathExtrusion/types.js +1 -0
- package/dist-lib/esm/plugin.d.ts +250 -0
- package/dist-lib/esm/plugin.js +144 -0
- package/dist-lib/esm/rigging/WeightPaintController.d.ts +162 -0
- package/dist-lib/esm/rigging/WeightPaintController.js +1421 -0
- package/dist-lib/esm/sculpting/SculptController.d.ts +146 -0
- package/dist-lib/esm/sculpting/SculptController.js +2038 -0
- package/dist-lib/esm/sdf/index.d.ts +2 -0
- package/dist-lib/esm/sdf/index.js +2 -0
- package/dist-lib/esm/sdf/sdfPrimitives.d.ts +97 -0
- package/dist-lib/esm/sdf/sdfPrimitives.js +402 -0
- package/dist-lib/esm/sdf/surfaceNets.d.ts +29 -0
- package/dist-lib/esm/sdf/surfaceNets.js +399 -0
- package/dist-lib/esm/styles.d.ts +11 -0
- package/dist-lib/esm/styles.js +32 -0
- package/dist-lib/esm/template.d.ts +12 -0
- package/dist-lib/esm/template.js +19 -0
- package/dist-lib/esm/textMesh/TextMeshController.d.ts +61 -0
- package/dist-lib/esm/textMesh/TextMeshController.js +405 -0
- package/dist-lib/esm/textures/AITextureGenerator.d.ts +119 -0
- package/dist-lib/esm/textures/AITextureGenerator.js +945 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.d.ts +62 -0
- package/dist-lib/esm/textures/ExternalImageGeneratorService.js +879 -0
- package/dist-lib/esm/tools/AbstractTool.d.ts +68 -0
- package/dist-lib/esm/tools/AbstractTool.js +128 -0
- package/dist-lib/esm/tools/ToolExecutionContext.d.ts +40 -0
- package/dist-lib/esm/tools/ToolExecutionContext.js +1 -0
- package/dist-lib/esm/tools/ToolInterface.d.ts +104 -0
- package/dist-lib/esm/tools/ToolInterface.js +1 -0
- package/dist-lib/esm/tools/ToolRegistry.d.ts +43 -0
- package/dist-lib/esm/tools/ToolRegistry.js +115 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.d.ts +34 -0
- package/dist-lib/esm/tools/builtin/ApplyMaterialTool.js +48 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.d.ts +34 -0
- package/dist-lib/esm/tools/builtin/AutoUVMappingTool.js +54 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.d.ts +42 -0
- package/dist-lib/esm/tools/builtin/BakeTexturesTool.js +81 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.d.ts +51 -0
- package/dist-lib/esm/tools/builtin/BooleanOperationTool.js +86 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.d.ts +78 -0
- package/dist-lib/esm/tools/builtin/BuildVoxelMeshTool.js +170 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.d.ts +75 -0
- package/dist-lib/esm/tools/builtin/CloneArrayTool.js +115 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.d.ts +118 -0
- package/dist-lib/esm/tools/builtin/CreateArchTool.js +89 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.d.ts +114 -0
- package/dist-lib/esm/tools/builtin/CreateColumnTool.js +105 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.d.ts +87 -0
- package/dist-lib/esm/tools/builtin/CreateLatheTool.js +60 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.d.ts +114 -0
- package/dist-lib/esm/tools/builtin/CreateMaterialTool.js +212 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.d.ts +120 -0
- package/dist-lib/esm/tools/builtin/CreateMoldingTool.js +95 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.d.ts +162 -0
- package/dist-lib/esm/tools/builtin/CreatePrimitiveTool.js +302 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.d.ts +120 -0
- package/dist-lib/esm/tools/builtin/CreateRoofTool.js +108 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.d.ts +101 -0
- package/dist-lib/esm/tools/builtin/CreateRoundedBoxTool.js +79 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.d.ts +224 -0
- package/dist-lib/esm/tools/builtin/CreateSdfMeshTool.js +238 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.d.ts +135 -0
- package/dist-lib/esm/tools/builtin/CreateStairsTool.js +119 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.d.ts +94 -0
- package/dist-lib/esm/tools/builtin/CreateTextMeshTool.js +131 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.d.ts +87 -0
- package/dist-lib/esm/tools/builtin/CreateTubeTool.js +59 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.d.ts +145 -0
- package/dist-lib/esm/tools/builtin/CreateWallTool.js +124 -0
- package/dist-lib/esm/tools/builtin/DecalTool.d.ts +76 -0
- package/dist-lib/esm/tools/builtin/DecalTool.js +143 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.d.ts +20 -0
- package/dist-lib/esm/tools/builtin/DeleteMeshTool.js +42 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.d.ts +21 -0
- package/dist-lib/esm/tools/builtin/ExecuteBabylonCodeTool.js +96 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.d.ts +114 -0
- package/dist-lib/esm/tools/builtin/ExtrudePolygonTool.js +77 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.d.ts +104 -0
- package/dist-lib/esm/tools/builtin/ExtrudeShapeTool.js +68 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.d.ts +36 -0
- package/dist-lib/esm/tools/builtin/FacetArcTool.js +57 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.d.ts +30 -0
- package/dist-lib/esm/tools/builtin/FacetCutThroughTool.js +49 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.d.ts +30 -0
- package/dist-lib/esm/tools/builtin/FacetExtrudeTool.js +49 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.d.ts +34 -0
- package/dist-lib/esm/tools/builtin/FacetInsetTool.js +55 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.d.ts +131 -0
- package/dist-lib/esm/tools/builtin/GenerateNeuralMeshTool.js +455 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.d.ts +87 -0
- package/dist-lib/esm/tools/builtin/GenerateTextureTool.js +216 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.d.ts +11 -0
- package/dist-lib/esm/tools/builtin/GetSceneInfoTool.js +12 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.d.ts +28 -0
- package/dist-lib/esm/tools/builtin/MergeMeshesTool.js +56 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.d.ts +87 -0
- package/dist-lib/esm/tools/builtin/PlanModelTool.js +155 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.d.ts +50 -0
- package/dist-lib/esm/tools/builtin/RetopologizeMeshTool.js +116 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.d.ts +55 -0
- package/dist-lib/esm/tools/builtin/RigWeightTool.js +139 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.d.ts +138 -0
- package/dist-lib/esm/tools/builtin/SculptMeshTool.js +255 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.d.ts +21 -0
- package/dist-lib/esm/tools/builtin/SeparateMeshTool.js +31 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.d.ts +30 -0
- package/dist-lib/esm/tools/builtin/SolidifyMeshTool.js +57 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.d.ts +66 -0
- package/dist-lib/esm/tools/builtin/SpawnBaseMeshTool.js +105 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.d.ts +23 -0
- package/dist-lib/esm/tools/builtin/SubDSmoothTool.js +37 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.d.ts +23 -0
- package/dist-lib/esm/tools/builtin/SubdivideMeshTool.js +39 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.d.ts +78 -0
- package/dist-lib/esm/tools/builtin/TransformMeshTool.js +69 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.d.ts +48 -0
- package/dist-lib/esm/tools/builtin/UVUnwrapTool.js +107 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.d.ts +60 -0
- package/dist-lib/esm/tools/builtin/VoxelPainterTool.js +153 -0
- package/dist-lib/esm/tools/builtin/index.d.ts +44 -0
- package/dist-lib/esm/tools/builtin/index.js +44 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/AIAgentEditorTool.js +43 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.d.ts +15 -0
- package/dist-lib/esm/tools/editor/AITextureEditorTool.js +28 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.d.ts +29 -0
- package/dist-lib/esm/tools/editor/AbstractEditorTool.js +56 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/AnimationPlayerEditorTool.js +29 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.d.ts +21 -0
- package/dist-lib/esm/tools/editor/BakingEditorTool.js +44 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.d.ts +20 -0
- package/dist-lib/esm/tools/editor/CSGEditorTool.js +42 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.d.ts +20 -0
- package/dist-lib/esm/tools/editor/CompressModelEditorTool.js +48 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/CreatePrimitiveEditorTool.js +36 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/DecalEditorTool.js +36 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.d.ts +23 -0
- package/dist-lib/esm/tools/editor/FacetEditorTool.js +80 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.d.ts +18 -0
- package/dist-lib/esm/tools/editor/MaterialEditorTool.js +43 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/MeshPropertiesEditorTool.js +37 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/OutlinerEditorTool.js +34 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.d.ts +26 -0
- package/dist-lib/esm/tools/editor/PathExtrusionEditorTool.js +72 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.d.ts +27 -0
- package/dist-lib/esm/tools/editor/RiggingEditorTool.js +66 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/SceneEnvironmentEditorTool.js +35 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.d.ts +28 -0
- package/dist-lib/esm/tools/editor/SculptEditorTool.js +70 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.d.ts +16 -0
- package/dist-lib/esm/tools/editor/TextMeshEditorTool.js +30 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.d.ts +17 -0
- package/dist-lib/esm/tools/editor/TextureOptimizerEditorTool.js +28 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.d.ts +27 -0
- package/dist-lib/esm/tools/editor/UVUnwrapEditorTool.js +70 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.d.ts +26 -0
- package/dist-lib/esm/tools/editor/VoxelPainterEditorTool.js +68 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.d.ts +30 -0
- package/dist-lib/esm/tools/editor/aiQuickPrompts.js +228 -0
- package/dist-lib/esm/tools/editor/index.d.ts +32 -0
- package/dist-lib/esm/tools/editor/index.js +54 -0
- package/dist-lib/esm/tools/editor/toolViews.d.ts +10 -0
- package/dist-lib/esm/tools/editor/toolViews.js +53 -0
- package/dist-lib/esm/tools/editorTools.d.ts +5 -0
- package/dist-lib/esm/tools/editorTools.js +5 -0
- package/dist-lib/esm/tools/index.d.ts +8 -0
- package/dist-lib/esm/tools/index.js +8 -0
- package/dist-lib/esm/tools/textureUtils.d.ts +18 -0
- package/dist-lib/esm/tools/textureUtils.js +288 -0
- package/dist-lib/esm/types.d.ts +164 -0
- package/dist-lib/esm/types.js +1 -0
- package/dist-lib/esm/uv/UVUnwrapController.d.ts +108 -0
- package/dist-lib/esm/uv/UVUnwrapController.js +1022 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.d.ts +15 -0
- package/dist-lib/esm/voxel/CustomVoxelMesher.js +169 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.d.ts +54 -0
- package/dist-lib/esm/voxel/TextureAtlasManager.js +630 -0
- package/dist-lib/esm/voxel/VoxelPainterController.d.ts +100 -0
- package/dist-lib/esm/voxel/VoxelPainterController.js +671 -0
- package/dist-lib/esm/voxel/index.d.ts +4 -0
- package/dist-lib/esm/voxel/index.js +4 -0
- package/dist-lib/esm/voxel/types.d.ts +78 -0
- package/dist-lib/esm/voxel/types.js +1 -0
- package/dist-lib/esm/web-component/MeshEditorElement.d.ts +103 -0
- package/dist-lib/esm/web-component/MeshEditorElement.js +246 -0
- package/dist-lib/esm/web-component/index.d.ts +1 -0
- package/dist-lib/esm/web-component/index.js +1 -0
- package/dist-lib/index.umd.js +3 -0
- package/dist-lib/mesheditor.css +2 -0
- package/dist-lib/mesheditor.css.map +1 -0
- package/dist-lib/standalone/mesheditor-element.bundle.js +3 -0
- package/package.json +114 -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
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { AbstractTool } from '../AbstractTool';
|
|
2
|
+
import { ToolExecutionContext } from '../ToolExecutionContext';
|
|
3
|
+
export declare class CreateStairsTool extends AbstractTool {
|
|
4
|
+
readonly name = "modeler_create_stairs";
|
|
5
|
+
readonly description = "Creates a straight or spiral staircase standing on Y = 0 with beveled step treads, front nosing overhang, risers/center column, and optional balusters and tubular handrails.";
|
|
6
|
+
readonly parameters: {
|
|
7
|
+
type: string;
|
|
8
|
+
properties: {
|
|
9
|
+
name: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
style: {
|
|
14
|
+
type: string;
|
|
15
|
+
enum: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
steps: {
|
|
19
|
+
type: string;
|
|
20
|
+
minimum: number;
|
|
21
|
+
maximum: number;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
width: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
stepRise: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
stepRun: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
height: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
length: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
nosing: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
railing: {
|
|
49
|
+
type: string;
|
|
50
|
+
enum: string[];
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
railingHeight: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
innerRadius: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
totalAngleDegrees: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
position: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
properties: {
|
|
69
|
+
x: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
y: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
z: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
rotationDegrees: {
|
|
81
|
+
type: string;
|
|
82
|
+
properties: {
|
|
83
|
+
x: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
y: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
z: {
|
|
90
|
+
type: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
scaling: {
|
|
95
|
+
type: string;
|
|
96
|
+
properties: {
|
|
97
|
+
x: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
y: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
z: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
color: {
|
|
109
|
+
type: string;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
roughness: {
|
|
113
|
+
type: string;
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
metallic: {
|
|
117
|
+
type: string;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
materialName: {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
texturePrompt: {
|
|
125
|
+
type: string;
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
uvScale: {
|
|
129
|
+
type: string;
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
execute(args: any, context: ToolExecutionContext): string;
|
|
135
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { buildStairsMesh } from '../../geometry/architecture';
|
|
2
|
+
import { AbstractTool } from '../AbstractTool';
|
|
3
|
+
export class CreateStairsTool extends AbstractTool {
|
|
4
|
+
name = 'modeler_create_stairs';
|
|
5
|
+
description = 'Creates a straight or spiral staircase standing on Y = 0 with beveled step treads, front nosing overhang, risers/center column, and optional balusters and tubular handrails.';
|
|
6
|
+
parameters = {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
name: { type: 'string', description: 'Descriptive name for the stairs mesh.' },
|
|
10
|
+
style: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
enum: ['straight', 'spiral'],
|
|
13
|
+
description: 'Staircase layout: "straight" (climbs along +Z from Z=0) or "spiral" (revolves around Y-axis). Default: "straight".',
|
|
14
|
+
},
|
|
15
|
+
steps: { type: 'integer', minimum: 2, maximum: 80, description: 'Number of steps (default: 10).' },
|
|
16
|
+
width: { type: 'number', description: 'Step width in meters (default: 1.2).' },
|
|
17
|
+
stepRise: { type: 'number', description: 'Height per step in meters (default: 0.18).' },
|
|
18
|
+
stepRun: { type: 'number', description: 'Depth per step in meters for straight stairs (default: 0.28).' },
|
|
19
|
+
height: { type: 'number', description: 'Optional total climb height in meters (overrides stepRise).' },
|
|
20
|
+
length: { type: 'number', description: 'Optional total horizontal run length in meters (overrides stepRun).' },
|
|
21
|
+
nosing: { type: 'number', description: 'Tread nosing overhang in meters (default: 0.025).' },
|
|
22
|
+
railing: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
enum: ['none', 'left', 'right', 'both'],
|
|
25
|
+
description: 'Handrail placement: "none", "left", "right", or "both" (default: "none").',
|
|
26
|
+
},
|
|
27
|
+
railingHeight: { type: 'number', description: 'Handrail height above treads in meters (default: 0.9).' },
|
|
28
|
+
innerRadius: { type: 'number', description: 'Center column radius in meters for style="spiral" (default: 0.2).' },
|
|
29
|
+
totalAngleDegrees: { type: 'number', description: 'Total rotation angle in degrees for style="spiral" (default: 270).' },
|
|
30
|
+
position: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
description: 'Base position { x, y, z } in meters.',
|
|
33
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
34
|
+
},
|
|
35
|
+
rotationDegrees: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
38
|
+
},
|
|
39
|
+
scaling: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
42
|
+
},
|
|
43
|
+
color: { type: 'string', description: 'Hex color string, e.g. "#b8afa3".' },
|
|
44
|
+
roughness: { type: 'number', description: 'PBR roughness (default: 0.65).' },
|
|
45
|
+
metallic: { type: 'number', description: 'PBR metallic (default: 0.05).' },
|
|
46
|
+
materialName: { type: 'string', description: 'Optional existing material name.' },
|
|
47
|
+
texturePrompt: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Optional natural language prompt to generate and apply an AI PBR texture (e.g. "Weathered ancient stone slabs", "Aged marble steps").',
|
|
50
|
+
},
|
|
51
|
+
uvScale: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
description: 'Texture UV tiling scale factor (default: 2.0).',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
execute(args, context) {
|
|
58
|
+
const baseName = String(args.name || 'staircase').replace(/\s+/g, '_');
|
|
59
|
+
const uniqueName = context.findMeshByNameOrId(baseName)
|
|
60
|
+
? `${baseName}_${Date.now().toString().slice(-4)}`
|
|
61
|
+
: baseName;
|
|
62
|
+
const mesh = buildStairsMesh(context.scene, uniqueName, {
|
|
63
|
+
style: args.style,
|
|
64
|
+
steps: args.steps,
|
|
65
|
+
width: args.width,
|
|
66
|
+
stepRise: args.stepRise,
|
|
67
|
+
stepRun: args.stepRun,
|
|
68
|
+
height: args.height,
|
|
69
|
+
length: args.length,
|
|
70
|
+
nosing: args.nosing,
|
|
71
|
+
stringers: args.stringers,
|
|
72
|
+
railing: args.railing,
|
|
73
|
+
railingHeight: args.railingHeight,
|
|
74
|
+
innerRadius: args.innerRadius,
|
|
75
|
+
totalAngleDegrees: args.totalAngleDegrees,
|
|
76
|
+
});
|
|
77
|
+
mesh.material = context.getOrCreateMaterial(args.materialName, args.color || '#b8afa3', args.roughness ?? 0.65, args.metallic ?? 0.05, uniqueName);
|
|
78
|
+
context.applyTransformArgs(mesh, args);
|
|
79
|
+
context.registerCreatedMesh(mesh);
|
|
80
|
+
if (args.texturePrompt && context.service.aiTextureGenerator) {
|
|
81
|
+
context.service.aiTextureGenerator
|
|
82
|
+
.generateTexture({
|
|
83
|
+
prompt: args.texturePrompt,
|
|
84
|
+
applyToMesh: mesh.name,
|
|
85
|
+
uvScale: typeof args.uvScale === 'number' ? args.uvScale : 2.0,
|
|
86
|
+
useAI: true,
|
|
87
|
+
fallbackToProcedural: true,
|
|
88
|
+
})
|
|
89
|
+
.catch((err) => {
|
|
90
|
+
console.warn(`Texture generation for ${mesh.name} failed:`, err);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const bb = mesh.getBoundingInfo().boundingBox;
|
|
94
|
+
return JSON.stringify({
|
|
95
|
+
status: 'ok',
|
|
96
|
+
meshName: mesh.name,
|
|
97
|
+
style: args.style || 'straight',
|
|
98
|
+
vertices: mesh.getTotalVertices(),
|
|
99
|
+
triangles: Math.floor(mesh.getTotalIndices() / 3),
|
|
100
|
+
bounds: {
|
|
101
|
+
min: {
|
|
102
|
+
x: Number(bb.minimumWorld.x.toFixed(3)),
|
|
103
|
+
y: Number(bb.minimumWorld.y.toFixed(3)),
|
|
104
|
+
z: Number(bb.minimumWorld.z.toFixed(3)),
|
|
105
|
+
},
|
|
106
|
+
max: {
|
|
107
|
+
x: Number(bb.maximumWorld.x.toFixed(3)),
|
|
108
|
+
y: Number(bb.maximumWorld.y.toFixed(3)),
|
|
109
|
+
z: Number(bb.maximumWorld.z.toFixed(3)),
|
|
110
|
+
},
|
|
111
|
+
size: {
|
|
112
|
+
x: Number((bb.maximumWorld.x - bb.minimumWorld.x).toFixed(3)),
|
|
113
|
+
y: Number((bb.maximumWorld.y - bb.minimumWorld.y).toFixed(3)),
|
|
114
|
+
z: Number((bb.maximumWorld.z - bb.minimumWorld.z).toFixed(3)),
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AbstractTool } from '../AbstractTool';
|
|
2
|
+
import { ToolExecutionContext } from '../ToolExecutionContext';
|
|
3
|
+
export declare class CreateTextMeshTool extends AbstractTool {
|
|
4
|
+
readonly name = "modeler_create_text_mesh";
|
|
5
|
+
readonly description = "Creates or updates an extruded 3D text mesh with customizable font (\"kenney_future\", \"droid_sans_bold\", \"droid_sans_regular\"), size, extrusion depth, curve resolution, transform, and PBR material.";
|
|
6
|
+
readonly parameters: {
|
|
7
|
+
type: string;
|
|
8
|
+
properties: {
|
|
9
|
+
text: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
name: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
targetMesh: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
font: {
|
|
22
|
+
type: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
depth: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
resolution: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
color: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
emissiveColor: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
emissiveIntensity: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
roughness: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
metallic: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
materialName: {
|
|
59
|
+
type: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
position: {
|
|
63
|
+
type: string;
|
|
64
|
+
items: {
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
rotation: {
|
|
70
|
+
type: string;
|
|
71
|
+
items: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
rotationDegrees: {
|
|
77
|
+
type: string;
|
|
78
|
+
items: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
scale: {
|
|
84
|
+
type: string;
|
|
85
|
+
items: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
description: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
required: string[];
|
|
92
|
+
};
|
|
93
|
+
execute(args: any, context: ToolExecutionContext): Promise<string>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { AbstractTool } from '../AbstractTool';
|
|
2
|
+
export class CreateTextMeshTool extends AbstractTool {
|
|
3
|
+
name = 'modeler_create_text_mesh';
|
|
4
|
+
description = 'Creates or updates an extruded 3D text mesh with customizable font ("kenney_future", "droid_sans_bold", "droid_sans_regular"), size, extrusion depth, curve resolution, transform, and PBR material.';
|
|
5
|
+
parameters = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
text: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'The text string to extrude in 3D (e.g. "LEVEL 1", "SHOP", "DANGER").',
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Optional unique name for the created 3D text mesh.',
|
|
15
|
+
},
|
|
16
|
+
targetMesh: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'Optional name of an existing 3D text mesh to update in-place instead of creating a new mesh.',
|
|
19
|
+
},
|
|
20
|
+
font: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
enum: ['kenney_future', 'droid_sans_bold', 'droid_sans_regular'],
|
|
23
|
+
description: 'Font family to use for 3D extrusion (default: "kenney_future").',
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'Character height in world units (default: 1.0).',
|
|
28
|
+
},
|
|
29
|
+
depth: {
|
|
30
|
+
type: 'number',
|
|
31
|
+
description: '3D extrusion thickness/depth in world units (default: 0.25).',
|
|
32
|
+
},
|
|
33
|
+
resolution: {
|
|
34
|
+
type: 'number',
|
|
35
|
+
description: 'Curve subdivision resolution from 1 to 24 (default: 8).',
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'Hex base color of the 3D text (default: "#3b82f6").',
|
|
40
|
+
},
|
|
41
|
+
emissiveColor: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'Optional hex emissive glow color (e.g. "#00ffcc").',
|
|
44
|
+
},
|
|
45
|
+
emissiveIntensity: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'Emissive glow intensity from 0.0 to 5.0 (default: 0).',
|
|
48
|
+
},
|
|
49
|
+
roughness: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
description: 'PBR roughness from 0.0 to 1.0 (default: 0.35).',
|
|
52
|
+
},
|
|
53
|
+
metallic: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
description: 'PBR metallic from 0.0 to 1.0 (default: 0.2).',
|
|
56
|
+
},
|
|
57
|
+
materialName: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'Optional name of a material from modeler_create_material / modeler_generate_texture to assign.',
|
|
60
|
+
},
|
|
61
|
+
position: {
|
|
62
|
+
type: 'array',
|
|
63
|
+
items: { type: 'number' },
|
|
64
|
+
description: '[x, y, z] world position (default: [0, 0, 0]).',
|
|
65
|
+
},
|
|
66
|
+
rotation: {
|
|
67
|
+
type: 'array',
|
|
68
|
+
items: { type: 'number' },
|
|
69
|
+
description: '[rx, ry, rz] Euler rotation in radians.',
|
|
70
|
+
},
|
|
71
|
+
rotationDegrees: {
|
|
72
|
+
type: 'array',
|
|
73
|
+
items: { type: 'number' },
|
|
74
|
+
description: '[rx, ry, rz] Euler rotation in degrees.',
|
|
75
|
+
},
|
|
76
|
+
scale: {
|
|
77
|
+
type: 'array',
|
|
78
|
+
items: { type: 'number' },
|
|
79
|
+
description: '[sx, sy, sz] scaling factors (default: [1, 1, 1]).',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
required: ['text'],
|
|
83
|
+
};
|
|
84
|
+
async execute(args, context) {
|
|
85
|
+
const controller = context.service.textMeshController;
|
|
86
|
+
const text = String(args.text ?? '3D Text').trim() || '3D Text';
|
|
87
|
+
let existingMesh = args.targetMesh ? context.findMeshByNameOrId(String(args.targetMesh)) : undefined;
|
|
88
|
+
let mesh;
|
|
89
|
+
const commonOpts = {
|
|
90
|
+
name: args.name,
|
|
91
|
+
text,
|
|
92
|
+
fontUrl: args.font,
|
|
93
|
+
size: typeof args.size === 'number' ? args.size : undefined,
|
|
94
|
+
depth: typeof args.depth === 'number' ? args.depth : undefined,
|
|
95
|
+
resolution: typeof args.resolution === 'number' ? args.resolution : undefined,
|
|
96
|
+
color: args.color ? this.normalizeHex(String(args.color)) : undefined,
|
|
97
|
+
emissiveColor: args.emissiveColor ? this.normalizeHex(String(args.emissiveColor)) : undefined,
|
|
98
|
+
emissiveIntensity: typeof args.emissiveIntensity === 'number'
|
|
99
|
+
? args.emissiveIntensity
|
|
100
|
+
: args.emissiveColor
|
|
101
|
+
? 1.0
|
|
102
|
+
: undefined,
|
|
103
|
+
roughness: typeof args.roughness === 'number' ? args.roughness : undefined,
|
|
104
|
+
metallic: typeof args.metallic === 'number' ? args.metallic : undefined,
|
|
105
|
+
selectAfterCreate: true,
|
|
106
|
+
};
|
|
107
|
+
if (existingMesh) {
|
|
108
|
+
mesh = await controller.updateTextMesh(existingMesh, commonOpts);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
mesh = await controller.createTextMesh(commonOpts);
|
|
112
|
+
}
|
|
113
|
+
if (args.position || args.rotation || args.rotationDegrees || args.scale) {
|
|
114
|
+
context.applyTransformArgs(mesh, args);
|
|
115
|
+
}
|
|
116
|
+
if (args.materialName) {
|
|
117
|
+
const mat = context.materialRegistry.get(String(args.materialName));
|
|
118
|
+
if (mat) {
|
|
119
|
+
mesh.material = mat;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
context.registerCreatedMesh(mesh);
|
|
123
|
+
return JSON.stringify({
|
|
124
|
+
status: 'ok',
|
|
125
|
+
meshName: mesh.name,
|
|
126
|
+
text,
|
|
127
|
+
vertices: mesh.getTotalVertices(),
|
|
128
|
+
faces: Math.floor(mesh.getTotalIndices() / 3),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AbstractTool } from '../AbstractTool';
|
|
2
|
+
import { ToolExecutionContext } from '../ToolExecutionContext';
|
|
3
|
+
export declare class CreateTubeTool extends AbstractTool {
|
|
4
|
+
readonly name = "modeler_create_tube";
|
|
5
|
+
readonly description = "Creates a cylindrical tube, pipe, cable, horn, or curved rail along a 3D path of points.";
|
|
6
|
+
readonly parameters: {
|
|
7
|
+
type: string;
|
|
8
|
+
properties: {
|
|
9
|
+
name: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
path: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
items: {
|
|
16
|
+
type: string;
|
|
17
|
+
properties: {
|
|
18
|
+
x: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
y: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
z: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
required: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
radius: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
tessellation: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
cap: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
position: {
|
|
44
|
+
type: string;
|
|
45
|
+
properties: {
|
|
46
|
+
x: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
y: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
z: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
rotationDegrees: {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
x: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
y: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
z: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
color: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
roughness: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
metallic: {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
materialName: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
required: string[];
|
|
85
|
+
};
|
|
86
|
+
execute(args: any, context: ToolExecutionContext): string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Mesh, MeshBuilder } from '@babylonjs/core';
|
|
2
|
+
import { AbstractTool } from '../AbstractTool';
|
|
3
|
+
export class CreateTubeTool extends AbstractTool {
|
|
4
|
+
name = 'modeler_create_tube';
|
|
5
|
+
description = 'Creates a cylindrical tube, pipe, cable, horn, or curved rail along a 3D path of points.';
|
|
6
|
+
parameters = {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
name: { type: 'string' },
|
|
10
|
+
path: {
|
|
11
|
+
type: 'array',
|
|
12
|
+
description: 'Array of 3D points { x, y, z } defining the tube centerline.',
|
|
13
|
+
items: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
16
|
+
required: ['x', 'y', 'z'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
radius: { type: 'number', description: 'Tube radius (default 0.2).' },
|
|
20
|
+
tessellation: { type: 'number', description: 'Radial segments (default 24).' },
|
|
21
|
+
cap: { type: 'number', description: '0: No cap, 1: Start, 2: End, 3: Both (default 3).' },
|
|
22
|
+
position: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
25
|
+
},
|
|
26
|
+
rotationDegrees: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: { x: { type: 'number' }, y: { type: 'number' }, z: { type: 'number' } },
|
|
29
|
+
},
|
|
30
|
+
color: { type: 'string' },
|
|
31
|
+
roughness: { type: 'number' },
|
|
32
|
+
metallic: { type: 'number' },
|
|
33
|
+
materialName: { type: 'string' },
|
|
34
|
+
},
|
|
35
|
+
required: ['path'],
|
|
36
|
+
};
|
|
37
|
+
execute(args, context) {
|
|
38
|
+
const baseName = (args.name || 'tube_mesh').replace(/\s+/g, '_');
|
|
39
|
+
const uniqueName = context.findMeshByNameOrId(baseName)
|
|
40
|
+
? `${baseName}_${Date.now().toString().slice(-4)}`
|
|
41
|
+
: baseName;
|
|
42
|
+
const path = (args.path || []).map((p) => this.parseVec3(p, 0));
|
|
43
|
+
const mesh = MeshBuilder.CreateTube(uniqueName, {
|
|
44
|
+
path,
|
|
45
|
+
radius: args.radius !== undefined ? Number(args.radius) : 0.2,
|
|
46
|
+
tessellation: args.tessellation !== undefined ? Number(args.tessellation) : 24,
|
|
47
|
+
cap: args.cap !== undefined ? Number(args.cap) : Mesh.CAP_ALL,
|
|
48
|
+
sideOrientation: Mesh.DOUBLESIDE,
|
|
49
|
+
}, context.scene);
|
|
50
|
+
mesh.material = context.getOrCreateMaterial(args.materialName, args.color, args.roughness, args.metallic, uniqueName);
|
|
51
|
+
context.applyTransformArgs(mesh, args);
|
|
52
|
+
context.registerCreatedMesh(mesh);
|
|
53
|
+
return JSON.stringify({
|
|
54
|
+
status: 'ok',
|
|
55
|
+
meshName: mesh.name,
|
|
56
|
+
vertices: mesh.getTotalVertices(),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|