Git Product home page Git Product logo

r3d's Introduction

r3d

Routines for fast, geometrically robust clipping operations and analytic volume/moment computations over polytopes in 2D and 3D (as well as experimental ND). This software forms the kernel for an exact general remeshing scheme. Also includes physically conservative voxelization (volume sampling) of polytopes to a Cartesian grid in 2D and 3D.

As described in Powell & Abel (2015) and LA-UR-15-26964. For information about the API itself, see LA-UR-15-26964. The now-deprecated version of the code used for Powell & Abel (2015) lives in deprecated.


Features:

  • Robustly clip polytopes against planes.

  • Compute volumes and moments over polytopes using the optimal recursive method of Koehl (2012).

  • Voxelize 2D and 3D polytopes onto a Cartesian grid by calculating the exact coordinate moments of the intersections between the polytope and each underlying grid cell.

  • Utility functions for orientation tests, box initialization, conversion between polyhedral representations, and more.

  • A set of rigorous unit-tests, located in src/tests. These tests also serve as examples of how to use r3d.

  • All declarations and documentation are located in r3d.h, v3d.h, r2d.h, and v2d.h.

  • For computational efficiency, R3D use a statically size array to store vertices of 3D polyhedra. This defaults to 512 but can be expanded or contracted by a CMake command line specification (cmake -DR3D_MAX_VERTS=N ..). This autogenerates a config file r3d-config.h at build time which is included in r3d.h. (Note: This makes it impossible to use a simple Makefile to compile R3D)


Building:

  • Basic build

mkdir build # make a build directory cd build cmake -DENABLE_UNIT_TESTS=ON .. make make test # to test if R3D is working correctly

  • CMake configuration options

    Debug build: cmake -DCMAKE_BUILD_TYPE=Debug .. Release build: cmake -DCMAKE_BUILD_TYPE=Release .. Tests: cmake -DENABLE_UNIT_TESTS=[ON|OFF] .. Installation dir: cmake -DCMAKE_INSTALL_PREFIX=<r3d_install_dir> .. Set R3D_MAX_VERTS: cmake -DR3D_MAX_VERTS=N .. where N can be any number.

  • To link to R3D

    • Using CMake

    R3D's build system now writes out relevant CMake configuration information in <r3d_install_dir>/lib/cmake/r3d/r3dConfig.cmake. It also exports a library target called r3d::r3d which can be specified as a dependency and automatically get the locations of the library, the name of the library (even if it is static or shared), the locations of the include files etc.

    To use this method, call find_package(r3d) in the calling app's CMake build system and specify -Dr3d_ROOT=<r3d_install_dir> in the calling app's CMake command line invocation. Then specify r3d as a dependency like so:

    find_package(r3d) target_link_libraries(MYAPP PRIVATE ${r3d_LIBRARIES})

    CMake will do the rest to find the includes and link in the right libraries.

    • Manually

      #include <r3d.h>, #include <r2d.h>, #include <v3d.h> etc. in your code as you require

      Point the build system to include path of the install directory

      Link to libr3d.a (or libr3d.so) as required (-lr3d)


Licensing:

r3d.c, r3d.h, r2d.c, r2d.h, rNd.c, rNd.h, and contents of tests Copyright (C) 2015, DOE and Los Alamos National Security, LLC.

v3d.c, v3d.h, v2d.c, v2d.h, and contents of deprecated Copyright (C) 2015, Stanford University, through SLAC National Accelerator Laboratory.

See source file headers for full license text. All code is open-source, subject to terms of the respective license. We request that you cite Powell & Abel (2015) and LA-UR-15-26964 when using this code for research purposes.

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.