# PathSegment

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/PathSegment.kt+class:androidx.compose.ui.graphics.PathSegment) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0) Common/AllAndroid/JVM
- Cmn

  ```
  class PathSegment
  ```

*** ** * ** ***

A path segment represents a curve (line, cubic, quadratic or conic) or a command inside a fully formed `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path` object.

A segment is identified by a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type` which in turns defines how many `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#points()` are available (from 0 to 4 points, each point is represented by 2 floats) and whether the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#weight()` is meaningful. Please refer to the documentation of each `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type` for more information.

A segment with the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Move` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Close` is usually represented by the singletons `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#DoneSegment()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#CloseSegment()` respectively.

## Summary

| ### Nested types |
|---|
| `enum https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type>` Type of a given segment in a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path`, either a command (`https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Move`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Close`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Done`) or a curve (`https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Line`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Cubic`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Quadratic`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Conic`). |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#PathSegment(androidx.compose.ui.graphics.PathSegment.Type,kotlin.FloatArray,kotlin.Float)(type: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type, points: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html, weight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#points()` An array of points (2 floats per point) describing this segment, whose size depends on `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#type()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#type()` The type that identifies this segment and defines the number of points. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#weight()` Conic weight, only valid if `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#type()` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Conic`. | Cmn |

## Public constructors

### PathSegment

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
PathSegment(type: PathSegment.Type, points: FloatArray, weight: Float)
```

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### points

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val points: FloatArray
```

An array of points (2 floats per point) describing this segment, whose size depends on `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#type()`. Points are stored as pairs of float values in the order x, y. For example, a line segment with two points (x1, y1) and (x2, y2), the array stores the points as (x1, y1, x2, y2).

### type

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val type: PathSegment.Type
```

The type that identifies this segment and defines the number of points.

### weight

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val weight: Float
```

Conic weight, only valid if `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment#type()` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Conic`. See `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathSegment.Type#Conic` for more information.