All Projects → skramm → homog2d

skramm / homog2d

Licence: other
C++ 2D geometry library, handles points, lines, polylines, planar transformations (and other primitives), using homogeneous coordinates. Provided with complete manual and samples.

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to homog2d

Data structure and algorithms library
A collection of classical algorithms and data-structures implementation in C++ for coding interview and competitive programming
Stars: ✭ 133 (+90%)
Mutual labels:  computational-geometry
Isect
Segments intersection detection library
Stars: ✭ 199 (+184.29%)
Mutual labels:  computational-geometry
Tinfour
Delaunay and Constrained Delaunay Triangulations in Java, providing high-performance utilities for modeling surfaces with support for Lidar LAS files, Digital Elevation Models (DEM), finite element analysis, path planning, natural neighbor interpolation, and other applications of Triangulated Irregular Networks (TIN)
Stars: ✭ 119 (+70%)
Mutual labels:  computational-geometry
Cavaliercontours
2D polyline library for offsetting, combining, etc.
Stars: ✭ 135 (+92.86%)
Mutual labels:  computational-geometry
Greinerhormann
Greiner-Hormann polygon clipping algorithm. Does AND, OR, XOR. Plays nicely with Leaflet. Handles non-convex polygons and multiple clipping areas. ~3kb footprint, no dependencies
Stars: ✭ 176 (+151.43%)
Mutual labels:  computational-geometry
Skeleton Tracing
A new algorithm for retrieving topological skeleton as a set of polylines from binary images
Stars: ✭ 241 (+244.29%)
Mutual labels:  computational-geometry
Gosl
Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations.
Stars: ✭ 1,629 (+2227.14%)
Mutual labels:  computational-geometry
MTF
Modular Tracking Framework
Stars: ✭ 99 (+41.43%)
Mutual labels:  homography
Dlib
Allocators, I/O streams, math, geometry, image and audio processing for D
Stars: ✭ 182 (+160%)
Mutual labels:  computational-geometry
Geokdbush
The fastest spatial index for geographic locations in JavaScript
Stars: ✭ 251 (+258.57%)
Mutual labels:  computational-geometry
Rbush
RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles
Stars: ✭ 1,881 (+2587.14%)
Mutual labels:  computational-geometry
Robust Predicates
Fast robust predicates for computational geometry in JavaScript
Stars: ✭ 170 (+142.86%)
Mutual labels:  computational-geometry
Delaunator Cpp
A really fast C++ library for Delaunay triangulation of 2D points
Stars: ✭ 244 (+248.57%)
Mutual labels:  computational-geometry
Hxgeomalgo
Small collection of computational geometry algorithms in Haxe.
Stars: ✭ 133 (+90%)
Mutual labels:  computational-geometry
inpoly
A fast 'point(s)-in-polygon' test for MATLAB.
Stars: ✭ 17 (-75.71%)
Mutual labels:  computational-geometry
Turf Swift
A Swift language port of Turf.js.
Stars: ✭ 123 (+75.71%)
Mutual labels:  computational-geometry
Cgal
The public CGAL repository, see the README below
Stars: ✭ 2,825 (+3935.71%)
Mutual labels:  computational-geometry
SplashGeom
Open-source C++ library for geometry and linear algebra
Stars: ✭ 22 (-68.57%)
Mutual labels:  computational-geometry
petyr
Affine Tranformation and Homography library for Python
Stars: ✭ 16 (-77.14%)
Mutual labels:  homography
Projects
A list of awesome open source projects Vladimir Agafonkin is involved in.
Stars: ✭ 250 (+257.14%)
Mutual labels:  computational-geometry

homog2d

Current test status: GH actions build status

License: MPLv2

A single-file header-only C++ library dedicated to handling 2D lines, points and homographies (2D planar transformations) in Cartesian geometry, using internally homogeneous coordinates. Also handles other geometric primitives, see full manual.

showcase1

(see other demos here)

Short preview:

#include "homog2d.hpp"
using namespace h2d;
int main()
{
	Line2d l1( Point2d(10,10) );               // a line passing through (0,0) and (10,10)
	Line2d l2( Point2d(0,10), Point2d(10,0) ); // a line passing through (0,10) and (10,0)
	auto pt = l1 * l2;                         // intersection point (5,5)
	Homogr H(2,3);                             // a translation matrix
	std::cout << H * pt;                       // prints [7,8]
}

News

  • 2023-02-19: 2.10 release, see https://github.com/skramm/homog2d/releases
  • 2023-02-12: added support for "big numbers" through the ttmath library, see here) (preliminar!)
  • 2022-12-17: moved CI tests from Travis to GH actions
  • 2022-12-05: re-enabled clang compiler in test suite
  • 2022-11-23: fresh 2.9 release
  • 2022-09-23: passed the 1000 unit tests threshold (with $ make test -j4 USE_TINYXML2=Y USE_OPENCV=Y)
  • 2022-08-30: added SVG import
  • 2022-08-02: 2.8 release

(see history for more)

Details

  • Install: to install on your machine, copy file homog2d.hpp somewhere where your compiler can reach it, or $ sudo make install after cloning repo. This will copy that file in /usr/local/include.

  • Audience: any C++ dev requiring some basic computational geometry, without the burden of large scale framework.

  • Usage: see full manual

  • Reference: once downloaded, enter $ make doc (requires Doxygen).

  • A test file is provided, needs Catch2. When installed, run $ make test (or $ make testall for testing with all 3 numerical types).

  • Contributing: at present, the best you can do is testing and bug/issue reporting. Don't hesitate, this is still beta but stable release expected soon.

  • Rationale:

    • Usage simplicity, max flexibility
    • No dependency (*)
    • Modern C++, using policy-based design, tag dispatching, sfinae, ...
    • Direct bindings with other libraries (OpenCv, Boost Geometry) (optional)
  • Geometric features:

    • basic primitives: points, lines, segments, circles, rectangles, polygons, ellipse,
    • planar transformation of any of these (rotation, translation, ...),
    • computing of intersection points between these,
    • enclosing determination
    • ...
  • Related libraries:

    • CGAL, the reference computational geometry library.
    • Boost Geometry, a highly generic library with some overlapping features (but quite harder to use)
    • Opencv, the reference CV library, much more algorithms, but no direct support for homogeneous geometry.
    • Wykobi, has much more computational geometry features but no direct support for homogeneous geometry.

Warning: The images shown in the manual are there just there as an illustration of what the library does, but there is no rendering code included. The library provides drawing function whose implementation requires external code. The images are drawn either as Svg files, or using a third-party library (Opencv), but the latter is not needed to use this library.

(*): Except for some additional features, see manual.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].