GithubHelp home page GithubHelp logo

derschmale / tympanum Goto Github PK

View Code? Open in Web Editor NEW
31.0 31.0 2.0 396 KB

A Typescript library for multidimensional convex hulling and Delaunay triangulations.

Home Page: https://derschmale.github.io/tympanum/

License: MIT License

JavaScript 67.05% TypeScript 32.95%
convex-hull delaunay delaunay-triangulation geometry math triangle typescript-library

tympanum's Issues

The sum of Infinity and -Infinity causes NaN

In the dot function, it sums up the multiplication of two numbers. But if the two resulting numbers are Infinity and -Infinity, it results in NaN value for d variable.

Then, it causes hyperplaneFromPoints function to return a vector with NaN values. Then, in the getOptimalStart function, it pushes undefined via planePts.push(points[p]); since the p still equals to -1.

Finally, it causes an error: tympanum.module.js:161 Uncaught TypeError: Cannot read properties of undefined (reading '0')

        for (var j = 0; j < dim; ++j)
            v[j] = v0[j] - pt[j];

This is a part of the code in Miniverse.

function rebuildDelaunay() {
  probePositions = [];

  // Assure some size vertically
  const min = vec3.fromValues(Infinity, -30, Infinity);
  const max = vec3.fromValues(-Infinity, 30, -Infinity);

  irradianceProbes.forEach((probe, i) => {
    vec3.min(min, min, probe.position);
    vec3.max(max, max, probe.position);
    probePositions[i] = probe.position;
  });

Not sure what the underlying cause because I don't know understand the implementation details. It might be a bug in the software or a misusage. It'd be great @DerSchmale if you could have a look.

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.