# Volume mesh slices

*Volume mesh slices allow you to extract planar slice outputs from the generated volume mesh. These slices can be used to inspect the mesh quality and structure at specific locations.*

## Available Options

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| [**Name**](#name) | Name of the mesh slice output | always |
| [**Assigned slices**](#assigned-slices) | Slice entities to extract from the mesh | always |
| [**Include crinkled slices**](#include-crinkled-slices) | Whether to generate crinkled slices | always |
| [**Cutoff radius**](#cutoff-radius) | Limit the radial extent of slices | always |

```{seealso}
- For a deeper discussion of the meshing workflow and parameters, see {doc}`/user_guide/Meshing/Meshing`.
- To inspect the generated volume mesh, see the {doc}`/gui_guide/05.tools/04.volume-mesh-diagnostics` tool.
```


## Detailed Descriptions

### Name

*Display name for this mesh slice output configuration.*

- **Default:** `Volume mesh slice`

### Assigned slices

*The slice entities that define where to extract mesh data.*

- **Required**
>**Notes:**
>  - Select slices from the 3D scene or from the entity list using the `+` button
>  - Each slice is defined by an origin point and a normal direction
>  - Multiple slices can be assigned to a single output configuration

### Include crinkled slices

*Toggle to generate crinkled (stair-stepped) slices.*

- **Default:** `Off`
>**Notes:**
>  - Flat slices interpolate values to the exact slice plane
>  - Crinkled slices follow cell boundaries, showing the actual mesh structure
>  - Crinkled slices are useful for inspecting mesh topology and cell distribution

### Cutoff radius

*Optional radial limit for the slice output, measured from the slice origin.*

- **Default:** None (slice extends to mesh boundaries)
- **Units:** Dimensionless (in mesh units)
>**Notes:**
>  - When not specified, the slice extends to the boundaries of the volume mesh
>  - Useful for focusing on a specific region of interest
>  - Reduces output file size for large meshes

---

<details>
<summary><h3 style="display:inline-block"> ❓ Frequently Asked Questions</h3></summary>

- **What is the difference between flat and crinkled slices?**
  > Flat slices interpolate mesh data to the exact plane location, giving smooth visualizations. Crinkled slices show the actual cell faces that intersect the plane, revealing the true mesh structure with stair-step edges.

- **Can I output multiple slices with different settings?**
  > Yes, you can create multiple mesh slice output configurations, each with different slice locations, crinkled settings, and cutoff radii.

</details>

---

<details>
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>

```{seealso}
Python API:
- {py:class}`~flow360.Slice`
- {py:class}`~flow360.MeshSliceOutput`
```

```python
import flow360 as fl

# Define slice entities
slice_y0 = fl.Slice(
    name="Y0_plane",
    normal=(0, 1, 0),
    origin=(0, 0, 0) * fl.u.m
)

slice_wake = fl.Slice(
    name="Wake_slice",
    normal=(1, 0, 0),
    origin=(2, 0, 0) * fl.u.m
)

# Create mesh slice output
mesh_slices = fl.MeshSliceOutput(
    name="Mesh inspection slices",
    slices=[slice_y0, slice_wake],
    include_crinkled_slices=True,
    cutoff_radius=5.0
)
```

</details>
