# PathKt

Added in 1.1.0

*** ** * ** ***


```
public final class PathKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).and(android.graphics.Path)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html p)` Returns the intersection of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/graphics/PathSegment>` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).flatten(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, float error)` Flattens (or approximate) the `https://developer.android.com/reference/android/graphics/Path.html` with a series of line segments. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).minus(android.graphics.Path)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html p)` Returns the difference of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).or(android.graphics.Path)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html p)` Returns the union of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).plus(android.graphics.Path)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html p)` Returns the union of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/androidx/core/graphics/PathKt#(android.graphics.Path).xor(android.graphics.Path)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Path.html p)` Returns the union minus the intersection of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. |

## Public methods

### and

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:and) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Path and(@NonNull Path receiver, @NonNull Path p)
```

Returns the intersection of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`. If the paths do not intersect, returns an empty path.

### flatten

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:flatten) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@RequiresApi(value = 26)
public static final @NonNull Iterable<@NonNull PathSegment> flatten(@NonNull Path receiver, float error)
```

Flattens (or approximate) the `https://developer.android.com/reference/android/graphics/Path.html` with a series of line segments.

| Parameters |
|---|---|
| `float error` | The acceptable error for a line on the Path in pixels. Typically this would be 0.5 so that the error is less than half a pixel. This value must be positive and is set to 0.5 by default. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/graphics/Path.html#approximate(float)` |   |

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Path minus(@NonNull Path receiver, @NonNull Path p)
```

Returns the difference of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`.

### or

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:or) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Path or(@NonNull Path receiver, @NonNull Path p)
```

Returns the union of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Path plus(@NonNull Path receiver, @NonNull Path p)
```

Returns the union of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`.

### xor

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Path.kt+function:xor) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Path xor(@NonNull Path receiver, @NonNull Path p)
```

Returns the union minus the intersection of two paths as a new `https://developer.android.com/reference/android/graphics/Path.html`.