Skip to content

Commit 481691a

Browse files
committed
Py: Refactor
1 parent 6105a26 commit 481691a

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

pysplashsurf/pysplashsurf/pysplashsurf.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,12 @@ def laplacian_smoothing_parallel(mesh:typing.Union[TriMesh3d, MeshWithData], ver
336336

337337
def marching_cubes_cleanup(mesh:typing.Union[TriMesh3d, MeshWithData], grid:UniformGrid, *, max_rel_snap_dist:typing.Optional[builtins.float]=None, max_iter:builtins.int=5, keep_vertices:builtins.bool=False) -> typing.Union[TriMesh3d, MeshWithData]:
338338
r"""
339-
Performs simplification on the given mesh designed for marching cubes reconstructions inspired by the "Compact Contouring"/"Mesh displacement" approach by Doug Moore and Joe Warren
339+
Performs simplification on the given mesh inspired by the "Compact Contouring"/"Mesh displacement" approach by Doug Moore and Joe Warren
340340
341341
The simplification is performed inplace and modifies the given mesh.
342+
The method is designed specifically for meshes generated by Marching Cubes.
343+
See Moore and Warren: `Mesh Displacement: An Improved Contouring Method for Trivariate Data <https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.49.5214&rep=rep1&type=pdf>`_ (1991)
344+
or Moore and Warren: "Compact Isocontours from Sampled Data" in "Graphics Gems III" (1992).
342345
"""
343346

344347
def neighborhood_search_spatial_hashing_parallel(particle_positions:numpy.typing.NDArray[typing.Any], domain:Aabb3d, search_radius:builtins.float) -> NeighborhoodLists:

pysplashsurf/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod uniform_grid;
1818
mod marching_cubes;
1919
mod neighborhood_search;
2020
mod pipeline;
21-
mod post_processing;
21+
mod postprocessing;
2222
mod reconstruction;
2323

2424
pub(crate) mod utils;
@@ -44,12 +44,12 @@ fn pysplashsurf(m: &Bound<'_, PyModule>) -> PyResult<()> {
4444

4545
m.add_function(wrap!(reconstruction::reconstruct_surface, m)?)?;
4646
m.add_function(wrap!(marching_cubes::check_mesh_consistency, m)?)?;
47-
m.add_function(wrap!(post_processing::marching_cubes_cleanup, m)?)?;
48-
m.add_function(wrap!(post_processing::convert_tris_to_quads, m)?)?;
49-
m.add_function(wrap!(post_processing::barnacle_decimation, m)?)?;
50-
m.add_function(wrap!(post_processing::laplacian_smoothing_parallel, m)?)?;
47+
m.add_function(wrap!(postprocessing::marching_cubes_cleanup, m)?)?;
48+
m.add_function(wrap!(postprocessing::convert_tris_to_quads, m)?)?;
49+
m.add_function(wrap!(postprocessing::barnacle_decimation, m)?)?;
50+
m.add_function(wrap!(postprocessing::laplacian_smoothing_parallel, m)?)?;
5151
m.add_function(wrap!(
52-
post_processing::laplacian_smoothing_normals_parallel,
52+
postprocessing::laplacian_smoothing_normals_parallel,
5353
m
5454
)?)?;
5555

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,12 @@ pub fn barnacle_decimation<'py>(
197197
}
198198
}
199199

200-
/// Performs simplification on the given mesh designed for marching cubes reconstructions inspired by the "Compact Contouring"/"Mesh displacement" approach by Doug Moore and Joe Warren
200+
/// Performs simplification on the given mesh inspired by the "Compact Contouring"/"Mesh displacement" approach by Doug Moore and Joe Warren
201201
///
202202
/// The simplification is performed inplace and modifies the given mesh.
203+
/// The method is designed specifically for meshes generated by Marching Cubes.
204+
/// See Moore and Warren: `Mesh Displacement: An Improved Contouring Method for Trivariate Data <https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.49.5214&rep=rep1&type=pdf>`_ (1991)
205+
/// or Moore and Warren: "Compact Isocontours from Sampled Data" in "Graphics Gems III" (1992).
203206
#[gen_stub_pyfunction]
204207
#[pyfunction]
205208
#[pyo3(name = "marching_cubes_cleanup")]

0 commit comments

Comments
 (0)