import { commonSchemas } from '../../catalog/tool-definition-utils.js'; import type { ToolDefinition } from '../shared/tool-definition.js'; export const manageGeometryToolDefinition: ToolDefinition = { name: 'manage_geometry', category: 'world', description: 'Create procedural meshes using Geometry Script: booleans, deformers, UVs, collision, and LOD generation.', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: [ 'create_box', 'create_sphere', 'create_cylinder', 'create_cone', 'create_capsule', 'create_torus', 'create_plane', 'create_disc', 'create_stairs', 'create_spiral_stairs', 'create_ring', 'create_arch', 'create_pipe', 'create_ramp', 'boolean_union', 'boolean_subtract', 'boolean_intersection', 'boolean_trim', 'self_union', 'extrude', 'inset', 'outset', 'bevel', 'offset_faces', 'shell', 'revolve', 'chamfer', 'extrude_along_spline', 'bridge', 'loft', 'sweep', 'duplicate_along_spline', 'loop_cut', 'edge_split', 'quadrangulate', 'bend', 'twist', 'taper', 'noise_deform', 'smooth', 'relax', 'stretch', 'spherify', 'cylindrify', 'lattice_deform', 'displace_by_texture', 'triangulate', 'poke', 'mirror', 'array_linear', 'array_radial', 'simplify_mesh', 'subdivide', 'remesh_uniform', 'merge_vertices', 'remesh_voxel', 'weld_vertices', 'fill_holes', 'remove_degenerates', 'auto_uv', 'project_uv', 'transform_uvs', 'unwrap_uv', 'pack_uv_islands', 'recalculate_normals', 'flip_normals', 'recompute_tangents', 'generate_collision', 'generate_complex_collision', 'simplify_collision', 'generate_lods', 'set_lod_settings', 'set_lod_screen_sizes', 'convert_to_nanite', 'convert_to_static_mesh', 'get_mesh_info' ], description: 'Geometry action to perform' }, outputPath: commonSchemas.outputPath, assetPath: commonSchemas.assetPath, name: commonSchemas.name, path: commonSchemas.directoryPath, actorName: commonSchemas.actorName, width: commonSchemas.width, height: commonSchemas.height, depth: commonSchemas.depth, radius: commonSchemas.radius, innerRadius: { type: 'number', description: 'Inner radius for torus.' }, numSides: { type: 'number', description: 'Number of sides for cylinder, cone, etc.' }, numRings: { type: 'number', description: 'Number of rings for sphere, torus.' }, numSteps: { type: 'number', description: 'Number of steps for stairs.' }, stepWidth: { type: 'number', description: 'Width of each stair step.' }, stepHeight: { type: 'number', description: 'Height of each stair step.' }, stepDepth: { type: 'number', description: 'Depth of each stair step.' }, numTurns: { type: 'number', description: 'Number of turns for spiral.' }, widthSegments: { type: 'number', description: 'Segments along width.' }, heightSegments: { type: 'number', description: 'Segments along height.' }, depthSegments: { type: 'number', description: 'Segments along depth.' }, radialSegments: { type: 'number', description: 'Radial segments for circular shapes.' }, location: commonSchemas.location, rotation: commonSchemas.rotation, scale: commonSchemas.scale, distance: commonSchemas.distance, amount: { type: 'number', description: 'Generic amount for operations (bevel size, inset distance, etc.).' }, segments: { type: 'number', description: 'Number of segments for bevel, subdivide.' }, angle: commonSchemas.angle, axis: { type: 'string', enum: ['X', 'Y', 'Z'], description: 'Axis for deformation operations.' }, strength: commonSchemas.strength, weight: { type: 'number', description: 'Weight for lattice deformation.' }, latticeResolution: { type: 'number', description: 'Control lattice resolution for lattice deformation.' }, heightScale: { type: 'number', description: 'Texture displacement height scale.' }, midpoint: { type: 'number', description: 'Texture luminance midpoint for displacement.' }, texturePath: commonSchemas.texturePath, position: commonSchemas.location, center: commonSchemas.location, offset: commonSchemas.location, dimensions: commonSchemas.dimensions, targetActor: commonSchemas.actorName, toolActor: commonSchemas.actorName, trimActorName: commonSchemas.actorName, splineActorName: commonSchemas.actorName, keepTool: commonSchemas.booleanProp, keepInside: commonSchemas.booleanProp, cap: commonSchemas.booleanProp, count: commonSchemas.numberProp, steps: commonSchemas.numberProp, iterations: { type: 'number', description: 'Number of iterations for smooth, remesh.' }, targetTriangleCount: { type: 'number', description: 'Target triangle count for simplification.' }, targetEdgeLength: { type: 'number', description: 'Target edge length for remeshing.' }, weldDistance: { type: 'number', description: 'Distance threshold for vertex welding.' }, uvChannel: { type: 'number', description: 'UV channel index (0-7).' }, uvScale: { type: 'object', properties: { u: commonSchemas.numberProp, v: commonSchemas.numberProp }, description: 'UV scale.' }, uvOffset: { type: 'object', properties: { u: commonSchemas.numberProp, v: commonSchemas.numberProp }, description: 'UV offset.' }, hardEdgeAngle: { type: 'number', description: 'Angle threshold for hard edges (degrees).' }, computeWeightedNormals: { type: 'boolean', description: 'Use area-weighted normals.' }, collisionType: { type: 'string', enum: ['Default', 'Simple', 'Complex', 'UseComplexAsSimple', 'UseSimpleAsComplex'], description: 'Collision complexity type.' }, hullCount: { type: 'number', description: 'Number of convex hulls for decomposition.' }, maxHullCount: { type: 'number', description: 'Maximum hull count for complex collision generation.' }, maxHullVerts: { type: 'number', description: 'Maximum vertices per hull for complex collision generation.' }, targetHullCount: { type: 'number', description: 'Target hull count for collision simplification.' }, simplificationFactor: { type: 'number', description: 'Collision simplification factor.' }, hullPrecision: { type: 'number', description: 'Precision for convex hull generation (0-1).' }, maxVerticesPerHull: { type: 'number', description: 'Maximum vertices per convex hull.' }, lodCount: { type: 'number', description: 'Number of LOD levels to generate.' }, lodIndex: { type: 'number', description: 'Specific LOD index to configure.' }, reductionPercent: { type: 'number', description: 'Percent of triangles to reduce per LOD.' }, trianglePercent: { type: 'number', description: 'Percent of triangles to keep for LOD reduction.' }, recomputeNormals: commonSchemas.booleanProp, recomputeTangents: commonSchemas.booleanProp, screenSizes: { type: 'array', items: commonSchemas.numberProp, description: 'Array of screen sizes for each LOD.' } }, required: ['action'] }, outputSchema: { type: 'object', properties: { ...commonSchemas.outputBase, meshPath: commonSchemas.meshPath, actorName: commonSchemas.actorName, meshInfo: { type: 'object', properties: { vertexCount: commonSchemas.numberProp, triangleCount: commonSchemas.numberProp, uvChannels: commonSchemas.numberProp, hasNormals: commonSchemas.booleanProp, hasTangents: commonSchemas.booleanProp, boundingBox: commonSchemas.objectProp, lodCount: commonSchemas.numberProp } }, error: commonSchemas.stringProp } } };