# PathSegment

Artifact: [androidx.graphics:graphics-path](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/path/PathSegment.kt+class:androidx.graphics.path.PathSegment) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

*** ** * ** ***


```
class PathSegment
```

<br />

*** ** * ** ***

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

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

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

## Summary

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

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

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

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### points

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
val points: Array<PointF>
```

An array of points describing this segment, whose size depends on `https://developer.android.com/reference/kotlin/androidx/graphics/path/PathSegment#type()`.

### type

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

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

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

### weight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
val weight: Float
```

Conic weight, only valid if `https://developer.android.com/reference/kotlin/androidx/graphics/path/PathSegment#type()` is `https://developer.android.com/reference/kotlin/androidx/graphics/path/PathSegment.Type#Conic`.