io.github.daedalus/mcp-stl
MCP server for editing STL 3D model files
Versions
0.1.0latestTools 48
read_stl_file Reads an STL file and returns mesh data including vertices, normals, and bounding box. Args: path: Path to the STL file. Returns: Dictionary containing: vertex_count, face_count, normals (as nested lists), vertices (as nested lists), bounding_box, and format (ascii|binary). Raises: FileNotFoundError: If the specified file does not exist. ValueError: If the file is not a valid STL file. Example: >>> read_stl_file("/path/to/model.stl") {"vertex_count": 36, "face_count": 12, ...}
get_mesh_info Returns summary information about an STL file without loading full geometry. Args: path: Path to the STL file. Returns: Dictionary containing: face_count, bounding_box, center, and format. Raises: FileNotFoundError: If the specified file does not exist. ValueError: If the file is not a valid STL file. Example: >>> get_mesh_info("/path/to/model.stl") {"face_count": 12, "bounding_box": {...}, "center": {...}, "format": "binary"}
translate_stl Translates (moves) the mesh by the specified offset. Args: path: Input STL file path. output_path: Output STL file path. x: Translation along X axis. y: Translation along Y axis. z: Translation along Z axis. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If the input file is not a valid STL. Example: >>> translate_stl("input.stl", "output.stl", 10.0, 0.0, 5.0) "output.stl"
rotate_stl Rotates the mesh around a specified axis. Args: path: Input STL file path. output_path: Output STL file path. axis: Rotation axis ('x', 'y', or 'z'). angle: Rotation angle in degrees. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If axis is invalid or input file is not a valid STL. Example: >>> rotate_stl("input.stl", "output.stl", "y", 90.0) "output.stl"
scale_stl Scales the mesh by the specified factors. Args: path: Input STL file path. output_path: Output STL file path. x: Scale factor for X axis. y: Scale factor for Y axis. z: Scale factor for Z axis. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If the input file is not a valid STL. Example: >>> scale_stl("input.stl", "output.stl", 2.0, 2.0, 2.0) "output.stl"
write_stl Writes mesh data to an STL file. Args: vertices: List of vertices as [x, y, z] triplets. normals: List of face normals as [x, y, z] triplets. output_path: Output STL file path. format: Output format ('ascii' or 'binary'). Defaults to 'binary'. Returns: Path to the output file. Example: >>> write_stl([[0,0,0], [1,0,0], [0,1,0]], [[0,0,1]], "output.stl") "output.stl"
create_cube Creates a cube mesh. Args: output_path: Output STL file path. size: Edge length (default 1.0). center: Center position as [x, y, z] (default [0, 0, 0]). Returns: Path to the output file. Example: >>> create_cube("cube.stl", size=2.0) "cube.stl"
create_sphere Creates a sphere mesh. Args: output_path: Output STL file path. radius: Sphere radius (default 1.0). segments: Number of horizontal segments (default 32). Returns: Path to the output file. Example: >>> create_sphere("sphere.stl", radius=0.5, segments=16) "sphere.stl"
create_cylinder Creates a cylinder mesh. Args: output_path: Output STL file path. radius: Cylinder radius (default 1.0). height: Cylinder height (default 2.0). segments: Number of radial segments (default 32). Returns: Path to the output file. Example: >>> create_cylinder("cylinder.stl", radius=0.5, height=3.0) "cylinder.stl"
create_cone Creates a cone mesh. Args: output_path: Output STL file path. radius: Base radius (default 1.0). height: Cone height (default 2.0). segments: Number of radial segments (default 32). Returns: Path to the output file. Example: >>> create_cone("cone.stl", radius=0.5, height=2.0) "cone.stl"
create_torus Creates a torus (donut) mesh. Args: output_path: Output STL file path. major_radius: Distance from center to tube center (default 1.0). minor_radius: Tube radius (default 0.3). major_segments: Number of segments around the ring (default 32). minor_segments: Number of segments around the tube (default 16). Returns: Path to the output file. Example: >>> create_torus("torus.stl", major_radius=2.0, minor_radius=0.5) "torus.stl"
create_plane Creates a plane mesh (2D flat surface). Args: output_path: Output STL file path. width: Plane width (default 1.0). height: Plane height (default 1.0). Returns: Path to the output file. Example: >>> create_plane("plane.stl", width=5.0, height=3.0) "plane.stl"
create_box Creates a rectangular box (cuboid) mesh with independent dimensions. Args: output_path: Output STL file path. width: Box width along X axis (default 1.0). height: Box height along Y axis (default 1.0). depth: Box depth along Z axis (default 1.0). center: Center position as [x, y, z] (default [0, 0, 0]). Returns: Path to the output file. Example: >>> create_box("box.stl", width=2.0, height=0.5, depth=1.5) "box.stl"
create_capsule Creates a capsule mesh (cylinder with hemispherical end caps). Useful for robot arm link bodies with smooth rounded ends. Args: output_path: Output STL file path. radius: Radius of the cylinder and hemispheres (default 0.5). height: Height of the cylindrical section only (default 2.0). segments: Number of radial/latitude segments (default 32). Returns: Path to the output file. Example: >>> create_capsule("link.stl", radius=0.3, height=1.5) "link.stl"
create_ellipsoid Creates an ellipsoid mesh with independent radii on each axis. Useful for joint housings and actuator enclosures in robot arm designs. Args: output_path: Output STL file path. rx: Radius along X axis (default 1.0). ry: Radius along Y axis (default 0.5). rz: Radius along Z axis (default 0.75). segments: Number of latitude/longitude segments (default 32). Returns: Path to the output file. Example: >>> create_ellipsoid("joint.stl", rx=0.8, ry=0.4, rz=0.6) "joint.stl"
create_frustum Creates a frustum (truncated cone) mesh. Useful for tapered robot arm segments transitioning between joint diameters. Args: output_path: Output STL file path. bottom_radius: Radius of the bottom circle (default 1.0). top_radius: Radius of the top circle (default 0.5). height: Frustum height (default 2.0). segments: Number of radial segments (default 32). Returns: Path to the output file. Example: >>> create_frustum("taper.stl", bottom_radius=0.8, top_radius=0.4, height=1.5) "taper.stl"
create_tube Creates a hollow cylinder (tube) mesh. Useful for hollow structural link bodies in robot arm designs. Args: output_path: Output STL file path. outer_radius: Outer radius (default 1.0). inner_radius: Inner (bore) radius, must be less than outer_radius (default 0.7). height: Tube height (default 2.0). segments: Number of radial segments (default 32). Returns: Path to the output file. Raises: ValueError: If inner_radius >= outer_radius. Example: >>> create_tube("link.stl", outer_radius=0.5, inner_radius=0.35, height=3.0) "link.stl"
mirror_stl Mirrors (reflects) the mesh across the plane perpendicular to the given axis. Useful for creating symmetric robot arm structures from a single side. Args: path: Input STL file path. output_path: Output STL file path. axis: Mirror axis ('x', 'y', or 'z'). The mesh is reflected across the plane perpendicular to this axis passing through the origin. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If axis is invalid or input file is not a valid STL. Example: >>> mirror_stl("input.stl", "mirrored.stl", "x") "mirrored.stl"
rotate_stl_axis Rotates the mesh around an arbitrary axis vector using Rodrigues' rotation. Essential for 6-DOF robot arm kinematic simulations where joints rotate around non-cardinal axes. Args: path: Input STL file path. output_path: Output STL file path. ax: X component of the rotation axis vector. ay: Y component of the rotation axis vector. az: Z component of the rotation axis vector. angle: Rotation angle in degrees. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If the axis vector is the zero vector or the file is invalid. Example: >>> rotate_stl_axis("input.stl", "output.stl", 1.0, 1.0, 0.0, 45.0) "output.stl"
combine_stl Merges multiple STL files into a single STL file. Used to assemble individual robot arm components (base, links, joints, end-effector) into a complete robot arm model. Args: paths: List of input STL file paths to merge. output_path: Output STL file path. Returns: Path to the output file. Raises: FileNotFoundError: If any input file does not exist. ValueError: If paths is empty or any file is not a valid STL. Example: >>> combine_stl(["base.stl", "link1.stl", "link2.stl"], "robot.stl") "robot.stl"
create_gear Creates a spur gear mesh (used for timing gears, cam drives, etc.). Args: output_path: Output STL file path. module: Gear module — pitch diameter / tooth count (default 1.0). teeth: Number of teeth (default 20, minimum 4). thickness: Face width along Y axis (default 1.0). pressure_angle_deg: Pressure angle in degrees (default 20.0). segments_per_tooth: Polygon segments per tooth (default 4). Returns: Path to the output file. Raises: ValueError: If teeth < 4. Example: >>> create_gear("gear.stl", module=2.0, teeth=16, thickness=1.5) "gear.stl"
create_spring Creates a helical coil spring mesh (used for valve springs, etc.). The spring axis is along Y, centred at the origin. Args: output_path: Output STL file path. coil_radius: Radius of the coil helix centre line (default 1.0). wire_radius: Radius of the wire cross-section (default 0.1). turns: Number of coil turns (default 5.0). height: Total spring height along Y axis (default 5.0). segments: Path segments per full turn (default 32). wire_segments: Polygon sides on wire cross-section (default 8). Returns: Path to the output file. Example: >>> create_spring("spring.stl", coil_radius=0.8, wire_radius=0.08, turns=6) "spring.stl"
create_connecting_rod Creates a simplified connecting rod mesh. The rod is aligned along Y. Big end (crankshaft side) at y = -length/2, small end (piston-pin side) at y = +length/2. Args: output_path: Output STL file path. length: Centre-to-centre distance between end bores (default 6.0). big_end_outer_radius: Outer radius of the big end (default 1.0). big_end_inner_radius: Inner bore radius of the big end (default 0.6). small_end_outer_radius: Outer radius of the small end (default 0.6). small_end_inner_radius: Inner bore radius of the small end (default 0.35). beam_width: Width of connecting beam along X (default 0.4). beam_height: Depth of connecting beam along Z (default 0.8). segments: Radial segments for end bores (default 32). Returns: Path to the output file. Raises: ValueError: If inner radius >= outer radius for either end. Example: >>> create_connecting_rod("rod.stl", length=8.0) "rod.stl"
create_crankshaft Creates a simplified crankshaft mesh. Main axis along Y. Main journals on the Y axis; crank pins offset radially by stroke/2, evenly distributed around the Y axis. Args: output_path: Output STL file path. throws: Number of crank throws / cylinders (default 4). main_journal_radius: Radius of the main bearing journals (default 0.5). rod_journal_radius: Radius of crank pins / rod journals (default 0.4). journal_width: Axial width of each journal (default 0.4). crank_arm_thickness: Axial thickness of crank arm discs (default 0.25). stroke: Piston stroke; pin offset = stroke/2 (default 2.0). segments: Radial segments (default 32). Returns: Path to the output file. Raises: ValueError: If throws < 1. Example: >>> create_crankshaft("crank.stl", throws=4, stroke=3.0) "crank.stl"
create_valve Creates a poppet valve mesh (intake or exhaust valve). Stem tip at y = +stem_length/2; head face at y = -(stem_length/2 + head_height). Args: output_path: Output STL file path. stem_radius: Radius of the valve stem (default 0.15). stem_length: Length of the cylindrical stem (default 3.0). head_radius: Outer radius of the valve head disc (default 0.6). head_height: Axial thickness of the valve head (default 0.15). segments: Radial segments (default 32). Returns: Path to the output file. Raises: ValueError: If stem_radius >= head_radius. Example: >>> create_valve("valve.stl", stem_radius=0.1, head_radius=0.5) "valve.stl"
create_camshaft_lobe Creates a cam lobe mesh for camshaft design. The lobe is a disc with an eccentric nose on the +X side; axis along Y. Args: output_path: Output STL file path. base_radius: Base-circle radius (default 0.8). lift: Maximum lift — nose height above base circle (default 0.4). lobe_width: Axial width along Y (default 0.8). segments: Circumferential polygon segments (default 64). Returns: Path to the output file. Example: >>> create_camshaft_lobe("lobe.stl", base_radius=1.0, lift=0.5) "lobe.stl"
array_linear Creates a linear array of mesh copies. Produces `count` total copies spaced by (dx, dy, dz) per step. Useful for placing multiple cylinders in an engine bank. Args: path: Input STL file path. output_path: Output STL file path. count: Total copies including the original (minimum 1). dx: X offset per step. dy: Y offset per step. dz: Z offset per step. Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If count < 1. Example: >>> array_linear("cylinder.stl", "cylinders.stl", 4, 3.0, 0.0, 0.0) "cylinders.stl"
array_circular Creates a circular array of mesh copies around a coordinate axis. Produces `count` copies at equal angular intervals (360/count degrees) around the world-origin axis. Useful for valve arrangements and bolt patterns. Args: path: Input STL file path. output_path: Output STL file path. count: Total copies (minimum 1). axis: Rotation axis — 'x', 'y', or 'z' (default 'y'). Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If count < 1 or axis is invalid. Example: >>> array_circular("bolt_hole.stl", "bolt_pattern.stl", 6, axis="y") "bolt_pattern.stl"
create_pyramid Creates a regular pyramid mesh. The pyramid has a regular n-sided polygon base at y=-height/2 and a single apex at y=+height/2. Args: output_path: Output STL file path. base_radius: Circumscribed radius of the base polygon (default 1.0). height: Distance from base to apex (default 2.0). segments: Number of base polygon sides (default 4 → square base). Returns: Path to the output file. Example: >>> create_pyramid("pyramid.stl", base_radius=1.0, height=2.0) "pyramid.stl"
create_prism Creates a regular n-sided prism mesh. The prism has a regular n-gon cross-section with the given circumscribed radius, extruded along Y from -height/2 to +height/2. Args: output_path: Output STL file path. radius: Circumscribed radius of the cross-section (default 1.0). height: Prism height along Y (default 2.0). segments: Number of polygon sides (default 6 → hexagonal prism). Returns: Path to the output file. Example: >>> create_prism("hexprism.stl", radius=1.0, height=2.0, segments=6) "hexprism.stl"
create_hemisphere Creates a hemisphere mesh (upper half of a sphere with a flat base). The dome covers y ≥ 0. A flat disc at y=0 closes the solid. Args: output_path: Output STL file path. radius: Hemisphere radius (default 1.0). segments: Number of latitude/longitude subdivisions (default 32). Returns: Path to the output file. Example: >>> create_hemisphere("dome.stl", radius=1.5) "dome.stl"
create_wedge Creates a right-triangular wedge (triangular prism) mesh. The right-angle corner sits at the origin; width extends along X, height along Y, and the prism is extruded symmetrically along ±Z by depth/2. Args: output_path: Output STL file path. width: Extent along X (default 1.0). height: Extent along Y (default 1.0). depth: Extent along Z (default 1.0). Returns: Path to the output file. Example: >>> create_wedge("wedge.stl", width=2.0, height=1.0, depth=3.0) "wedge.stl"
shear_stl Applies a shear transformation to the mesh. Each parameter shifts one axis by a given factor per unit along another axis (e.g. xy shifts X by xy units for every unit along Y). Args: path: Input STL file path. output_path: Output STL file path. xy: X shear along Y (default 0.0). xz: X shear along Z (default 0.0). yx: Y shear along X (default 0.0). yz: Y shear along Z (default 0.0). zx: Z shear along X (default 0.0). zy: Z shear along Y (default 0.0). Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. Example: >>> shear_stl("cube.stl", "sheared.stl", xy=0.5) "sheared.stl"
twist_stl Applies a twist (torsion) transformation to the mesh. Each vertex is rotated about *axis* by an amount proportional to its position along that axis. The twist is zero at the minimum extent of the mesh and reaches *angle* degrees at the maximum extent. Useful for adding geometric pitch to propeller blades, turbine blades, and swept wing sections created with create_airfoil. Args: path: Input STL file path. output_path: Output STL file path. angle: Total twist in degrees over the full extent along *axis*. axis: Twist axis ('x', 'y', or 'z'; default 'y'). Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If axis is invalid. Example: >>> twist_stl("wing.stl", "twisted_wing.stl", 5.0, axis="z") "twisted_wing.stl"
create_airfoil Creates a symmetric NACA airfoil wing-section mesh. The chord runs along X (leading edge at x=0, trailing edge at x=chord), thickness is along Y, and the span extrudes along Z from z=0 to z=span. A thickness_ratio of 0.12 gives a NACA 0012 profile. Suitable for wings, horizontal stabilisers, and vertical fins of airplanes or helicopters. Args: output_path: Output STL file path. chord: Chord length along X (default 1.0). span: Wing-section span along Z (default 5.0). thickness_ratio: Max thickness as fraction of chord (default 0.12). segments: Points per airfoil surface half (default 32). Returns: Path to the output file. Example: >>> create_airfoil("wing.stl", chord=1.5, span=6.0) "wing.stl"
create_rack Creates a linear gear rack mesh. A straight bar with evenly spaced teeth along the top edge, aligned along the X axis. Meshes with a spur gear to convert rotary motion into linear motion (rack-and-pinion). Args: output_path: Output STL file path. length: Total rack length along X (default 5.0). height: Body height along Y (default 0.5). thickness: Body depth along Z (default 0.3). module: Gear module; tooth pitch = π × module (default 0.5). pressure_angle_deg: Tooth flank pressure angle in degrees (default 20.0). Returns: Path to the output file. Raises: ValueError: If length, height, thickness, or module <= 0. Example: >>> create_rack("rack.stl", length=6.0, module=0.4) "rack.stl"
create_propeller_blade Creates a propeller or helicopter rotor blade mesh. The blade spans along Y (root at y=0, tip at y=length). The cross-section is a NACA symmetric airfoil in the X-Z plane, scaled by the local chord and progressively rotated about Y by twist_angle from root to tip. Use array_circular to arrange multiple blades into a full propeller or rotor disc. Args: output_path: Output STL file path. length: Blade span along Y (default 5.0). chord_root: Chord length at the root (default 0.5). chord_tip: Chord length at the tip (default 0.15). twist_angle: Total twist from root to tip in degrees (default 30.0). thickness_ratio: NACA airfoil thickness ratio (default 0.12). segments: Points per airfoil surface half per slice (default 16). span_segments: Number of span-wise divisions (default 20). Returns: Path to the output file. Example: >>> create_propeller_blade("blade.stl", length=4.0, twist_angle=25.0) "blade.stl"
create_turbine_blade Creates a gas-turbine compressor or fan blade mesh. Geometry is identical to a propeller blade (NACA airfoil profile, tapered chord, and progressive twist) but with defaults suited to turbomachinery: shorter span, more aggressive twist, and thinner profile. Use array_circular to arrange blades into a full compressor or fan stage. Args: output_path: Output STL file path. span: Blade span along Y (default 1.5). chord_root: Chord at the root (default 0.4). chord_tip: Chord at the tip (default 0.25). twist_angle: Total twist from root to tip in degrees (default 45.0). thickness_ratio: NACA airfoil thickness ratio (default 0.10). segments: Points per airfoil surface half per slice (default 16). span_segments: Number of span-wise divisions (default 16). Returns: Path to the output file. Example: >>> create_turbine_blade("tblade.stl", span=1.2, twist_angle=50.0) "tblade.stl"
create_piston Creates a hollow piston mesh. The piston axis is aligned along Y. The crown (solid top) is at y = +height/2 with axial thickness crown_height. The cylindrical skirt extends from y = -height/2 to the crown base; the interior is open at the bottom. Combine with create_connecting_rod and create_crankshaft to model a piston engine. Args: output_path: Output STL file path. bore: Outer piston diameter (default 1.0). height: Total piston height along Y (default 1.2). wall_thickness: Cylindrical wall thickness (default 0.1). crown_height: Axial thickness of the solid crown (default 0.3). segments: Number of radial segments (default 32). Returns: Path to the output file. Raises: ValueError: If wall_thickness >= bore/2 or crown_height >= height. Example: >>> create_piston("piston.stl", bore=0.8, height=1.0) "piston.stl"
create_turbine_disk Creates a turbine disk (rotor wheel blank) mesh. The disk has a stepped cross-section typical of gas-turbine rotors: a hub region (bore to hub_radius) at full disk_thickness, and a web region (hub_radius to disk_radius) at the reduced web_thickness. The axis is aligned along Y. Attach turbine blades using create_turbine_blade followed by array_circular. Args: output_path: Output STL file path. disk_radius: Outer rim radius (default 2.0). bore_radius: Inner bore radius (default 0.5). disk_thickness: Full axial thickness of the hub (default 0.4). web_thickness: Reduced axial thickness of the web (default 0.15). hub_radius: Radial boundary between hub and web (default 0.9). segments: Number of radial segments (default 64). Returns: Path to the output file. Raises: ValueError: If bore_radius >= hub_radius, hub_radius >= disk_radius, or web_thickness >= disk_thickness. Example: >>> create_turbine_disk("disk.stl", disk_radius=2.0, bore_radius=0.4) "disk.stl"
create_bell_nozzle Creates a bell nozzle (convergent-divergent de Laval nozzle) mesh. The nozzle axis is aligned along Y. y=0 is the combustion-chamber inlet; y = chamber_length + convergent_length + bell_length is the nozzle exit plane. Profile sections: - Combustion chamber: cylindrical bore at chamber_radius. - Convergent section: cosine-blend taper from chamber_radius down to throat_radius. - Divergent bell: quarter-sine flare from throat_radius out to exit_radius, giving the characteristic bell contour. The mesh is a hollow thin-walled structure (outer surface, inner bore, and two annular end caps). Use combine_stl to assemble two nozzles with a shared combustion chamber for an RD-180 type engine. Args: output_path: Output STL file path. throat_radius: Nozzle throat (minimum) radius (default 0.15). exit_radius: Nozzle exit plane radius (default 0.75). chamber_radius: Combustion chamber bore radius (default 0.35). chamber_length: Length of cylindrical chamber section (default 0.3). convergent_length: Length of the converging section (default 0.2). bell_length: Length of the diverging bell section (default 1.0). wall_thickness: Nozzle wall thickness (default 0.04). segments: Number of circumferential segments (default 32). profile_points: Axial profile points per section (default 16). Returns: Path to the output file. Raises: ValueError: If throat_radius >= chamber_radius, throat_radius >= exit_radius, or wall_thickness >= throat_radius. Example: >>> create_bell_nozzle("nozzle.stl", throat_radius=0.15, exit_radius=0.75) "nozzle.stl"
create_injector_plate Creates a propellant injector plate mesh. The plate is a solid flat disc with a circular array of small cylindrical injector-element stubs protruding from the top face (+Y). The plate axis is aligned along Y with the bottom face at y=0 and the top face at y=thickness. Suitable for the combustion-chamber injector head of liquid rocket engines such as the RD-180. Use combine_stl to pair with a bell nozzle and combustion chamber body. Args: output_path: Output STL file path. radius: Outer radius of the plate (default 0.35). thickness: Plate thickness along Y (default 0.05). num_elements: Number of injector-element stubs around the ring (default 18). element_radius: Radius of each cylindrical injector stub (default 0.015). pattern_radius: Radial distance from plate centre to stub centreline (default 0.22). segments: Circumferential segments for plate and stubs (default 32). Returns: Path to the output file. Raises: ValueError: If pattern_radius + element_radius >= radius. Example: >>> create_injector_plate("injector.stl", num_elements=24) "injector.stl"
create_pump_housing Creates a centrifugal pump housing (volute casing) mesh. The housing is a hollow cylindrical casing (thick annular disc) with the pump axis along Y. A cylindrical outlet pipe extends radially from the outer casing wall in the +X direction, representing the volute discharge port. Use with create_turbine_disk and create_turbine_blade (via array_circular) to build a complete turbopump stage for an RD-180 type engine. Args: output_path: Output STL file path. bore_radius: Inner bore radius for the impeller cavity (default 0.25). housing_radius: Outer casing radius (default 0.6). housing_height: Axial height of the casing along Y (default 0.35). outlet_radius: Radius of the discharge outlet pipe (default 0.12). outlet_length: Length of the outlet pipe along X (default 0.25). segments: Number of circumferential segments (default 32). Returns: Path to the output file. Raises: ValueError: If bore_radius >= housing_radius or outlet_radius >= housing_radius. Example: >>> create_pump_housing("pump.stl", bore_radius=0.2, housing_radius=0.5) "pump.stl"
create_arch Creates an architectural arch mesh. The arch sweeps from 0° to arch_angle (default 180° = semicircular arch) in the XY plane. A 180° arch has its feet at (±outer_radius, 0) and its crown at (0, outer_radius). Essential for bridges, aqueducts, vaults, and doorways — one of humanity's most transformative structural inventions. Args: output_path: Output STL file path. inner_radius: Inner (soffit) radius (default 1.0). outer_radius: Outer (extrados) radius (default 1.3). depth: Extrusion depth along Z (default 0.5). segments: Number of arc subdivisions (default 32). arch_angle: Total arc sweep in degrees (default 180.0). Returns: Path to the output file. Raises: ValueError: If inner_radius >= outer_radius or arch_angle out of range (0, 360]. Example: >>> create_arch("arch.stl", inner_radius=0.8, outer_radius=1.0) "arch.stl"
create_bolt Creates a hex bolt mesh with a threaded shaft. The bolt axis is along Y. The hex head occupies y=0…y=head_height; the threaded shaft extends above that. Bolts are among the most fundamental mechanical fasteners and were critical to the Industrial Revolution and modern construction. Args: output_path: Output STL file path. shaft_radius: Nominal shaft radius (default 0.2). head_radius: Circumscribed radius of the hex head (default 0.4). shaft_length: Length of the threaded shaft (default 2.0). head_height: Height of the hex head (default 0.35). thread_pitch: Axial distance between thread crests (default 0.2). thread_depth: Radial height of thread crests (default 0.04). segments: Sides of the hex head (default 6). thread_segments: Circumferential segments per thread ring (default 32). Returns: Path to the output file. Raises: ValueError: If shaft_radius <= 0, head_radius <= shaft_radius, shaft_length <= 0, or thread_pitch <= 0. Example: >>> create_bolt("bolt.stl", shaft_radius=0.15, shaft_length=1.5) "bolt.stl"
create_nut Creates a hex nut mesh. A regular hexagonal prism with a cylindrical bore along Y. Pairs with create_bolt. The threaded nut and bolt are among the simplest yet most important fasteners ever devised. Args: output_path: Output STL file path. inner_radius: Bore radius (default 0.2). outer_radius: Circumscribed radius of the hex body (default 0.4). height: Nut height along Y (default 0.35). segments: Sides of the outer polygon (default 6 → hex nut). chamfer: Chamfer size on bore edges (default 0.03; 0 disables). Returns: Path to the output file. Raises: ValueError: If inner_radius >= outer_radius or height <= 0. Example: >>> create_nut("nut.stl", inner_radius=0.18, outer_radius=0.38) "nut.stl"
create_i_beam Creates an I-beam (H-beam) structural steel section mesh. The I-beam cross-section has two horizontal flanges connected by a vertical web, extruded along the Y axis. I-beams are the primary structural elements of modern buildings, bridges, and industrial frames — indispensable for civilisation-scale construction. Args: output_path: Output STL file path. width: Total flange width along X (default 0.5). height: Total section height along Z (default 1.0). length: Beam length along Y (default 5.0). flange_thickness: Thickness of each flange plate (default 0.06). web_thickness: Thickness of the web plate (default 0.04). Returns: Path to the output file. Raises: ValueError: If height <= 2*flange_thickness, width <= web_thickness, or length <= 0. Example: >>> create_i_beam("beam.stl", width=0.4, height=0.8, length=4.0) "beam.stl"
bend_stl Bends a mesh along a circular arc. Transforms the straight extent of the mesh along *axis* into a circular arc of *bend_radius*. Essential for manufacturing curved pipes, arch ribs, bent beams, and swept structures. Args: path: Input STL file path. output_path: Output STL file path. angle: Total bending angle in degrees. bend_radius: Radius of the neutral bending axis (default 1.0). axis: Axis along which the mesh is swept ('x', 'y', or 'z'; default 'z'). Returns: Path to the output file. Raises: FileNotFoundError: If the input file does not exist. ValueError: If axis is invalid or bend_radius <= 0. Example: >>> bend_stl("pipe.stl", "curved_pipe.stl", angle=90.0, ... bend_radius=2.0, axis="x") "curved_pipe.stl"
Permissions 1
filesystem low