`pub struct PathPoint { /* private fields */ }`

**crate feature**only.

`v4_14`

## Expand description

`PathPoint`

is an opaque type representing a point on a path.

It can be queried for properties of the path at that point, such as its tangent or its curvature.

To obtain a `PathPoint`

, use `Path::closest_point()`

,
`Path::start_point()`

, `Path::end_point()`

or `PathMeasure::point()`

.

Note that `PathPoint`

structs are meant to be stack-allocated,
and don’t hold a reference to the path object they are obtained from.
It is the callers responsibility to keep a reference to the path
as long as the `PathPoint`

is used.

GLib type: Inline allocated boxed type with stack copy semantics.

## Implementations§

source§### impl PathPoint

### impl PathPoint

#### pub fn as_ptr(&self) -> *mut GskPathPoint

source#### pub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const GskPathPoint) -> &'a Self

#### pub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const GskPathPoint) -> &'a Self

Borrows the underlying C value.

source#### pub unsafe fn from_glib_ptr_borrow_mut<'a>(
ptr: *mut GskPathPoint,
) -> &'a mut Self

#### pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut GskPathPoint, ) -> &'a mut Self

Borrows the underlying C value mutably.

source§### impl PathPoint

### impl PathPoint

source#### pub fn distance(&self, measure: &PathMeasure) -> f32

#### pub fn distance(&self, measure: &PathMeasure) -> f32

Returns the distance from the beginning of the path to @self.

###### §`measure`

a `PathMeasure`

for the path

##### §Returns

the distance of @self

source#### pub fn rotation(&self, path: &Path, direction: PathDirection) -> f32

#### pub fn rotation(&self, path: &Path, direction: PathDirection) -> f32

Gets the direction of the tangent at a given point.

This is a convenience variant of `tangent()`

that returns the angle between the tangent and the X axis. The angle
can e.g. be used in
gtk_snapshot_rotate().

###### §`path`

the path that @self is on

###### §`direction`

the direction for which to return the rotation

##### §Returns

the angle between the tangent and the X axis, in degrees

source#### pub fn tangent(&self, path: &Path, direction: PathDirection) -> Vec2

#### pub fn tangent(&self, path: &Path, direction: PathDirection) -> Vec2

Gets the tangent of the path at the point.

Note that certain points on a path may not have a single tangent, such as sharp turns. At such points, there are two tangents – the direction of the path going into the point, and the direction coming out of it. The @direction argument lets you choose which one to get.

If the path is just a single point (e.g. a circle with
radius zero), then @tangent is set to `0, 0`

.

If you want to orient something in the direction of the
path, `rotation()`

may be more
convenient to use.

###### §`path`

the path that @self is on

###### §`direction`

the direction for which to return the tangent

##### §Returns

###### §`tangent`

Return location for the tangent at the point

source§### impl PathPoint

### impl PathPoint

source#### pub fn curvature(
&self,
path: &Path,
direction: PathDirection,
) -> (f32, Option<Point>)

#### pub fn curvature( &self, path: &Path, direction: PathDirection, ) -> (f32, Option<Point>)

Calculates the curvature of the path at the point.

Optionally, returns the center of the osculating circle as well. The curvature is the inverse of the radius of the osculating circle.

Lines have a curvature of zero (indicating an osculating circle of infinite radius. In this case, the @center is not modified.

Circles with a radius of zero have `INFINITY`

as curvature

Note that certain points on a path may not have a single curvature, such as sharp turns. At such points, there are two curvatures – the (limit of) the curvature of the path going into the point, and the (limit of) the curvature of the path coming out of it. The @direction argument lets you choose which one to get.

## `path` the path that @self is on ## `direction` the direction for which to return the curvature##### §Returns

The curvature of the path at the given point

###### §`center`

Return location for the center of the osculating circle

## Trait Implementations§

source§### impl HasParamSpec for PathPoint

### impl HasParamSpec for PathPoint

source§### impl Ord for PathPoint

### impl Ord for PathPoint

source§### impl PartialEq for PathPoint

### impl PartialEq for PathPoint

source§### impl PartialOrd for PathPoint

### impl PartialOrd for PathPoint

1.0.0 · source§#### fn le(&self, other: &Rhs) -> bool

#### fn le(&self, other: &Rhs) -> bool

`self`

and `other`

) and is used by the `<=`

operator. Read moresource§### impl StaticType for PathPoint

### impl StaticType for PathPoint

source§#### fn static_type() -> Type

#### fn static_type() -> Type

`Self`

.### impl Copy for PathPoint

### impl Eq for PathPoint

## Auto Trait Implementations§

### impl Freeze for PathPoint

### impl RefUnwindSafe for PathPoint

### impl !Send for PathPoint

### impl !Sync for PathPoint

### impl Unpin for PathPoint

### impl UnwindSafe for PathPoint

## Blanket Implementations§

source§### impl<T> BorrowMut<T> for Twhere
T: ?Sized,

### impl<T> BorrowMut<T> for Twhere
T: ?Sized,

source§#### fn borrow_mut(&mut self) -> &mut T

#### fn borrow_mut(&mut self) -> &mut T

source§### impl<T> CloneToUninit for Twhere
T: Clone,

### impl<T> CloneToUninit for Twhere
T: Clone,

source§#### default unsafe fn clone_to_uninit(&self, dst: *mut T)

#### default unsafe fn clone_to_uninit(&self, dst: *mut T)

`clone_to_uninit`

)source§### impl<T> CloneToUninit for Twhere
T: Copy,

### impl<T> CloneToUninit for Twhere
T: Copy,

source§#### unsafe fn clone_to_uninit(&self, dst: *mut T)

#### unsafe fn clone_to_uninit(&self, dst: *mut T)

`clone_to_uninit`

)