88 return contours_.empty();
95 return contours_.size();
114 std::optional<PathPose>
pose_at(
float distance)
const;
138 float distance = 0.0f;
140 uint32_t segment_index = 0;
149 uint32_t contour_index = 0;
153 size_t first_sample = 0;
154 size_t sample_count = 0;
155 size_t first_segment = 0;
156 size_t segment_count = 0;
157 float start_distance = 0.0f;
162 std::vector<Sample> samples_;
163 std::vector<Segment> segments_;
164 std::vector<Contour> contours_;
165 float total_length_ = 0.0f;
169 size_t sample_index_for(
float distance)
const;
size_t contour_count() const
Contours are the move_to-delimited subpaths, in path order.
Definition path_measure.hpp:94
Path segment(float start, float end) const
The part of the path between two distances, as a new Path.
std::optional< PathPose > pose_at(float distance) const
Position and unit tangent at distance along the path.
std::optional< Point2D > position_at(float distance) const
pose_at(distance)->position, for callers that do not need the tangent.
PathMeasure(const Path &path, float tolerance=default_tolerance)
Measure path.
bool is_empty() const
Definition path_measure.hpp:87
std::optional< Point2D > tangent_at(float distance) const
pose_at(distance)->tangent, for callers that do not need the position.
static constexpr float default_tolerance
The default flattening tolerance, in path units.
Definition path_measure.hpp:73
float length() const
Total length of every contour summed. 0 for an empty path.
Definition path_measure.hpp:83
bool contour_is_closed(size_t index) const
Whether contour index was closed with close().
float contour_length(size_t index) const
float contour_start(size_t index) const
Distance at which contour index begins, measured from the start of the path.
Definition affine_transform.hpp:24
@ path
Definition scene_node.hpp:93
A position on a measured path, with the direction of travel there.
Definition path_measure.hpp:62
Point2D position
Definition path_measure.hpp:63
Point2D tangent
Unit tangent.
Definition path_measure.hpp:67
A 2D point.
Definition affine_transform.hpp:37