26 for (
int i = 3; i >= 0; --i) {
53 for (
auto const &path : pathv) {
85 auto it = pathv.
begin();
94 for (++it; it != pathv.
end(); ++it) {
98 for (
auto const &it : pathv) {
126 lastpath.
append(newfirstpath);
128 for (++path_it; path_it != pathv.
end(); ++path_it) {
171 auto const offset1 = new_p1 - pathv.
finalPoint();
176 g_error(
"stretch_endpoints - arclength <= 0");
179 auto const A = offset0;
180 auto const B = offset1;
190 if (!pathv.
empty()) {
205 for (
auto const &path : pathv) {
208 size_t psize = std::max<size_t>(1, path.size_closed());
210 if (path.closed() && path.size_closed() > 0) {
211 auto const &closingline = path.back_closed();
214 if (
Geom::are_near(closingline.initialPoint(), closingline.finalPoint())) {
239 newcube.
setPoint(2, newcube[2] + p);
247 path.append(
curve.release());
Cartesian point / 2D vector and related operations.
void setPoint(unsigned ix, Point const &v)
Modify a control point.
Abstract continuous curve on a plane defined on [0,1].
Adaptor that creates 2D functions from 1D ones.
CPoint corner(unsigned i) const
Return the n-th corner of the rectangle.
void push_back(Path const &path)
Append a path at the end.
Sequence::const_iterator const_iterator
Point finalPoint() const
Get the last point in the last path of the vector.
Point initialPoint() const
Get the first point in the first path of the vector.
bool empty() const
Check whether the vector contains any paths.
Sequence of contiguous curves, aka spline.
Point finalPoint() const
Get the last point in the path.
void close(bool closed=true)
Set whether the path is closed.
bool empty() const
Check whether path is empty.
Piecewise< D2< SBasis > > toPwSb() const
const_iterator end() const
Curve const & back() const
Access the last curve in the path.
Curve const & back_open() const
Curve const & back_default() const
void append(Curve *curve)
Add a new curve to the end of the path.
Point initialPoint() const
Get the first point in the path.
Curve const & front() const
Access the first curve in the path.
void setFinal(Point const &p)
size_type size() const
Natural size of the path.
void replace(iterator replaced, Curve const &curve)
void setInitial(Point const &p)
void appendNew(Args &&... args)
Append a new curve to the path.
Function defined as discrete pieces.
output_type lastValue() const
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
void backspace(Geom::PathVector &pathv)
Remove last segment of curve.
size_t node_count(Geom::PathVector const &pathv)
returns the number of nodes in a path, used for statusbar text when selecting an spcurve.
void move_endpoints(Geom::PathVector &pathv, Geom::Point const &new_p0, Geom::Point const &new_p1)
Sets start of first path to new_p0, and end of first path to new_p1.
void pathvector_append(Geom::PathVector &to, Geom::PathVector const &pathv, bool use_lineto)
Append pathv to to.
Geom::Curve const * get_last_segment(Geom::PathVector const &pathv)
Return last pathsegment (possibly the closing path segment) of the last path in PathVector or null.
void stretch_endpoints(Geom::PathVector &pathv, Geom::Point const &new_p0, Geom::Point const &new_p1)
TODO: add comments about what this method does and what assumptions are made and requirements are put...
Geom::Path path_from_curve(std::unique_ptr< Geom::Curve > curve)
Construct an open Geom::Path from Geom::Curve. Fixme: Should be in 2geom.
Geom::Path rect_to_open_path(Geom::Rect const &rect)
Authors: Lauris Kaplinski lauris@kaplinski.com Johan Engelen.
Geom::Curve const * get_first_segment(Geom::PathVector const &pathv)
Return first pathsegment in PathVector or NULL.
void closepath_current(Geom::Path &path)
Close path by setting the end point to the start point instead of adding a new lineto.
bool pathvector_append_continuous(Geom::PathVector &to, Geom::PathVector const &pathv, double tolerance)
Append pathv to to with possible fusing of close endpoints.
void last_point_additive_move(Geom::PathVector &pathv, Geom::Point const &p)
Add p to the last point (and last handle if present) of the last path.
bool is_closed(Geom::PathVector const &pathv)
Whether all subpaths are closed. Returns false if the curve is empty.
Piecewise< D2< SBasis > > sectionize(D2< Piecewise< SBasis > > const &a)
PathVector path_from_piecewise(Piecewise< D2< SBasis > > const &B, double tol, bool only_cubicbeziers=false)
Make a path from a d2 sbasis.
Piecewise< SBasis > arcLengthSb(D2< SBasis > const &M, double tol=.01)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
Coord LInfty(Point const &p)
two-dimensional geometric operators.
Conversion between SBasis and Bezier basis polynomials.