TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25044 18
Libraries for general purpose 2D/3D geometry vocabulary types?

I work in the geospatial industry and have worked on plenty of large projects that have their own internal geometry libraries. Some good, some bad, most with interesting historical choices. I recently joined a new project that hasn't yet really defined its vocabulary types yet, and I'm finding that extremely inconvenient, so I'm looking around at what is common

The kinds of things I'm looking for are:

`Vector<typename T, size_t Dimension>`: Basically a `std::array<T,Dimension>` with a vector-like API
Point: A wrapper around a Vector with point semantics
`Size`: A wrapper around a `Vector` with size semantics
Range: A basic min/max interval
`AxisAlignedBox`: A set of `Range`s in N dimensions
RotatedBox: A AxisAlignedBox with a basis Vector
`Polyline`: A `std::vector<Point>` assumed to be open
Polygon: A std::vector<Point> assumed to be closed
`Matrix`: An NxM matrix
...

I know there are plenty of vector/matrix/linear algebra libraries out there, often focused on flexibilty and raw computational performance. I'm more interested in nice vocabulary types that implement proper semantics via convenient methods and operators.

It seems these things are often provided by game engines, but pulling in an entire game engine for a non-gaming project feels silly.

So if you were starting a new, greenfield C++ application dealing with 3D geometric data, which existing library, if any, would you reach for?



https://redd.it/1stif6d
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 4, 2026Comparing exception behavior of magic statics, std::call_once, and std::async https://devb…
  2. Oct 4, 2026The complement of true is true, except when it's false https://dryperspective.github.io/po…
  3. Oct 4, 2026Grooves in Software - Andreas Wagner - [https://youtu.be/8XtZi4HTrcA](https://youtu.be/8Xt…
  4. Oct 4, 2026New C++ Conference Videos Released This Month - September 2026 (Updated To Include Videos…
  5. Oct 4, 2026Żmij 1.2 "the proof is in the printf" released with full to_chars implementation, formal v…
  6. Oct 4, 2026Why we should standardise on CPS To enable any collaboration in the industry, some "social…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →