Represents 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 <GskPathPoint>, use path:get-closest-point!, path:get-start-point!, path:get-end-point! or path-measure:get-point!.
Note that <GskPathPoint> 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 <GskPathPoint> is used.
Returns whether self is before or after point2.
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPathPoint>.
another path point
Returned: a 32-bit integer.
-1 if self is before point2, 1 if self is after point2, 0 if they are equal
Copies a path point.
Passed: a <GskPathPoint>.
a path point
Returned: a <GskPathPoint>.
the copied point
Returns whether the two path points refer to the same location on all paths.
Note that the start- and endpoint of a closed contour will compare
nonequal according to this definition. Use path:is-closed? to find out if the start- and endpoint of a
concrete path refer to the same location.
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPathPoint>.
another path point
Returned: a boolean.
true if self and point2 are equal
Frees a path point copied by path-point:copy.
Passed: a <GskPathPoint>.
a path 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.
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPath>.
the path that self is on
Passed: a <GskPathDirection>, or one of its
symbols.
the direction for which to return the curvature
Passed, filled in, and returned: a
<GraphenePoint>, or #f.
return location for the center of the osculating circle
Returned: a real number.
the curvature of the path at the given point
Returns the distance from the beginning of the path to the point.
Passed: a <GskPathPoint>.
a point on the path
Passed: a <GskPathMeasure>.
a path measure for the path
Returned: a real number.
the distance of self
Gets the position of the point.
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPath>.
the path that self is on
Passed, filled in, and returned: a
<GraphenePoint>.
Return location for the coordinates of the point
Gets the direction of the tangent at a given point.
This is a convenience variant of path-point:get-tangent! that returns the angle between
the tangent and the X axis. The angle can e.g. be used in
gtk_snapshot_rotate().
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPath>.
the path that self is on
Passed: a <GskPathDirection>, or one of its
symbols.
the direction for which to return the rotation
Returned: a real number.
the angle between the tangent and the X axis, in degrees
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 the tangent is set to 0, 0.
If you want to orient something in the direction of the path,
path-point:get-rotation may be more
convenient to use.
Passed: a <GskPathPoint>.
a path point
Passed: a <GskPath>.
the path that self is on
Passed: a <GskPathDirection>, or one of its
symbols.
the direction for which to return the tangent
Passed, filled in, and returned: a
<GrapheneVec2>.
Return location for the tangent at the point