Nodes/ComfyUI_DAO_master/DXF Transform (Rotate, Scale, Move)
ComfyUI Node

DXF Transform (Rotate, Scale, Move)

Move, scale and rotate a whole DXF drawing at once

By orion4d·Created about a year ago·Updated 12 months ago· 11
DXF Transform (Rotate, Scale, Move)
  • dxf
  • DXF
translate_x0
translate_y0
scale1.00
rotation_degrees0
rotation_center

DXF Transform is the geometry-wide edit node of the DXF lane: it moves, scales, and rotates everything in a drawing in one shot. If you've built a multi-part drawing with the Add nodes and now realize it needs to be 20% smaller, rotated 45°, and nudged 30 units to the right, this is the node you reach for. No per-entity fiddling - one transform chain applied to the whole modelspace.

How it works

The node makes a clean copy of the document's modelspace (via ezdxf's Importer), so your upstream DXF object is untouched - non-destructive, like the rest of the pack's DXF nodes. Then it builds a single 4×4 transform matrix: translate to the rotation center, scale, rotate around Z, translate back, then apply the final translation. The composed matrix is applied to every entity that supports transformation, and entities that can't be transformed (some exotic types) are skipped with a warning in the console rather than crashing the run.

The one decision that changes behavior is rotation_center. Pick object_center and rotation pivots around the drawing's bounding-box center - the intuitive "spin it in place" behavior. Pick origin and it rotates around (0,0), which swings the whole drawing in a big arc and usually moves it off its old position. Scale and translation are unaffected by this choice.

Inputs that matter

  • dxf - the drawing to transform.
  • translate_x, translate_y - the move amount in document units.
  • scale - multiplier, default 1. Min is 0.001, so you can shrink aggressively. 2 doubles the size.
  • rotation_degrees - from -360 to 360.
  • rotation_center - object_center (default) or origin, as above.

Outputs

A single DXF output with the transformed geometry. Wire it into DXF Preview to eyeball the result or DXF Save to export it.

A neat detail: if all the transform values are at their neutral defaults (no move, scale 1, no rotation), the node short-circuits and returns the copy untouched - so you can leave this node in a workflow permanently without worrying about it mangling anything when it isn't configured.

How to install

Part of the orion4d/ComfyUI_DAO_master pack:

cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI_DAO_master.git
pip install ezdxf

Restart ComfyUI. No models.

Common issues

The biggest trap is rotation_center = origin: rotating around (0,0) usually flings the drawing far away from where you expect it - if your shapes vanish after a rotation, that's why. Check it with a DXF Preview before saving. Scaling is uniform (one scale value), so there's no non-uniform stretch here; if you need that, you'd handle it at export time instead. And note the transform only affects geometry, not any text or dimension styles that might be attached - for the primitive shapes this pack generates, that's never an issue.

CategoryDAO_master/DXF/Modify

Inputs (6)

NameTypeDefaultDescription
dxfDXF
translate_xFLOAT0
translate_yFLOAT0
scaleFLOAT1.00
rotation_degreesFLOAT0-360–360
rotation_centerCOMBO2 options: object_center, origin

Outputs (1)

NameTypeDescription
DXFDXF