• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

CMakeScripts/H15-Jan-2021-378336

doc/H03-May-2022-1,4311,069

include/H15-Jan-2021-25,67314,451

src/H03-May-2022-76,88453,592

tests/H03-May-2022-7,9625,404

tools/H15-Jan-2021-10893

.gitignoreH A D15-Jan-2021571 4140

.gitlab-ci.ymlH A D15-Jan-2021924 3329

2GeomConfig.cmakeH A D15-Jan-2021126 33

2geom.pc.inH A D15-Jan-2021266 1410

AUTHORS.mdH A D15-Jan-2021468 2725

COPYING-LGPL-2.1H A D15-Jan-202125.9 KiB511422

COPYING-MPL-1.1H A D15-Jan-202125.2 KiB471396

DoxyfileH A D15-Jan-2021102.8 KiB2,3561,819

HACKING.mdH A D15-Jan-20211.7 KiB5442

LICENSE.mdH A D15-Jan-2021668 1713

NEWS.mdH A D15-Jan-20211.5 KiB4633

README.mdH A D15-Jan-20214 KiB12490

README.win32.mdH A D15-Jan-20212.7 KiB5750

RELEASING.mdH A D15-Jan-2021431 2217

TODO.mdH A D15-Jan-20213.7 KiB8679

_clang-formatH A D15-Jan-20211.6 KiB5452

cmake_uninstall.cmake.inH A D15-Jan-2021969 2421

makefile.inH A D15-Jan-2021261 189

mingwenv.batH A D15-Jan-2021695 1915

toy.pc.inH A D15-Jan-2021272 1410

README.md

