/*
7 * 2015 Jabier Arraiza Cenoz<jabier.arraiza@marker.es>
9 * Copyright (C) 2018 Authors
10 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
32 : nodesatellite_type(nodesatellite_type)
54 double length_part = curve_in.
length();
56 if (length_part != 0) {
61 if (!t_roots.empty()) {
77 double length_part = curve_in.
length();
79 s = (A * length_part);
97 rot90(unitVector(derivative(d2_in))) * (A);
100 rot90(unitVector(derivative(d2_out))) * (A);
101 offset_curve0[0][0].normalize();
102 offset_curve0[0][1].normalize();
103 Geom::Path p0 = path_from_piecewise(offset_curve0, 0.1)[0];
104 offset_curve1[0][0].normalize();
105 offset_curve1[0][1].normalize();
106 Geom::Path p1 = path_from_piecewise(offset_curve1, 0.1)[0];
110 double p0pt = nearest_time(cp, curve_out);
125 double time_in = (previousNodeSatellite).
time(A,
true, curve_in);
134 ray1.
setPoints((*cubic1)[2], start_arc_point);
139 ray2.
setPoints(end_arc_point, (*cubic2)[1]);
141 bool ccw_toggle = cross(curve_in.
pointAt(1) - start_arc_point,
142 end_arc_point - start_arc_point) < 0;
143 double distance_arc =
144 Geom::distance(start_arc_point, middle_point(start_arc_point, end_arc_point));
145 double angle = angle_between(ray1, ray2, ccw_toggle);
146 double divisor = std::sin(
angle / 2.0);
148 return distance_arc / divisor;
158 t =
time(t, inverse, curve_in);
159 }
else if (inverse) {
171 if (A == 0 && inverse) {
174 if (A == 0 && !inverse) {
180 double length_part = curve_in.
length();
198 double t =
time(curve_in, inverse);
219 std::map<std::string, NodeSatelliteType> gchar_map_to_nodesatellite_type = boost::assign::map_list_of(
"F",
FILLET)(
221 auto it = gchar_map_to_nodesatellite_type.find(std::string(A));
222 if (it != gchar_map_to_nodesatellite_type.end()) {
230 std::map<NodeSatelliteType, gchar const *> nodesatellite_type_to_gchar_map = boost::assign::map_list_of(
Bezier curve with compile-time specified order.
Abstract continuous curve on a plane defined on [0,1].
virtual D2< SBasis > toSBasis() const =0
Convert the curve to a symmetric power basis polynomial.
virtual bool isDegenerate() const =0
Check whether the curve has exactly zero length.
virtual Coord length(Coord tolerance=0.01) const
Compute the arc length of this curve.
virtual Curve * portion(Coord a, Coord b) const =0
Create a curve that corresponds to a part of this curve.
virtual bool isLineSegment() const
Check whether the curve is a line segment.
virtual Point pointAt(Coord t) const
Evaluate the curve at a specified time value.
Adaptor that creates 2D functions from 1D ones.
Sequence of contiguous curves, aka spline.
Function defined as discrete pieces.
Two-dimensional point that doubles as a vector.
Straight ray from a specific point to infinity.
void setPoints(Point const &a, Point const &b)
NodeSatellite a per node holder of data.
NodeSatelliteType nodesatellite_type
NodeSatellite()
NodeSatellite a per node holder of data.
double lenToRad(double const A, Geom::Curve const &curve_in, Geom::Curve const &curve_out, NodeSatellite const previousNodeSatellite) const
Convert a nodesatellite length -point position where fillet/chamfer knot be on original curve- to a a...
gchar const * getNodeSatellitesTypeGchar() const
Map a gchar with nodesatelliteType.
void setNodeSatellitesType(gchar const *A)
Map a nodesatellite type with gchar.
Geom::Point getPosition(Geom::Curve const &curve_in, bool inverse=false) const
Get the point position of the nodesatellite.
double arcDistance(Geom::Curve const &curve_in) const
Get the length of the nodesatellite in curve_in.
double time(Geom::Curve const &curve_in, bool inverse=false) const
Get the time position of the nodesatellite in curve_in.
void setPosition(Geom::Point const p, Geom::Curve const &curve_in, bool inverse=false)
Set the position of the nodesatellite from a given point P.
double radToLen(double const A, Geom::Curve const &curve_in, Geom::Curve const &curve_out) const
Convert a arc radius of a fillet/chamfer to his nodesatellite length -point position where fillet/cha...
double timeAtArcLength(double const A, Geom::Curve const &curve_in)
Calculate the time in curve_in with a size of A.
double arcLengthAt(double const A, Geom::Curve const &curve_in)
Calculate the size in curve_in with a point at A.
NodeSatellite – a per node holder of data.
double timeAtArcLength(double const A, Geom::Curve const &curve_in)
Calculate the time in curve_in with a size of A.
double arcLengthAt(double const A, Geom::Curve const &curve_in)
Calculate the size in curve_in with a point at A.
Coord nearest_time(Point const &p, Curve const &c)
Angle distance(Angle const &a, Angle const &b)
std::vector< Crossing > Crossings
Crossings crossings(Curve const &a, Curve const &b)
Piecewise< SBasis > arcLengthSb(D2< SBasis > const &M, double tol=.01)
Nearest time routines for D2<SBasis> and Piecewise<D2<SBasis>>
Conversion between SBasis and Bezier basis polynomials.