You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pysplashsurf/src/marching_cubes.rs
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,25 @@ use crate::uniform_grid::PyUniformGrid;
11
11
usecrate::utils;
12
12
usecrate::utils::IndexT;
13
13
14
-
/// Checks the consistency of a reconstructed surface mesh (watertightness, manifoldness), optionally returns a string with details if problems are found
14
+
/// Checks the consistency of a reconstructed surface mesh (watertightness, manifoldness), optionally returns a string with details, if problems are found
15
+
///
16
+
/// Parameters
17
+
/// ----------
18
+
/// mesh
19
+
/// The triangle mesh to check for consistency.
20
+
/// grid
21
+
/// The uniform grid that was used for the marching cubes triangulation of the input mesh.
22
+
/// check_closed
23
+
/// Flag to enable checking if the mesh is closed (watertight).
24
+
/// check_manifold
25
+
/// Flag to enable checking if the mesh is manifold (i.e. has no non-manifold vertices & edges).
26
+
/// debug
27
+
/// Flag to enable additional debug output during the consistency checks.
28
+
///
29
+
/// Returns
30
+
/// -------
31
+
/// An optional string with details about the problems found during the consistency checks.
Copy file name to clipboardExpand all lines: pysplashsurf/src/pipeline.rs
+39-43Lines changed: 39 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -27,85 +27,81 @@ use crate::utils::{IndexT, pyerr_unsupported_scalar};
27
27
/// Parameters
28
28
/// ----------
29
29
/// particles : numpy.ndarray
30
-
/// A two-dimensional numpy array of shape (N, 3) containing the positions of the particles.
30
+
/// A two-dimensional numpy array of shape (N, 3) containing the positions of the particles.
31
31
/// attributes_to_interpolate
32
-
/// Dictionary containing all attributes to interpolate. The keys are the attribute names and the values are the corresponding 1D/2D arrays.\n
33
-
/// The arrays must have the same length as the number of particles. \n
34
-
/// Supported array types are 2D float32/float64 arrays for vector attributes and 1D uint64/float32/float64 arrays for scalar attributes.
32
+
/// Dictionary containing all attributes to interpolate. The keys are the attribute names and the values are the corresponding 1D/2D arrays.
33
+
/// The arrays must have the same length as the number of particles.
34
+
/// Supported array types are 2D float32/float64 arrays for vector attributes and 1D uint64/float32/float64 arrays for scalar attributes.
35
35
/// particle_radius
36
-
/// Particle radius
36
+
/// Particle radius.
37
37
/// rest_density
38
-
/// Rest density of the fluid
38
+
/// Rest density of the fluid.
39
39
/// smoothing_length
40
-
/// Smoothing length of the fluid in multiples of the particle radius (compact support radius of SPH kernel will be twice the smoothing length)
40
+
/// Smoothing length of the SPH kernel in multiples of the particle radius (compact support radius of SPH kernel will be twice the smoothing length).
41
41
/// cube_size
42
-
/// Size of the cubes used for the marching cubes grid in multiples of the particle radius
42
+
/// Size of the cubes (voxels) used for the marching cubes grid in multiples of the particle radius.
43
43
/// iso_surface_threshold
44
-
/// Threshold for the iso surface
44
+
/// Threshold of the SPH interpolation of the "color field" where the iso surface should be extracted.
45
45
/// aabb_min
46
-
/// Lower corner of the AABB of particles to consider in the reconstruction
46
+
/// Lower corner [x,y,z] of the AABB of particles that are active in the reconstruction.
47
47
/// aabb_max
48
-
/// Upper corner of the AABB of particles to consider in the reconstruction
48
+
/// Upper corner [x,y,z] of the AABB of particles to consider in the reconstruction.
49
49
/// multi_threading
50
-
/// Multi-threading
50
+
/// Flag to enable multi-threading for the reconstruction and post-processing steps.
51
51
/// subdomain_grid
52
-
/// Enable spatial decomposition using by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading
52
+
/// Flag to enable spatial decomposition by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading.
53
53
/// subdomain_grid_auto_disable
54
-
/// Whether to automatically disable the subdomain grid if the global domain is too small
54
+
/// Flag to automatically disable the subdomain grid if the global domain is too small.
55
55
/// subdomain_num_cubes_per_dim
56
-
/// Each subdomain will be a cube consisting of this number of MC cube cells along each coordinate axis
56
+
/// Number of marching cubes voxels along each coordinate axis in each subdomain if the subdomain grid is enabled.
57
57
/// check_mesh_closed
58
-
/// Enable checking the final mesh for holes
58
+
/// Flag to enable checking the final mesh for holes.
59
59
/// check_mesh_manifold
60
-
/// Enable checking the final mesh for non-manifold edges and vertices
60
+
/// Flag to enable checking the final mesh for non-manifold edges and vertices.
61
61
/// check_mesh_orientation
62
-
/// Enable checking the final mesh for inverted triangles (compares angle between vertex normals and adjacent face normals)
62
+
/// Flag to enable checking the final mesh for inverted triangles (compares angle between vertex normals and adjacent face normals).
63
63
/// check_mesh_debug
64
-
/// Enable additional debug output for the check-mesh operations (has no effect if no other check-mesh option is enabled)
64
+
/// Flag to enable additional debug output for the check-mesh operations (has no effect if no other check-mesh option is enabled).
65
65
/// mesh_cleanup
66
-
/// Flag to perform mesh cleanup\n
67
-
/// This implements the method from “Compact isocontours from sampled data” (Moore, Warren; 1992)
66
+
/// Flag to enable marching cubes mesh cleanup. This implements the method from "Compact isocontours from sampled data" (Moore, Warren; 1992).
68
67
/// mesh_cleanup_snap_dist
69
-
/// If MC mesh cleanup is enabled, vertex snapping can be limited to this distance relative to the MC edge length (should be in range of [0.0,0.5])
68
+
/// If marching cubes mesh cleanup is enabled, this limits vertex snapping to the specified distance relative to the MC edge length (should be in range of [0.0,0.5]).
70
69
/// decimate_barnacles
71
-
/// Flag to perform barnacle decimation\n
72
-
/// For details see “Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids” (Löschner, Böttcher, Jeske, Bender; 2023).
70
+
/// Flag to perform barnacle decimation. For details see "Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids" (Löschner, Böttcher, Jeske, Bender; 2023).
73
71
/// keep_vertices
74
-
/// Flag to keep any vertices without connectivity resulting from mesh cleanup or decimation step
72
+
/// Flag to retain any vertices without connectivity resulting from mesh cleanup or decimation step instead of filtering them out.
75
73
/// compute_normals
76
-
/// Flag to compute normals\n
77
-
/// If set to True, the normals will be computed and stored in the mesh.
74
+
/// Flag to enable computation of vertex normals on the final mesh.
78
75
/// sph_normals
79
-
/// Flag to compute normals using SPH interpolation instead of geometry-based normals.
76
+
/// Flag to enable computation of normals using SPH interpolation (gradient of the color field) instead of geometry-based normals.
80
77
/// normals_smoothing_iters
81
-
/// Number of Laplacian smoothing iterations for the normal field
78
+
/// Number of Laplacian smoothing iterations to perform on the normal field.
82
79
/// mesh_smoothing_iters
83
-
/// Number of Laplacian smoothing iterations for the mesh
80
+
/// Number of Laplacian smoothing iterations to perform on the mesh vertices.
84
81
/// mesh_smoothing_weights
85
-
/// Flag to compute mesh smoothing weights\n
86
-
/// This implements the method from “Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids” (Löschner, Böttcher, Jeske, Bender; 2023).
82
+
/// Flag to enable computation and usage of mesh smoothing weights according to "Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids" (Löschner, Böttcher, Jeske, Bender; 2023).
87
83
/// mesh_smoothing_weights_normalization
88
-
/// Normalization value for the mesh smoothing weights
84
+
/// Normalization value for the mesh smoothing weights.
89
85
/// generate_quads
90
-
/// Enable trying to convert triangles to quads if they meet quality criteria
86
+
/// Flag to enable conversion of triangles to quads depending on geometric criteria.
91
87
/// quad_max_edge_diag_ratio
92
-
/// Maximum allowed ratio of quad edge lengths to its diagonals to merge two triangles to a quad (inverse is used for minimum)
88
+
/// Maximum allowed ratio of quad edge lengths to its diagonals to merge two triangles to a quad (inverse is used for minimum).
93
89
/// quad_max_normal_angle
94
-
/// Maximum allowed angle (in degrees) between triangle normals to merge them to a quad
90
+
/// Maximum allowed angle (in degrees) between triangle normals to merge them to a quad.
95
91
/// quad_max_interior_angle
96
-
/// Maximum allowed vertex interior angle (in degrees) inside a quad to merge two triangles to a quad
92
+
/// Maximum allowed vertex interior angle (in degrees) inside a quad to merge two triangles to a quad.
97
93
/// output_mesh_smoothing_weights
98
-
/// Flag to store the mesh smoothing weights if smoothing weights are computed.
94
+
/// Flag to attach and return the smoothing weights as a mesh attribute if smoothing weights are computed.
99
95
/// output_raw_normals
100
-
/// Flag to output the raw normals in addition to smoothed normals if smoothing of normals is enabled
96
+
/// Flag to output the raw normals in addition to smoothed normals if smoothing of normals is enabled.
101
97
/// output_raw_mesh
102
-
/// When true, also return the SurfaceReconstruction object with no post-processing applied
98
+
/// Flag to return a copy of the raw mesh before any post-processing steps (inside the returned reconstruction object).
103
99
/// mesh_aabb_min
104
-
/// Smallest corner of the axis-aligned bounding box for the mesh
100
+
/// Lower corner [x,y,z] of the axis-aligned bounding box for the mesh, triangles fully outside this box will be removed.
105
101
/// mesh_aabb_max
106
-
/// Largest corner of the axis-aligned bounding box for the mesh
102
+
/// Upper corner [x,y,z] of the axis-aligned bounding box for the mesh, triangles fully outside this box will be removed.
107
103
/// mesh_aabb_clamp_vertices
108
-
/// Flag to clamp the vertices of the mesh to the AABB
104
+
/// Flag to clamp the vertices of the mesh to the AABB in addition to removing triangles outside the AABB.
/// The method is designed specifically for meshes generated by Marching Cubes.
204
245
/// 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
246
/// or Moore and Warren: "Compact Isocontours from Sampled Data" in "Graphics Gems III" (1992).
247
+
///
248
+
/// Parameters
249
+
/// ----------
250
+
/// mesh
251
+
/// The triangle mesh to simplify.
252
+
/// grid
253
+
/// The uniform grid that was used for the marching cubes triangulation of the input mesh.
254
+
/// max_rel_snap_dist
255
+
/// Optional maximum relative snapping distance (relative to the grid cell size) to merge close vertices.
256
+
/// max_iter
257
+
/// The maximum number of iterations of cleanup to perform.
258
+
/// keep_vertices
259
+
/// Flag to retain any vertices without connectivity resulting from simplification instead of filtering them out.
0 commit comments