Improvement of AdaptiveFill:

1) Merging of collinear infill lines separated by a thin gap created
   by trimming with the boundary polygon.
2) Sorting of the T-joints separately to the left / right of the common
   line.
3) Trimming self intersections of the anchor lines.
4) Dropping of very short segments, not anchoring short segments.
This commit is contained in:
Vojtech Bubnik 2020-11-10 13:56:12 +01:00
parent 517477f0dd
commit 89df9c1038
3 changed files with 383 additions and 127 deletions

View file

@ -24,7 +24,7 @@ namespace line_alg {
template<class L, class T, int N>
double distance_to_squared(const L &line, const Vec<N, T> &point)
{
const Vec<N, double> v = line.vector().template cast<double>();
const Vec<N, double> v = (line.b - line.a).template cast<double>();
const Vec<N, double> va = (point - line.a).template cast<double>();
const double l2 = v.squaredNorm(); // avoid a sqrt
if (l2 == 0.0)