Giter Club home page Giter Club logo

simple3dgeom's Introduction

simple3dgeom

A minimalistic C++ templated library for 3D geometry with zero dependencies. Supports pre-C++0x.

Caveats

Note that due to the zero-dependency requirement, there are no 'unit tests' per se. However, you can compile and run simpletests.cpp instead as it tests basic functionality.

Also, the library doesn't differentiate between a 'point' and a 'vector', because template aliases require a newer C++ standard. Therefore, it is the programmer's duty to understand (and take care of) any difference between affine and vector space.

Usage

To use the library, simply include simple3dgeom.h in your file. There is an additional file, simple3dgeom.tpp that implements most of the real functionality, so that the header file is easier to navigate and read. You also need that file present in the same directory as simple3dgeom.h to use the library.

Precision

There is support for specifying 'precision' through a template argument. This is used when comparing points.

There are two classes included for comparators - TrivialNumberComparator (which does the default type comparison) and DefaultNumberComparator, which takes an integer template parameter for the exponent of the precision (that is to which exponent one must take 10, so that it is "equal" to zero).
Note
The DefaultNumberComparator is suboptimal in performance, as it relies on the pow() function to perform comparisons.
This is due to limitations in C++ templates that disallow floating-point arithmetics at compile-time.
If possible, use your own implementation for fixed values of the exponent.

Template arguments

The library supports arbitrary types that implement the required operations, in particular any type that implements "Field" operations (+,-,* and / for non-zero elements) should work. Therefore any arbitrary precision type should work out of the box as a template argument.

Scope

The library is very small in scope and only implements the linear space structure of the 3D space and 3D rotations.

Note
That this library was written awhile back and I haven't really used it since.

Contributing

If you have found a bug, please report it here in Github, or (even better) fix it and make a pull request. Pull requests with edits that don't require newer C++ standard or new dependencies and don't significantly increase the scope of the library are very, very welcome!

If requested, I will add any contributor to the README.

simple3dgeom's People

Contributors

ensec4git avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.