-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry exported="true" kind="lib" path="lib/guava-12.0.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
*.png |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>delaunay</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#Thu May 31 15:48:35 GST 2012 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.5 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright 2012 Bill Dwyer | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
delaunay | ||
======== | ||
|
||
Delaunay Triangulation for Java with Hilbert Curve linearization and a Delaunay Tesselation Field Estimator (DTFE) | ||
|
||
### Four line demo ### | ||
```Java | ||
public static void fourLiner() throws Exception { | ||
Triangulation t = new Triangulation(); | ||
t.addAllVertices(Triangulations.randomVertices(1000, 400, 400)); | ||
t.triangulate(); | ||
Demo.drawTriangulation(t, 400, 400, "triangulation.png"); | ||
} | ||
``` | ||
|
||
### Delaunay Triangulation ### | ||
The `Triangulation` class creates a Delaunay Triangulation of the Vertexs. (http://en.wikipedia.org/wiki/Delaunay_triangulation) | ||
|
||
This implementation uses a simple iterative approach, but with some pre-processing | ||
to make the real-world performance fast. | ||
|
||
1. For each vertex, we walk to the enclosing triangle. | ||
2. We create a cavity from that triangle and all neighboring triangles for which the vertex is | ||
in its circumcircle. | ||
3. We create new triangles between the edges of the cavity and the | ||
vertex. | ||
|
||
The basic incremental triangulation method inspired by Paul Bourke's notes | ||
and psuedocode. See: (http://paulbourke.net/papers/triangulate/). | ||
|
||
### Performance Characteristics ### | ||
Prior to triangulation, the vertices are sorted using a Hilbert Space-Filling curve (http://en.wikipedia.org/wiki/Hilbert_curve). Since | ||
our locate method walks the triangulation, linearizing the points with a | ||
space-filling curve gives us some pretty good locality when adding each | ||
vertex, thus greatly reducing the number of hops required to locate the | ||
vertex. The sort is O(n log n), but is fast since hilbert indices are | ||
computed in O(h) (where h is a small constant), and results in a | ||
triangulation asymptotic running time of O(n) for non-diabolical cases. | ||
|
||
### Delaunay Tessellation Field Estimator ### | ||
The `DtfeTriangulationMap` class performs the **Delaunay Tessellation Field Estimator** (DTFE) (http://en.wikipedia.org/wiki/Delaunay_tessellation_field_estimator) in two dimensions, which enables the reconstruction of the continuous density field from a set of points. | ||
|
||
The DTFE is simple to understand: | ||
|
||
1. Construct a triangulation of the points. | ||
2. For each vertex, compute its density with the formula: density = point_mass / sum_of_area_of_neighboring_triangles | ||
3. To reconstruct the continuous field, interpolate the density using the vertex densities. | ||
|
||
There are several methods for interpolation, which are included in the `InterpolationStrategies` class. | ||
|
||
For more info and **PICTURES!** check out this wiki page: | ||
(https://github.com/themadcreator/delaunay/wiki/DTFE-Interpolation-Strategies) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project default="build-cleanup" name="Create distributable jar"> | ||
<!-- build input --> | ||
<property name="main.class" value="org.delaunay.Demo" /> | ||
<property name="src.dir" value="${basedir}/src" /> | ||
<property name="lib.dir" value="${basedir}/lib" /> | ||
|
||
<!-- build output --> | ||
<property name="dist.dir" value="${basedir}/dist" /> | ||
<property name="build.dir" value="${basedir}/build" /> | ||
|
||
<target name="clean"> | ||
<delete dir="${dist.dir}" failonerror="false" /> | ||
<delete dir="${build.dir}" failonerror="false" /> | ||
</target> | ||
|
||
<target name="compile" depends="clean"> | ||
<mkdir dir="${build.dir}" /> | ||
<javac destdir="${build.dir}"> | ||
<src path="${src.dir}" /> | ||
<classpath> | ||
<fileset dir="${lib.dir}" includes="**/*.jar" /> | ||
</classpath> | ||
</javac> | ||
</target> | ||
|
||
<target name="unjar_deps" depends="compile"> | ||
<unzip dest="${build.dir}"> | ||
<fileset dir="${lib.dir}"> | ||
<include name="**/*.jar" /> | ||
</fileset> | ||
</unzip> | ||
</target> | ||
|
||
<target name="copy_deps" depends="compile"> | ||
<mkdir dir="${dist.dir}" /> | ||
<copy todir="${dist.dir}"> | ||
<fileset dir="${lib.dir}"> | ||
<include name="**/*.jar" /> | ||
</fileset> | ||
</copy> | ||
</target> | ||
|
||
<target name="build" depends="compile,copy_deps"> | ||
<mkdir dir="${dist.dir}" /> | ||
<jar destfile="${dist.dir}/delaunay.jar" duplicate="preserve"> | ||
<manifest> | ||
<attribute name="Main-Class" value="${main.class}" /> | ||
<attribute name="Class-Path" value="." /> | ||
</manifest> | ||
<fileset dir="${build.dir}" /> | ||
<fileset dir="${src.dir}" includes="**/*.java"/> | ||
</jar> | ||
</target> | ||
|
||
<target name="build-cleanup" depends="build"> | ||
<delete dir="${build.dir}" failonerror="false" /> | ||
</target> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="EclipseModuleManager"> | ||
<libelement value="jar://$MODULE_DIR$/lib/guava-12.0.jar!/" /> | ||
<src_description expected_position="0"> | ||
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" /> | ||
</src_description> | ||
</component> | ||
<component name="NewModuleRootManager"> | ||
<output url="file://$MODULE_DIR$/bin" /> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="module-library" exported=""> | ||
<library name="guava-12.0.jar"> | ||
<CLASSES> | ||
<root url="jar://$MODULE_DIR$/lib/guava-12.0.jar!/" /> | ||
</CLASSES> | ||
<JAVADOC /> | ||
<SOURCES /> | ||
</library> | ||
</orderEntry> | ||
</component> | ||
</module> |