> For the complete documentation index, see [llms.txt](https://2yeet.gitbook.io/anvilcsg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://2yeet.gitbook.io/anvilcsg/geometry/csg.md).

# CSG tools

Anvil keeps map geometry as convex brushes. CSG tools cut or replace brushes while preserving that rule.

Use the preview before applying a destructive edit. Anvil records these operations in Unity Undo.

## Clip

Shortcut: `Shift+X`

Clip cuts selected brushes with a two-point line drawn in an orthographic pane.

### Workflow

1. Select a brush or group.
2. Choose Clip.
3. Drag a two-point cut line in the Top, Front, or Side pane.
4. Choose which side to keep.
5. Press `Enter` or click Apply.

Clip modes:

* **Keep Both** keeps both pieces.
* **Keep Arrow Side** keeps the side indicated by the arrow.
* **Keep Other Side** keeps the opposite side.

Controls:

* `R` cycles the keep mode.
* `F` flips the sides.
* `Enter` applies the cut.
* `Escape` cancels.

Green preview geometry is kept. Red preview geometry is removed.

With **Keep Both**, one result stays on the original brush and the other becomes a sibling. Groups are supported. If the line does not intersect the brush, it remains available so it can be adjusted.

> Clip does not currently support generated stairs.

## Carve

Shortcut: `Ctrl/Cmd+Shift+C`

Carve subtracts one selected cutter from one or more target brushes.

### Workflow

1. Place the cutter so it overlaps the target geometry.
2. Select the cutter first, then add one or more target brushes.
3. Run Carve.
4. Check the confirmation view. The cutter is labeled red and each target is labeled blue in every pane.
5. Confirm the operation, then check the resulting pieces.

When Carve is started from a context menu, the brush or group under the pointer is used as the cutter. The other selected brushes become targets.

The cutter is consumed after a successful carve. Group cutters are supported.

Carve keeps all results convex. If one target becomes several pieces, Anvil groups those pieces. If it remains one piece, the result replaces the original target. A cutter can also remove a target completely.

Very small grazing contact is ignored. Unsupported or unsafe geometry is rejected instead of producing a broken brush.

### Carving with an Arch

Enable **Connect for Carve** in Arch Options. This adds internal NoDraw fill so Anvil can treat the complete generated arch as one connected cutter where possible.

Use the arch to cut the wall, then keep or remove the generated arch depending on whether it is also part of the final trim.

## Hollow

Shortcut: `Ctrl/Cmd+H`

Hollow replaces each selected Box with a grouped shell made from six wall brushes.

### Workflow

1. Select one or more ordinary Boxes.
2. Run Hollow.
3. Enter the wall thickness.
4. Confirm the operation.

Wall thickness must be less than half of every box dimension.

Hollow works only on ordinary axis-aligned six-face Boxes. It rejects:

* Rotated boxes
* Face-edited boxes
* Wedges
* Cylinders
* Generated shapes

The six walls are placed in a normal user group. They can be ungrouped and edited separately.

## Box Bevel

Box Bevel rounds the corners of an ordinary Box with flat bevel faces. It is separate from Edge Bevel.

Available controls:

* Amount
* Maximum safe amount
* Live result face count
* Apply to selected boxes
* Reset
* Cancel
* Apply

A nonzero bevel creates a 26-face convex brush.

Use Edge Bevel when only chosen edges need beveling. Use Box Bevel when the complete Box needs the same corner treatment.

## Remove Hidden Faces from Build

This command finds contact faces that are fully buried between valid rebuilt brushes and assigns NoDraw to those authoring faces.

It requires at least two solved brushes and expands grouped selections before checking them.

> This is a permanent surface edit to the authoring brushes. It is not only a temporary build option. Use Unity Undo if the result is not wanted.

## Choosing a tool

| Goal                                        | Tool                           |
| ------------------------------------------- | ------------------------------ |
| Cut a brush with a straight plane           | Clip                           |
| Subtract a doorway, window, or other volume | Carve                          |
| Turn a simple Box into a room shell         | Hollow                         |
| Bevel every corner of a Box                 | Box Bevel                      |
| Bevel only selected edges                   | Edge Bevel                     |
| Remove fully buried build surfaces          | Remove Hidden Faces from Build |

Keep complex map forms as several simple convex brushes. This makes later editing more predictable and avoids invalid CSG results.
