Comments (5)
For all points I can see .. I have refactored the comparison of floats
https://github.com/martinfrances107/d3-delaunay/tree/Make_compare_of_floats_safe
It does not pass tests... yet.
from d3-delaunay.
Are we comparing values that can be created by different paths (like a *b versus b * a), or are they created by the same path. If this is the second case, I don't see that we would have an issue?
from d3-delaunay.
"created by different paths"... I am not sure I understand what you mean
So I am just going to describe a scenario and you can tell me if it meets your thinking..
So I am thinking of user code making use of our library code.
In this scenario the user algorithms, are subject to numerical computation errors but always, in this event, result in a clipping bounds of a unit square.
clipping bound (A) xmin = 0, xmax = 1, ymin = 0, ymax = 1
because of numerical inaccuracies the user code on successive requestAnimationFrame events feed in the following identical clipping bounds into out library code.
so (A) = (B) = (C)
B) xmin=-0.000000001, xmax=0.999999999, ymin = 0.000000001, ymax = 0.9999999
C) xmin= +0.000000001, xmax=+1.00000001, ymin =+0.000000001, ymax = 1.000001
Looking at our edgecode() function - different codes are going to be return and visually I think you may see some jitter as the generated polygons incorrectly change over time.
return (x === this.xmin ? 0b0001 : x === this.xmax ? 0b0010 : 0b0000) | (y === this.ymin ? 0b0100 : y === this.ymax ? 0b1000 : 0b0000);
return (Math.abs(x - this.xmin) < epsilon ? 0b0001 : Math.abs(x - this.xmax) < epsilon ? 0b0010 : 0b0000) | (Math.abs(y - this.ymin) < epsilon ? 0b0100 : Math.abs(y - this.ymax) < epsilon ? 0b1000 : 0b0000);
from d3-delaunay.
I'm sorry I don't understand the problem you are trying to solve. Is there a specific array of point coordinates where the current code fails?
The two first tests you propose to change are here to avoid duplicated points: #83 and #88
The edgecode compares S —the result of _clipSegment which returns one of this.xmin, this.ymin this.xmax, this.ymax— with this.xmin &c. So it sounds fair to compare with strict equality?
from d3-delaunay.
closing due to inactivity; please don't hesitate to comment if this is still an issue
from d3-delaunay.
Related Issues (20)
- Generating higher-order Voronoi diagrams HOT 1
- Adding points incrementally without retriangulating HOT 3
- voronoi.cellPolygons skips null cells, and doesn’t report the cell’s index. HOT 3
- README misleading with "no-dependency library" line HOT 2
- Error with es6 worker + es6 modules HOT 18
- Would it be possible to make this work with a convex hull boundary for the Voronoi cells? HOT 2
- Delaunay points are a list of NaN HOT 1
- voronoi tiling goes a bit crazy when points are duplicated in the input HOT 1
- Broken voronoi HOT 3
- Update rollup and rollup-plugin-terser HOT 2
- Cosmetic Index out of bound check fix. HOT 1
- Minor change: Only compute bl and cl when needed. HOT 1
- renderPoints(5) crashes
- context.moveTo and context.lineTo implementation HOT 1
- Voronoi Polygon generator HOT 1
- convenience delaunay.edges() function?
- voronoi don't cover the rectangle? HOT 7
- Edges that both sides are clipped sometimes will not be identified as voronoi neighbor HOT 2
- Odd failure HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-delaunay.