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

# Draw a wall

> Add one wall to a storey with a command.

export const LiveExample = ({path, title = 'Live example', height = 460}) => {
  return <Frame>
      <iframe src={`https://floorkit-examples.ploterr.com/floorkit/${path}?embed=1`} ref={frame => {
    if (!frame || !['localhost', '127.0.0.1'].includes(window.location.hostname)) return;
    const local = `http://localhost:5555/${path}?embed=1`;
    if (frame.src !== local) frame.src = local;
  }} title={title} loading="lazy" allow="fullscreen" style={{
    width: '100%',
    height: `${height}px`,
    border: 0,
    display: 'block'
  }} />
    </Frame>;
};

A wall is a line of points with a thickness. Floorkit makes the solid, and it joins the wall to the walls that it touches.

<LiveExample path="guides/draw-a-wall" />

## Before you start

You have a session from [Start a building](/floorkit/guides/start-a-building).

## Add a straight wall

This garden wall goes from `[0, 7]` to `[6, 7]`. It is 6 metres long and 0.2 metres thick.

```typescript theme={null}
import type { BuildingSession } from '@opengeometry/floorkit';

export function drawWall(session: BuildingSession): void {
  session.apply(
    {
      kind: 'create-wall',
      buildingId: 'building',
      storeyId: 'ground',
      wall: {
        id: 'garden-wall',
        points: [
          [0, 7],
          [6, 7],
        ],
        thickness: 0.2,
      },
    },
    session.revision,
  );
}
```

## Add a closed room

A wall can have more than two points. Set `closed: true` and Floorkit adds the last segment back to the first point. This room is 6 by 4 metres. The other guides add a door, a window, a floor and a roof to it.

```typescript theme={null}
export function drawRoom(session: BuildingSession): void {
  session.apply(
    {
      kind: 'create-wall',
      buildingId: 'building',
      storeyId: 'ground',
      wall: {
        id: 'room-walls',
        points: [
          [0, 0],
          [6, 0],
          [6, 4],
          [0, 4],
        ],
        closed: true,
        thickness: 0.2,
      },
    },
    session.revision,
  );
}
```

## Rules

* Points are `[x, z]` in metres, seen from above.
* Do not repeat the first point to close a wall. Use `closed: true`.
* The wall height is the storey height. Set `height` to change it.
* The points are on the centre line of the wall. Set `locationLine` to put them on a face.
* The `id` must be unique in the model.
* Walls on the same storey join where they meet: at corners, at T-junctions and at crossings.

## Remove a wall

```typescript theme={null}
export function removeWall(session: BuildingSession): void {
  session.apply(
    { kind: 'delete-wall', buildingId: 'building', storeyId: 'ground', wallId: 'garden-wall' },
    session.revision,
  );
}
```

## Next

<CardGroup cols={2}>
  <Card title="Add a door" icon="door-open" href="/floorkit/guides/add-a-door">
    Cut a door into the room.
  </Card>

  <Card title="Move and reshape" icon="arrows-up-down-left-right" href="/floorkit/guides/move-and-reshape">
    Move a wall point after you draw the wall.
  </Card>
</CardGroup>


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