Skip to main content
Glama

topology_to_solid

Reconstruct a FreeCAD solid from a topology-optimization density field by thresholding and merging 2D/3D grid cells into extruded boxes.

Instructions

Reconstruct a FreeCAD solid from a topology-optimization density field — the modeller-side close of the loop opened by topology_optimize_submit, whose density this consumes. 2-D (nely×nelx grid): thresholds (a cell is solid when density ≥ threshold), run-length-merges each row into solid spans, tiles each span as a cell_mm box extruded thickness_mm in Z (row 0 at the top). 3-D (a nelz×nely×nelx voxel field from the nelz mode): greedy-merges solid voxels into maximal boxes at (i·cx, j·cy, k·cz) — j=0 at the bottom, thickness_mm ignored. Fuses into one static Part::Feature. cell_mm is a scalar or [cx, cy(, cz)] mm; thickness_mm defaults to the smaller cell edge; placement is an optional [x, y, z] mm origin offset; name names the object. Runs synchronously (it builds geometry — no jobs.py poll).

Returns {handle, name, volume (mm³), solid_cells, total_cells, mass_fraction (== solid_cells/total_cells — must be ≤ keep_fraction within one cell), n_solids (disjoint bodies; >1 means a split load path), threshold, nelx, nely, nelz (None for 2-D), bbox_mm}. Gate it with mass_properties (mass ≤ keep_fraction·original) and interference_check against keep-out regions, per SIMULATION_EXAMPLES §5.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
cell_mmNo
densityYes
placementNo
thresholdNo
thickness_mmNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations the description carries the full burden, and it delivers: it explains 2-D vs 3-D branches, threshold semantics, run-length vs greedy voxel merging, extrusion convention (row 0 at top, j=0 at bottom), that thickness_mm is ignored for 3-D, and that execution is synchronous ('it builds geometry — no jobs.py poll'). This is unusually rich behavioral disclosure for a mutation-style tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded into the first clause, then branches (2-D, 3-D), parameters, returns, and gating follow logically. It is dense and long, but given six undocumented parameters and dual operating modes the length is largely earned; a small amount of the phrasing could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema and 0% schema coverage, the description enumerates the full return shape (handle, name, volume, solid_cells, total_cells, mass_fraction, n_solids, threshold, nelx/nely/nelz, bbox_mm) and the validation gates. Nothing an agent needs to call it correctly appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and it does: it defines `cell_mm` as scalar or [cx, cy(, cz)] mm, `thickness_mm` default (smaller cell edge), `placement` as an [x,y,z] mm origin offset, `name` as the object name, `threshold` as the density cutoff, and `density` as the consumed field. Every one of the 6 parameters gains meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Reconstruct a FreeCAD solid from a topology-optimization density field' — and explicitly ties itself to the sibling that produces its input (`topology_optimize_submit`). An agent can distinguish it from reconstruction/CAD siblings without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Identifies when to use it (the modeller-side close of the loop opened by topology_optimize_submit), the required follow-up gates (mass_properties, interference_check) and the reference section (SIMULATION_EXAMPLES §5). It gives clear context but does not name an alternative tool or an explicit when-not condition, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools