# Machine Sketch (`magnetics.machineSketch`)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/commands/magnetics-machineSketch/)

**Menu:** none (Quick Open, the CLI, Python and MCP) · **Runs as:** at once

> Preview: turn on Preview features in Edit › Preferences › Simulation, or run `preview.set {"enabled":true}`. Its replies carry `preview: true` and a note.

## What it does

Preview. Draws the whole cross-section of the machine magnetics.fieldTorque builds, at the rotor angle. Surface rotor: the rotor iron disc and one arc magnet per pole, "magnet k (N|S)" (north and south in turn, magnetized parallel to its centre line). Interior rotor: the non-magnetic "rotor hub", then in the ring out to rotorRadiusMm one wedge magnet "magnet k (ccw|cw)" on each pole boundary (magnetized across its centre line, anticlockwise and clockwise in turn) and an iron "pole piece k (N|S)" between each two. V-shape rotor: the rotor iron disc holding two bar polygons per pole, "magnet ka (N|S)" (the clockwise bar) and "magnet kb (N|S)", each magnetized across the bar into its pole; the solver's mesh staircases them. A drawing holds no magnetization, so magnets gives each one's direction. Then the air gap, each open slot split into a left and a right half slot that is a coil of its phase (circuits A, B and C, negative turns for a return side) and the stator iron out to outerRadiusMm, the drawing's edge (held at A = 0). Magnet and slot edges sit at their true angles. Changes nothing unless open.

## Parameters

- `slots`
- `poles`
- `rotor`
- `rotorRadiusMm`
- `magnetThicknessMm`
- `magnetArc`
- `magnetDepthMm`
- `ribMm`
- `barrierMm`
- `airGapMm`
- `slotDepthMm`
- `slotWidth`
- `outerRadiusMm`
- `stackLengthMm`
- `ironMuR`
- `magnetMuR`
- `winding`: (each as magnetics.fieldTorque)
- `turns`: int=1 (turns of one coil side, a whole number)
- `angleDeg`: number=0 (rotor angle, mechanical degrees, anticlockwise)
- `magnetGrade`: str|{grade object}? (as a magnet's grade in the magnets param of field.lineProfile; with it each magnets entry carries grade and temperatureC, ready to pass on)
- `temperatureC`: number? (required with magnetGrade)
- `open`: bool=false (also open the drawing on the field drawing canvas, one undo step after the drawing open now)

## Reply

- sketch:{depthMm,points,edges,labels} (the sketch param of magnetics.fieldSolve, field.lineProfile and the other field commands, mm)
- magnets:\[{region,direction:\[x,y\],grade?,temperatureC?}\] (the magnets param)
- coils:\[{region,phase (A+ to C−)}\]
- machine:{slots,poles,rotor:"surface"|"interior"|"vShape",winding}
- regions
- drawing? (with open: the drawing summary as geometry.new gives it)
- notes:\[{en,zh}\]
- preview
- previewNote
