This one is for interactive exploring of svg paths.
You can enter an SVG path in the entry and hit Enter
to see how GSK renders it. If you click the button
in the headerbar, you can see what GTK thinks the
closest point, tangent and distance are wrt. to the
mouse position, and the bounding box of the path.
There's also stroke parameters to play with.
Add tests to check that any point on a path is
always at most half the line-width away from the
stroke path with that line-width.
Also check that the outlines of random paths look
as expected. We currently have to exclude paths
where points get too close to each other.
Implement gsk_contour_default_add_stroke, which takes a contour
and stroke parameters, and adds contours to a path builder for
the outline that would be produced by stroking the path with these
parameters.
The current implementation does not try to handle short segments
in the vicinity of sharp joins in any special way, so there can
be some artifacts in that situation.
Add a function that takes a path, and offsets it
by some distance, applying line-join parameters
as needed.
This commit just adds the api, the implementation
will be in the following commit.
Nothing prevents control points from being identical,
and if that happens, some of our constructions involving
tangents and normals break down. Handle these cases in
get_{start,end}_tangent and offset, for the case of
cubics.
Add a way to find the intersections of two curves.
We can handle some curve-line intersections directly,
the general case is handled via bisecting.
This will be used in stroking and path ops.
This is mainly useful for decomposing a conic into
cubics. The criterion here for terminating the
subdivision is very improvised.
But it also allows for other use cases, such as
raising the degree of quadratics to cubics.
An auxiliary API introduced here is gsk_curve_elevate.
This is to make room in the api for quadratic curves.
In detail:
- Replace GSK_PATH_CURVE by _CUBIC
- Rename gsk_path_builder_curve_to to _cubic_to
- Replace GSK_PATH_FOREACH_ALLOW_CURVE with _CUBIC
- Replace GskCurveCurve with GskCubicCurve
If we can't append a circle contour, just
convert to a standard contour. This warning
was occasionally causing tests to fail
(when a suitable random path gets generated).
When looking for discontinuities, there
is no need to check for epsilons. As we
move close to the end of one contour / the
beginning of the next, the path length distance
between the two points will get arbitrarily
small, so we can just check that the distance
between the points is more than twice that.
This makes spurious failures of the /path/get_point
test go away.