diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-10-02 22:44:54 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-10-02 22:44:54 +0000 |
| commit | 90e142963afd950b2868434075890054aef090b3 (patch) | |
| tree | edcaf3d0d85b614e5f327fb58c909ffee5207e26 /src/2geom | |
| parent | Added some widgets from caligraphic tool (diff) | |
| parent | Adjust dock size to minimum width during canvas table size allocation signal. (diff) | |
| download | inkscape-90e142963afd950b2868434075890054aef090b3.tar.gz inkscape-90e142963afd950b2868434075890054aef090b3.zip | |
Update to trunk and some fixes
(bzr r14865.1.14)
Diffstat (limited to 'src/2geom')
| -rw-r--r-- | src/2geom/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/2geom/Makefile_insert | 131 | ||||
| -rw-r--r-- | src/2geom/sbasis-geometric.cpp | 9 |
3 files changed, 11 insertions, 137 deletions
diff --git a/src/2geom/CMakeLists.txt b/src/2geom/CMakeLists.txt index 97b47b630..aa51d51bd 100644 --- a/src/2geom/CMakeLists.txt +++ b/src/2geom/CMakeLists.txt @@ -60,13 +60,16 @@ set(2geom_SRC bezier-to-sbasis.h bezier-utils.h bezier.h + cairo-path-sink.h choose.h circle.h + circulator.h concepts.h conic_section_clipper.h conic_section_clipper_cr.h conic_section_clipper_impl.h conicsec.h + convex-hull.h coord.h crossing.h curve.h @@ -82,10 +85,13 @@ set(2geom_SRC int-interval.h int-point.h int-rect.h + intersection-graph.h + intersection.h interval.h line.h linear.h math-utils.h + nearest-time.h ord.h path-intersection.h path-sink.h @@ -106,8 +112,8 @@ set(2geom_SRC solver.h svg-path-parser.h svg-path-writer.h - sweeper.h sweep-bounds.h + sweeper.h toposweep.h transforms.h utils.h diff --git a/src/2geom/Makefile_insert b/src/2geom/Makefile_insert deleted file mode 100644 index 4d41de297..000000000 --- a/src/2geom/Makefile_insert +++ /dev/null @@ -1,131 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -2geom/all: 2geom/lib2geom.a - -2geom/clean: - rm -f 2geom/lib2geom.a $(2geom_lib2geom_a_OBJECTS) - -2geom_lib2geom_a_SOURCES = \ - 2geom/2geom.h \ - 2geom/affine.cpp \ - 2geom/affine.h \ - 2geom/angle.h \ - 2geom/basic-intersection.cpp \ - 2geom/basic-intersection.h \ - 2geom/bezier-clipping.cpp \ - 2geom/bezier-curve.cpp \ - 2geom/bezier-curve.h \ - 2geom/bezier.cpp \ - 2geom/bezier.h \ - 2geom/bezier-to-sbasis.h \ - 2geom/bezier-utils.cpp \ - 2geom/bezier-utils.h \ - 2geom/cairo-path-sink.cpp \ - 2geom/cairo-path-sink.h \ - 2geom/choose.h \ - 2geom/circle.cpp \ - 2geom/circle.h \ - 2geom/circulator.h \ - 2geom/CMakeLists.txt \ - 2geom/concepts.h \ - 2geom/conicsec.cpp \ - 2geom/conicsec.h \ - 2geom/conic_section_clipper_cr.h \ - 2geom/conic_section_clipper.h \ - 2geom/conic_section_clipper_impl.cpp \ - 2geom/conic_section_clipper_impl.h \ - 2geom/convex-hull.cpp \ - 2geom/convex-hull.h \ - 2geom/coord.cpp \ - 2geom/coord.h \ - 2geom/crossing.cpp \ - 2geom/crossing.h \ - 2geom/curve.cpp \ - 2geom/curve.h \ - 2geom/curves.h \ - 2geom/d2.h \ - 2geom/d2-sbasis.cpp \ - 2geom/ellipse.cpp \ - 2geom/ellipse.h \ - 2geom/elliptical-arc.cpp \ - 2geom/elliptical-arc.h \ - 2geom/elliptical-arc-from-sbasis.cpp \ - 2geom/exception.h \ - 2geom/forward.h \ - 2geom/generic-interval.h \ - 2geom/generic-rect.h \ - 2geom/geom.cpp \ - 2geom/geom.h \ - 2geom/intersection.h \ - 2geom/intersection-graph.cpp \ - 2geom/intersection-graph.h \ - 2geom/interval.h \ - 2geom/int-interval.h \ - 2geom/int-point.h \ - 2geom/int-rect.h \ - 2geom/linear.h \ - 2geom/line.cpp \ - 2geom/line.h \ - 2geom/math-utils.h \ - 2geom/nearest-time.cpp \ - 2geom/nearest-time.h \ - 2geom/ord.h \ - 2geom/path.cpp \ - 2geom/path.h \ - 2geom/path-intersection.cpp \ - 2geom/path-intersection.h \ - 2geom/path-sink.cpp \ - 2geom/path-sink.h \ - 2geom/pathvector.cpp \ - 2geom/pathvector.h \ - 2geom/piecewise.cpp \ - 2geom/piecewise.h \ - 2geom/point.cpp \ - 2geom/point.h \ - 2geom/polynomial.cpp \ - 2geom/polynomial.h \ - 2geom/ray.h \ - 2geom/rect.cpp \ - 2geom/rect.h \ - 2geom/recursive-bezier-intersection.cpp \ - 2geom/sbasis-2d.cpp \ - 2geom/sbasis-2d.h \ - 2geom/sbasis.cpp \ - 2geom/sbasis-curve.h \ - 2geom/sbasis-geometric.cpp \ - 2geom/sbasis-geometric.h \ - 2geom/sbasis.h \ - 2geom/sbasis-math.cpp \ - 2geom/sbasis-math.h \ - 2geom/sbasis-poly.cpp \ - 2geom/sbasis-poly.h \ - 2geom/sbasis-roots.cpp \ - 2geom/sbasis-to-bezier.cpp \ - 2geom/sbasis-to-bezier.h \ - 2geom/solve-bezier.cpp \ - 2geom/solve-bezier-one-d.cpp \ - 2geom/solve-bezier-parametric.cpp \ - 2geom/solver.h \ - 2geom/svg-path-parser.cpp \ - 2geom/svg-path-parser.h \ - 2geom/svg-path-writer.cpp \ - 2geom/svg-path-writer.h \ - 2geom/sweep-bounds.cpp \ - 2geom/sweep-bounds.h \ - 2geom/sweeper.h \ - 2geom/toposweep.cpp \ - 2geom/toposweep.h \ - 2geom/transforms.cpp \ - 2geom/transforms.h \ - 2geom/utils.cpp \ - 2geom/utils.h \ - 2geom/numeric/fitting-model.h \ - 2geom/numeric/fitting-tool.h \ - 2geom/numeric/linear_system.h \ - 2geom/numeric/matrix.cpp \ - 2geom/numeric/matrix.h \ - 2geom/numeric/symmetric-matrix-fs.h \ - 2geom/numeric/symmetric-matrix-fs-operation.h \ - 2geom/numeric/symmetric-matrix-fs-trace.h \ - 2geom/numeric/vector.h - diff --git a/src/2geom/sbasis-geometric.cpp b/src/2geom/sbasis-geometric.cpp index 8aaa15144..19eccc451 100644 --- a/src/2geom/sbasis-geometric.cpp +++ b/src/2geom/sbasis-geometric.cpp @@ -101,7 +101,7 @@ static SBasis divide_by_t1k(SBasis const &a, int k) { static D2<SBasis> RescaleForNonVanishingEnds(D2<SBasis> const &MM, double ZERO=1.e-4){ D2<SBasis> M = MM; //TODO: divide by all the s at once!!! - while ((M[0].size()>0||M[1].size()>0) && + while ((M[0].size()>1||M[1].size()>1) && fabs(M[0].at0())<ZERO && fabs(M[1].at0())<ZERO && fabs(M[0].at1())<ZERO && @@ -109,12 +109,12 @@ static D2<SBasis> RescaleForNonVanishingEnds(D2<SBasis> const &MM, double ZERO=1 M[0] = divide_by_sk(M[0],1); M[1] = divide_by_sk(M[1],1); } - while ((M[0].size()>0||M[1].size()>0) && + while ((M[0].size()>1||M[1].size()>1) && fabs(M[0].at0())<ZERO && fabs(M[1].at0())<ZERO){ M[0] = divide_by_t0k(M[0],1); M[1] = divide_by_t0k(M[1],1); } - while ((M[0].size()>0||M[1].size()>0) && + while ((M[0].size()>1||M[1].size()>1) && fabs(M[0].at1())<ZERO && fabs(M[1].at1())<ZERO){ M[0] = divide_by_t1k(M[0],1); M[1] = divide_by_t1k(M[1],1); @@ -227,9 +227,9 @@ Geom::unitVector(D2<SBasis> const &V_in, double tol, unsigned order){ // -This approach is numerically bad. Find a stable way to rescale V_in to have non vanishing ends. // -This done, unitVector will have jumps at zeros: fill the gaps with arcs of circles. D2<SBasis> V = RescaleForNonVanishingEnds(V_in); - if (V[0].isZero(0) && V[1].isZero(0)) return Piecewise<D2<SBasis> >(D2<SBasis>(Linear(1),SBasis())); + SBasis x = V[0], y = V[1]; SBasis r_eqn1, r_eqn2; @@ -242,7 +242,6 @@ Geom::unitVector(D2<SBasis> const &V_in, double tol, unsigned order){ r_eqn1 = -(a*x+b*y); r_eqn2 = Linear(1.)-(a*a+b*b); - for (unsigned k=1; k<=order; k++){ double r0 = (k<r_eqn1.size())? r_eqn1.at(k).at0() : 0; double r1 = (k<r_eqn1.size())? r_eqn1.at(k).at1() : 0; |
