> ## Documentation Index
> Fetch the complete documentation index at: https://docs.numberelectric.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 2D and 3D geometry

> Draw closed paths and wireframes using NumElectScript coordinates.

Start with `numelectscript 2` and put `geometry 2d` or `geometry 3d` inside the phase block. Add comma-separated coordinates with `vertex`. The lab connects consecutive vertices in the order you enter them.

## Close a 2D triangle

```text Triangle theme={null}
numelectscript 2
phase 1 {
  geometry 2d
  vertex -2, 0
  vertex 0, 2
  vertex 2, 0
  vertex -2, 0
}
```

Each vertex has an X and Y coordinate. Repeat the first vertex at the end to close the path.

## Add a separate path in 3D

```text Wireframe theme={null}
numelectscript 2
phase 1 {
  geometry 3d
  vertex 0, 0, 0
  vertex 2, 0, 0
  vertex 0, 2, 0
  vertex 0, 0, 0
  vertex 0, 0, 2
  vertex 2, 0, 0
  break
  vertex 0, 2, 0
  vertex 0, 0, 2
}
```

Each vertex now has X, Y, and Z coordinates. `break` prevents a segment between the previous vertex and the start of the new path. Use **Azimuth** and **Elevation** to rotate the wireframe.

After applying either example, select **View graphs**, then **Geometry only** under **Plot display** to hide the phase plots. A script supports up to 256 vertices.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.