1# 2Geom: easy 2D graphics library
2
3## What is this?
4
52Geom is a C++ 2D geometry library geared towards robust processing of
6computational geometry data associated with vector graphics. The primary
7design consideration is ease of use and clarity. It is dual-licensed
8under LGPL 2.1 and MPL 1.1.
9
10The library is descended from a set of geometric routines present in
11Inkscape, a vector graphics editor based around the Scalable Vector
12Graphics format, the most widespread vector graphics interchange format
13on the Web and a W3C Recommendation. Due to this legacy, not all parts
14of the API form a coherent whole (yet).
15
16Rendering is outside the scope of this library, and it is assumed
17something like libcairo or similar is employed for this.  2geom
18concentrates on higher level algorithms and geometric computations.
19
20
21## Features List
22
23* C++ 17
24* Functional programming style.
25* Points
26* Efficient affine transformations
27* Rectangles
28* Convex Hulls
29* Bounded error
30* General purpose paths:
31  + Exact elliptical arcs
32  + Area
33  + Centroid and bending moments
34* Path Locations:
35  + Determination of special spots (e.g. maximum curvature)
36  + Splitting
37  + Point, tangent, curvature at location
38  + Efficient arc length and inverse arc length
39* Path algebra:
40  + Computations such as offset curves can be written with their mathematical definition
41    and still get a bounded error, efficient curve. (preliminary trials indicate offset
42    done this way out performs the method used in Inkscape)
43* Arbitrary distortion (with bounded error):
44  + Mesh distorts
45  + Computational distorts such as the GIMP's 'vortex' plugin
46  + 3d mapping (perspective, flag, sphere)
47* Exact boolean ops (elliptic arcs remain elliptic arcs)
48* Efficient 2d database
49* Implicit function plotting
50* NURBs input and output
51* Tunable path simplification
52* PDoF constraint system for CAD/CAGD
53
54
55## Dependencies
56
57To build 2Geom, you will need:
58
59* C++ 17
60* [Boost](http://www.boost.org/) (headers only)
61* [glib](https://wiki.gnome.org/Projects/GLib)
62* [GNU Scientific Library](http://www.gnu.org/software/gsl/)
63* [double-conversion](https://github.com/google/double-conversion)
64* [cairo](https://www.cairographics.org/)
65* [Ragel](http://www.colm.net/open-source/ragel/) (if you want to modify the SVG path parser)
66* [GTK+ 2](http://www.gtk.org/) (for demo programs)
67
68
69## Building
70
712Geom uses CMake as the build and configuration system. To build, type:
72
73    mkdir build && cd build
74    cmake ..
75    make
76
77To run tests and performance tests:
78
79    make test
80    make perf
81
82**Note**: Tests are disabled by default. To enable tests pass `-D2GEOM_TESTING=ON` to `cmake` command.
83
84Also check out some of the interactive programs in src/toys.
85
86Documentation is generated from source comments using Doxygen.
87Run `doxygen` in the project root to generate documentation in
88`doc/html`.
89
90
91## API / ABI Stability
92
93Version 1.0 of 2Geom marks its first official release.  With this
94release the library's API/ABI is considered stable:
95
96 * All public APIs will not be renamed or have their parameters changed
97   without providing backwards-compatible aliases.
98
99 * New functionality added to these APIs will not change their meaning
100   or fundamental behaviors.
101
102 * If an API needs to be removed or replaced, it will be declared
103   deprecated but will remain in the API until the next major version.
104   Warnings will be issued when the deprecated method is called.
105
106 * We'll only break backwards compatibility of these APIs if a bug or
107   security hole makes it completely unavoidable.
108
109Improvements that would break the API/ABI will be noted in our bug
110tracker, for a future release.
111
1122Geom does not follow Semantic Versioning. Instead, version numbers
113match major Inkscape release versions.
114
115
116## Further information
117
118Communications related to 2Geom development happen on a
119[SourceForge mailing list](https://lists.sourceforge.net/lists/listinfo/lib2geom-devel).
120
121The primary user of 2Geom is [Inkscape](https://inkscape.org/en/).
122API-breaking changes to 2Geom will require corresponding changes to
123Inkscape.
124

README.win32.md

1# win32 instructions
2## Installation
3- Download the latest mingw, gsl, and gtk bundles from [http://inkscape.modevia.com/win32libs/?C=M;O=D](http://inkscape.modevia.com/win32libs/?C=M;O=D)
4- Also download Boost from SourceForge and unpack it in a directory of your choice (you specify it's path later on)
5- Obtain, compile and install Inkscape svn following these instructions http://inkscape.org/win32/win32buildnotes.html
6- unpackage the gsl bundle into the directory with the gtk bundle
7- download cmake; install at `C:\cmake`
8- check the directories in mingwenv.bat. Are they set correctly for you? (ignore RAGEL_BIN)
9- make a build directory
10- open cmd.exe
11    ```
12    mingwenv.bat
13    cmake -G "MinGW Makefiles" c:\path\to\2geom # be sure you have a CAPITAL '-G' there!
14    cmake -i # especially mind to set the install dir to where you want it installed (probably the gtk folder, e.g. c:/gtk210))
15    mingw32-make
16    ```
17- copy the resulting `.exe` files into the inkscape install directory
18
19If you want to be able to compile the ragel defined svg-parser as well,
20you must download ragel from [here](http://www.cs.queensu.ca/~thurston/ragel/)
21Unpack the windows binary package into a dir of your own choice.
22Check whether ragel's dir is set correctly in mingwenv.bat (RAGEL_BIN).
23Make sure you have ragel.exe and rlcodegen.exe in the dir you specify.
24If your package does not contain rlcodegen.exe you can copy rlgen-cd.exe
25and rename it to rlcodegen.exe :-)
26
27## PYTHON BINDINGS
28To install python bindings, you need python2 and cython(>=0.16). Get cython from
29[http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython](http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython)
30and install it to `$PYTHON_PATH\Libs\site-packages`
3132-bit version is your safest bet.
32cmake should be able to find cython now. Make sure that `PYTHON_PATH` is set
33correctly to python2 in mingwenv.bat.
34
35Continue with installation as described above. When running "cmake -i",
36remember to choose to build cython bindings and also lib2geom as a
37shared library!
38
39If you get errors about missing DLL file, try copying lib2geom.dll to
40cython-bindings directory.
41
42Note: If you have both python2 and python3 installed, make sure cmake uses
43python2. To ensure this, choose "advanced options" when running "cmake -i",
44scroll and set PYTHON_INCLUDE_DIR and PYTHON_LIBRARY accordingly.
45
46## TROUBLESHOOTING
47If things don't work out, here is a list of things you can try.
48Type `make --version`. It should display:
49```
50E:\inkscapelpe>mingw32-make --version
51GNU Make 3.80
52Copyright (C) 2002  Free Software Foundation, Inc.
53```
54Or something very similar. If it does not, probably windows finds a different
55make (Borland's or another?). Type `set path=`, then start again with
56`mingwenv.bat` etc...
57