millisketch

Bodies

Change a body

update_body

Sets a body's dimensions, position, rotation or colour.

EditorTools tabAgentMCP
Needs
One body picked in 3D, or the one in Edit mode.
In the editor
3D, Object mode, one body picked: its dimensions, Move X, Y, Z and Turn X, Y, Z in the Object tab, retyped, and the colours under them.
Tools tab
A form of its inputs, filled from what is picked; Run makes the change, one step to undo.
Agent and MCP
The chat's agent and MCP clients call update_body, each call one step to undo. Over MCP it also takes project, editor and request_id.

What it does

Only what is given changes: a dimension by its key, the position (where the middle of the body's underside goes), the rotation in degrees about X, then Y, then Z, about that point, or the colour, as "#rrggbb"; a colour of null gives the default back.

An editable or an imported mesh has no dimensions: its position, rotation and colour change alone. The reply names the bodies whose boxes the changed one now cuts into, as box_intersects.

Inputs

As the agent and MCP clients send them. One left out takes the default its description gives.

InputTypeWhat it is
bodyneededstringThe body's id or its name.
dimensionsnumbers by keyThe kind's dimensions by key, as in the table of kinds.
position[x, y, z][x, y, z] in mm: where the middle of the body's underside goes, so z 0 stands it on the ground.
rotation[x, y, z][x, y, z] in degrees, applied in that order about the body's origin.
colorstring or null"#rrggbb"; null gives the default colour back.

Limits

  • Sizes that make no solid are refused with the reason, and nothing changes.
  • One body at a time; a face's colour, a step's distance and a mesh's scale per axis are the editor's alone.

Examples

Make a box a 5 mm tile, in teal

Given: Box 1, a 20 mm box standing on the ground at the origin.

update_body { "body": "Box 1", "dimensions": { "height": 5 }, "color": "#2ec4b6" }

Then: Box 1: Height Z 5 mm, colour #2ec4b6, standing where it was.