# Axisymmetric volume

*An axisymmetric volume (body of revolution) is a three-dimensional volume entity defined by rotating a 2D profile curve around a central axis. This allows creation of complex axisymmetric shapes like cone frustums, nacelles, or spinners that cannot be represented by simple cylinders.*

## Available Options

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| [**Name**](#name) | Identifier for the axisymmetric volume | always |
| [**Center**](#center) | Three-dimensional coordinates of the center point | always |
| [**Axis**](#axis) | Direction vector defining the axis of revolution | always |
| [**Profile Curve**](#profile-curve) | Table of (Axial position, Radial position) points | always |


## Detailed Descriptions

### Name

*Identifier for the axisymmetric volume entity.*

- **Required**
>**Note:** Names are not required to be unique, but using descriptive unique names is recommended.

### Center

*Three-dimensional coordinates (X, Y, Z) defining the reference point for the axisymmetric body.*
*The coordinates defined in the curve are relative to this point and the body axis passes through it.*

- **Required**
- **Units:** Length
>**Note:** The profile curve's axial positions are measured relative to this center point along the axis direction.

### Axis

*Direction vector defining the axis of revolution.*

- **Required**
- **Units:** Dimensionless (direction vector)
>**Notes:**
>  - The vector is normalized internally
>  - The profile curve is revolved 360° around this axis
>  - Axial positions in the profile curve are measured along this direction
>  - The axis passes through the center point

### Profile Curve

*A table of (Axial position, Radial position) coordinate pairs that define the 2D profile to be revolved.*

- **Required**
- **Units:** Length (for both axial and radial values)
>**Notes:**
>  - The first point must have radial position = 0 (starts on the axis)
>  - The last point must have radial position = 0 (ends on the axis)
>  - Intermediate points must have radial position ≥ 0
>  - Axial positions are defined in reference to the center point
>  - Points are connected in order to form the profile polyline
>  - Add points using the `+` button; reorder using drag handles
>  - Avoid sharp angles in the profile curve as they may affect the volume mesher robustness

---

<details>
<summary><h3 style="display:inline-block"> 💡 Tips</h3></summary>

- Use axisymmetric volumes for nacelles, spinners, or cone frustum shapes
- The profile curve must start and end on the axis (radial = 0) to create a closed volume
- Add more points to the profile curve for smoother curved shapes
- The preview graph shows your profile curve for visual verification
- For simple cylindrical shapes, consider using the Cylinder primitive instead

</details>

---

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

- **Why must the first and last points have radial position = 0?**
  > The volume must be closed at both ends. Points on the axis (radial = 0) ensure the revolved shape forms a complete solid without holes at the ends.

- **How do I create a cone frustum?**
  > Define four points: (0, 0), (0, r1), (h, r2), (h, 0) where r1 and r2 are the two radii and h is the height.

- **Can I create a sphere using axisymmetric volume?**
  > Yes, by defining a semicircular profile curve from (−r, 0) through (0, r) to (r, 0).

- **What's the difference between this and a Cylinder?**
  > Cylinders have constant radius along their height. Axisymmetric volumes can have varying radius defined by the profile curve, enabling complex shapes.

</details>

---

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

```python
import flow360 as fl

# Cone frustum (truncated cone)
cone_frustum = fl.AxisymmetricBody(
    name="nacelle_zone",
    center=(0, 0, 0) * fl.u.m,
    axis=(1, 0, 0),
    profile_curve=[
        (0, 0) * fl.u.m,      # Start on axis
        (0, 0.5) * fl.u.m,    # Front radius
        (2, 0.8) * fl.u.m,    # Rear radius (larger)
        (2, 0) * fl.u.m       # End on axis
    ]
)

# Spinner shape (pointed front, cylindrical rear)
spinner = fl.AxisymmetricBody(
    name="spinner_zone",
    center=(0, 0, 0) * fl.u.inch,
    axis=(0, 0, 1),
    profile_curve=[
        (-1, 0) * fl.u.inch,   # Pointed tip
        (-0.5, 0.3) * fl.u.inch,
        (0, 0.5) * fl.u.inch,
        (1, 0.5) * fl.u.inch,  # Cylindrical section
        (1, 0) * fl.u.inch     # End on axis
    ]
)
```

</details>

