Skip to content

Commit 5212972

Browse files
committed
update README
1 parent 1218c40 commit 5212972

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,52 @@ This package provides meshing algorithms for use on distance fields.
88
Including:
99
* [Marching Tetrahedra](https://en.wikipedia.org/wiki/Marching_tetrahedra)
1010
* [Marching Cubes](https://en.wikipedia.org/wiki/Marching_cubes)
11+
* [Naive Surface Nets](https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/)
12+
13+
## Interface
14+
15+
This package is tightly integrated with [GeometryTypes.jl](https://github.com/JuliaGeometry/GeometryTypes.jl).
16+
17+
All algorithms operate on `SignedDistanceField` and output a concrete `AbstractMesh`. For example:
18+
19+
```
20+
using Meshing
21+
using GeometryTypes
22+
using LinearAlgebra: dot, norm
23+
using FileIO
24+
25+
# generate an SDF of a sphere
26+
sdf_sphere = SignedDistanceField(HyperRectangle(Vec(-1,-1,-1.),Vec(2,2,2.))) do v
27+
sqrt(sum(dot(v,v))) - 1 # sphere
28+
end
29+
30+
m = GLNormalMesh(sdf_sphere, MarchingCubes())
31+
32+
save("sphere.ply",m)
33+
```
34+
35+
The general API is ``(::Type{MT})(sdf::SignedDistanceField, method::AbstractMeshingAlgorithm) where {MT <: AbstractMesh}``
36+
37+
For a full listing of concrete `AbstractMesh` types see [GeometryTypes.jl mesh documentation](http://juliageometry.github.io/GeometryTypes.jl/latest/types.html#Meshes-1).
38+
39+
### Meshing Algorithms
40+
41+
Three meshing algorithms exist:
42+
* `MarchingCubes()`
43+
* `MarchingTetrahedra()``
44+
* `NaiveSurfaceNets()`
45+
46+
Each takes an optional `iso` and `eps` parameter, e.g. `MarchingCubes(0.0,1e-6)`.
47+
48+
Here `iso` controls the offset for the boundary detection. By default this is set to 0. `eps` is the detection tolerance for a voxel edge intersection.
49+
50+
Below is a comparison of the algorithms:
51+
52+
| Algorithm | Accurate | Manifold | Performance Penalty | Face Type |
53+
|--------------------|----------|----------|---------------------|-----------|
54+
| MarchingCubes | Yes | No | ~4x | Triangle |
55+
| MarchingTetrahedra | Yes | Yes | ~12x | Triangle |
56+
| NaiveSurfaceNets | No | No | 1x | Quad |
1157

1258
## Credits
1359

0 commit comments

Comments
 (0)