Skip to content

Commit

Permalink
cleanup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkelly committed Jul 5, 2024
1 parent 3c55752 commit 8831634
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 36 deletions.
39 changes: 3 additions & 36 deletions src/algorithmtypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
Abstract type to specify an algorithm for isosurface extraction.
See:
- MarchingCubes
- MarchingTetrahedra
- NaiveSurfaceNets
- [MarchingCubes](@ref)
- [MarchingTetrahedra](@ref)
"""
abstract type AbstractMeshingAlgorithm end

abstract type AbstractAdaptiveMeshingAlgorithm end


"""
MarchingCubes(;iso=0.0)
Expand All @@ -31,8 +28,7 @@ end
MarchingTetrahedra(;iso=0.0, eps=1e-3)
Specifies the use of the Marching Tetrahedra algorithm for isosurface extraction.
This algorithm has a roughly 2x performance penalty compared to Marching Cubes,
and generates more faces. However, each vertex is guaranteed to not be repeated,
This algorithm generates more faces. However, each vertex is guaranteed to not be repeated,
making this algorithm useful for topological analysis.
- `iso` specifies the iso level to use for surface extraction.
Expand All @@ -43,32 +39,3 @@ Base.@kwdef struct MarchingTetrahedra{T,E} <: AbstractMeshingAlgorithm
eps::E = 1e-3
end

"""
MarchingCubes(iso=0.0, eps=1e-3)
MarchingCubes(;iso=0.0, eps=1e-3)
MarchingCubes(iso)
MarchingCubes(iso,eps)
Specifies the use of the Marching Cubes algorithm for isosurface extraction.
This algorithm provides a good balance between performance and vertex count.
In contrast to the other algorithms, vertices may be repeated, so mesh size
may be large and it will be difficult to extract topological/connectivity information.
- `iso` (default: 0.0) specifies the iso level to use for surface extraction.
- `eps` (default: 1e-3) is the tolerence around a voxel corner to ensure manifold mesh generation.
- `reduceverts` (default: true) if true will merge vertices within a voxel to reduce mesh size by around 30% and with slight performance improvement.
"""
struct AdaptiveMarchingCubes{T,E} <: AbstractAdaptiveMeshingAlgorithm
iso::T
eps::T
rtol::T
atol::T
end


struct AdaptiveMarchingTetrahedra{T} <: AbstractAdaptiveMeshingAlgorithm
iso::T
eps::T
rtol::T
atol::T
end
21 changes: 21 additions & 0 deletions src/marching_cubes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
#Look up Table
include("lut/mc.jl")

#=
Voxel corner and edge indexing conventions
Z
|
5------8------8
/| /|
5 | 7 |
/ 9 / 12
6------6------7 |
| | | |
| 1------4--|---4 -- Y
10 / 11 /
| 1 | 3
|/ |/
2------2------3
/
X
=#

function isosurface(sdf::AbstractArray{T,3}, method::MarchingCubes, X=-1:1, Y=-1:1, Z=-1:1) where {T}
nx, ny, nz = size(sdf)
Expand Down

0 comments on commit 8831634

Please sign in to comment.