# ObstacleLayoutHelper

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-pretext-layout/struct-obstaclelayouthelper/

**struct** · [`ferroui-pretext-layout`](/docs/0.5.0/api/ferroui-pretext-layout/) · v0.5.0

```rust
struct ObstacleLayoutHelper
```

Geometry utilities for carving horizontal text slots from exclusion shapes.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L4)

## Members

- [`carve_text_line_slots`](#function-carve_text_line_slots)
- [`circle_interval_for_band`](#function-circle_interval_for_band)
- [`ellipse_interval_for_band`](#function-ellipse_interval_for_band)
- [`get_rect_intervals_for_band`](#function-get_rect_intervals_for_band)
- [`pick_slot`](#function-pick_slot)

<a id="function-carve_text_line_slots"></a>

### carve_text_line_slots

```rust
fn carve_text_line_slots(base_slot: Interval, blocked: impl IntoIterator<Item = Interval>, min_slot_width: f64) -> Vec<Interval>
```

Carve all blocked intervals, then discard slots narrower than the minimum.
The surviving intervals remain ordered from left to right.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L9)

<a id="function-circle_interval_for_band"></a>

### circle_interval_for_band

```rust
fn circle_interval_for_band(cx: f64, cy: f64, radius: f64, band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Option<Interval>
```

The widest horizontal intersection of a circle with the entire line band.
A tangent band has no occupied area and yields `None`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L60)

<a id="function-ellipse_interval_for_band"></a>

### ellipse_interval_for_band

```rust
fn ellipse_interval_for_band(cx: f64, cy: f64, radius_x: f64, radius_y: f64, band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Option<Interval>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L82)

<a id="function-get_rect_intervals_for_band"></a>

### get_rect_intervals_for_band

```rust
fn get_rect_intervals_for_band(rects: &[RectObstacle], band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Vec<Interval>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L136)

<a id="function-pick_slot"></a>

### pick_slot

```rust
fn pick_slot(slots: &[Interval], prefer_right_on_tie: bool) -> Option<Interval>
```

Pick the widest usable slot and resolve equal widths by horizontal order.
Empty inputs return `None` instead of indexing an absent first interval.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/obstacle_layout_helper.rs#L184)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
