Git Product home page Git Product logo

libigl-predicates's Introduction

libigl-predicates's People

Contributors

jdumas avatar keithballard avatar qnzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libigl-predicates's Issues

avoid calling exactinit

Hi,

in case you are interested, I managed to statically define the error bounds used by the Shewchuk predicates using standard C defines, so that it is no longer necessary to compute the machine epsilon in the way exactinit() does. It's not a big deal, but allows people to directly use the exact version of the predicates without having to call exactinit at the beginning of the program. The initialization is as follows:

#include <float.h>
#define SHEWCHUK_EPSILON DBL_EPSILON/2;

const REAL resulterrbound = ( 3.0 + 8.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL ccwerrboundA = ( 3.0 + 16.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL ccwerrboundB = ( 2.0 + 12.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL ccwerrboundC = ( 9.0 + 64.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON * SHEWCHUK_EPSILON;

const REAL o3derrboundA = ( 7.0 + 56.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL o3derrboundB = ( 3.0 + 28.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL o3derrboundC = (26.0 + 288.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON * SHEWCHUK_EPSILON;

const REAL iccerrboundA = (10.0 + 96.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL iccerrboundB = ( 4.0 + 48.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL iccerrboundC = (44.0 + 576.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON * SHEWCHUK_EPSILON;

const REAL isperrboundA = (16.0 + 224.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL isperrboundB = ( 5.0 + 72.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON;
const REAL isperrboundC = (71.0 + 1408.0 * SHEWCHUK_EPSILON) * SHEWCHUK_EPSILON * SHEWCHUK_EPSILON;

const REAL splitter = (1 << (DBL_MANT_DIG/2+1)) + 1.0;

Here is the full C file containing the (modified) Shewchuk predicates

cheers,
cino

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.