Comments (5)
In a related development, I noticed that the getArea() method for the SimpleTriangle class (see Triangle Collector Techniques ) was computing a small-magnitude negative area for triangle 5,8,0. This glitch violates the rule that all triangles produced by Tinfour are oriented counterclockwise and have a positive area.
This unfortunate result was due to numeric round-off issues arising from the nearly-degenerate geometry of the triangle. However, when I used the extended-precision logic from the GeometricOperations class, I confirmed that the triangle was, in fact, constructed correctly and did have a positive area.
I am looking at the best way to incorporate extended-precision logic into the SimpleTriangle class. The extended-precision logic is slower than simple floating-point operations but does produce more accurate results.
This change will be integrated into the upcoming 2.1.5 release of Tinfour. Once it is addressed, I will be closing this issue.
from tinfour.
A code change for the Natural Neighbor Interpolator class has been posted to the Tinfour code base. This change corrects the behavior of the interpolator. This issue may now be closed.
from tinfour.
I have updated the area calculation for the SimpleTriangle class (now not quite so simple as it was).
Previously, triangle 5,8,0 was computed to have an area of -1.818989e-12. While the formula in the code was correct, numerical issues resulted in the incorrect value. The current version uses extended-precision arithmetic to find an area of 1.752672e-13
As you can see, the new computation produces a more reasonable value and confirms that the triangle has a positive area. Of course, it is possible that if vertex 5 were moved arbitrarily close to line segment 0,8 it could result in a calculation that exceeded the limits of the extended-precision. Computational geometry is notorious for numerical issues. Currently, Tinfour does include logic to tweak the coordinates of a vertex if it gets too close to a line segment and to insert it into the line rather than building a triangle. In this case, vertex 5 wasn't quite close enough to trigger the adjustment. While this situation did not affect the integrity of the TIN, it did challenge the ordinary-precision area computation.
Jonathan Shewchuk has published algorithms and C-language code for various triangle-geometry computations that work under all conditions. Mr. Shewchuk is pretty much the leading authority on Delaunay Triangulations, an excellent writer, and a pretty fair coder. If you are interested in the Delaunay, his work is well worth considering.
from tinfour.
The code changes for this issue are now complete.
I would like to thank Michael Kemper for identifying this problem and providing such an excellent set of test data. Those 9 vertices in his sample set exercise the Tinfour logic with admirable thoroughness.
from tinfour.
This issue in now fully addressed. Fixes are included in the 2.1.5 release which was issued 10 Jan 2021.
from tinfour.
Related Issues (20)
- Need enhancement to handle defective polygon constraints HOT 6
- Implement coloring algorithm for planar graph HOT 5
- Expose SimpleTriangle Circumcircle HOT 4
- Implement/Fix QuadEdgePartner hashCode() HOT 4
- Some edges from getNeighborEdge() are not in Tin? HOT 4
- ContourBuilderForTin doesn't like coordinates of zero HOT 10
- TriangleCollector.visitTrianglesConstrained() visits triangles twice HOT 5
- Should `.visitTrianglesConstrained()` generate triangles for TINs with no constraints? HOT 2
- Java Heap Space, unlimited loop in Tinfour
- Performance Discrepancy HOT 6
- Some pinwheel edges' B vertex are null HOT 4
- Can't open recent LAZ files HOT 10
- TinfourDemo finds no ground points even they are there HOT 4
- TinfourDemo rendering is upscaled for `-Dsun.java2d.uiScale=2` HOT 4
- Provide more access to internals for Natural Neighbor Interpolator HOT 1
- Question how to use idw in combination with Bounded Voronoi
- Error in shapefile writing for SVM operations HOT 1
- Shapefile reader can fail on empty records HOT 1
- Error reading UTF-8 strings from shapefile HOT 1
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 tinfour.