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
Runs the surface reconstruction pipeline for the given particle positions with optional post-processing
405
405
406
406
Note that smoothing length and cube size are given in multiples of the particle radius.
407
+
408
+
Parameters
409
+
----------
410
+
particles : numpy.ndarray
411
+
A two-dimensional numpy array of shape (N, 3) containing the positions of the particles.
412
+
attributes_to_interpolate
413
+
Dictionary containing all attributes to interpolate. The keys are the attribute names and the values are the corresponding 1D/2D arrays.\n
414
+
The arrays must have the same length as the number of particles. \n
415
+
Supported array types are 2D float32/float64 arrays for vector attributes and 1D uint64/float32/float64 arrays for scalar attributes.
416
+
particle_radius
417
+
Particle radius
418
+
rest_density
419
+
Rest density of the fluid
420
+
smoothing_length
421
+
Smoothing length of the fluid in multiples of the particle radius (compact support radius of SPH kernel will be twice the smoothing length)
422
+
cube_size
423
+
Size of the cubes used for the marching cubes grid in multiples of the particle radius
424
+
iso_surface_threshold
425
+
Threshold for the iso surface
426
+
aabb_min
427
+
Lower corner of the AABB of particles to consider in the reconstruction
428
+
aabb_max
429
+
Upper corner of the AABB of particles to consider in the reconstruction
430
+
multi_threading
431
+
Multi-threading
432
+
subdomain_grid
433
+
Enable spatial decomposition using by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading
434
+
subdomain_grid_auto_disable
435
+
Whether to automatically disable the subdomain grid if the global domain is too small
436
+
subdomain_num_cubes_per_dim
437
+
Each subdomain will be a cube consisting of this number of MC cube cells along each coordinate axis
438
+
check_mesh_closed
439
+
Enable checking the final mesh for holes
440
+
check_mesh_manifold
441
+
Enable checking the final mesh for non-manifold edges and vertices
442
+
check_mesh_orientation
443
+
Enable checking the final mesh for inverted triangles (compares angle between vertex normals and adjacent face normals)
444
+
check_mesh_debug
445
+
Enable additional debug output for the check-mesh operations (has no effect if no other check-mesh option is enabled)
446
+
mesh_cleanup
447
+
Flag to perform mesh cleanup\n
448
+
This implements the method from “Compact isocontours from sampled data” (Moore, Warren; 1992)
449
+
mesh_cleanup_snap_dist
450
+
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])
451
+
decimate_barnacles
452
+
Flag to perform barnacle decimation\n
453
+
For details see “Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids” (Löschner, Böttcher, Jeske, Bender; 2023).
454
+
keep_vertices
455
+
Flag to keep any vertices without connectivity resulting from mesh cleanup or decimation step
456
+
compute_normals
457
+
Flag to compute normals\n
458
+
If set to True, the normals will be computed and stored in the mesh.
459
+
sph_normals
460
+
Flag to compute normals using SPH interpolation instead of geometry-based normals.
461
+
normals_smoothing_iters
462
+
Number of Laplacian smoothing iterations for the normal field
463
+
mesh_smoothing_iters
464
+
Number of Laplacian smoothing iterations for the mesh
465
+
mesh_smoothing_weights
466
+
Flag to compute mesh smoothing weights\n
467
+
This implements the method from “Weighted Laplacian Smoothing for Surface Reconstruction of Particle-based Fluids” (Löschner, Böttcher, Jeske, Bender; 2023).
468
+
mesh_smoothing_weights_normalization
469
+
Normalization value for the mesh smoothing weights
470
+
generate_quads
471
+
Enable trying to convert triangles to quads if they meet quality criteria
472
+
quad_max_edge_diag_ratio
473
+
Maximum allowed ratio of quad edge lengths to its diagonals to merge two triangles to a quad (inverse is used for minimum)
474
+
quad_max_normal_angle
475
+
Maximum allowed angle (in degrees) between triangle normals to merge them to a quad
476
+
quad_max_interior_angle
477
+
Maximum allowed vertex interior angle (in degrees) inside a quad to merge two triangles to a quad
478
+
output_mesh_smoothing_weights
479
+
Flag to store the mesh smoothing weights if smoothing weights are computed.
480
+
output_raw_normals
481
+
Flag to output the raw normals in addition to smoothed normals if smoothing of normals is enabled
482
+
output_raw_mesh
483
+
When true, also return the SurfaceReconstruction object with no post-processing applied
484
+
mesh_aabb_min
485
+
Smallest corner of the axis-aligned bounding box for the mesh
486
+
mesh_aabb_max
487
+
Largest corner of the axis-aligned bounding box for the mesh
488
+
mesh_aabb_clamp_vertices
489
+
Flag to clamp the vertices of the mesh to the AABB
Copy file name to clipboardExpand all lines: pysplashsurf/src/pipeline.rs
+87-2Lines changed: 87 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,90 @@ use crate::utils::{IndexT, pyerr_unsupported_scalar};
23
23
/// Runs the surface reconstruction pipeline for the given particle positions with optional post-processing
24
24
///
25
25
/// Note that smoothing length and cube size are given in multiples of the particle radius.
26
+
///
27
+
/// Parameters
28
+
/// ----------
29
+
/// particles : numpy.ndarray
30
+
/// A two-dimensional numpy array of shape (N, 3) containing the positions of the particles.
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.
35
+
/// particle_radius
36
+
/// Particle radius
37
+
/// rest_density
38
+
/// Rest density of the fluid
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)
41
+
/// cube_size
42
+
/// Size of the cubes used for the marching cubes grid in multiples of the particle radius
43
+
/// iso_surface_threshold
44
+
/// Threshold for the iso surface
45
+
/// aabb_min
46
+
/// Lower corner of the AABB of particles to consider in the reconstruction
47
+
/// aabb_max
48
+
/// Upper corner of the AABB of particles to consider in the reconstruction
49
+
/// multi_threading
50
+
/// Multi-threading
51
+
/// subdomain_grid
52
+
/// Enable spatial decomposition using by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading
53
+
/// subdomain_grid_auto_disable
54
+
/// Whether to automatically disable the subdomain grid if the global domain is too small
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
57
+
/// check_mesh_closed
58
+
/// Enable checking the final mesh for holes
59
+
/// check_mesh_manifold
60
+
/// Enable checking the final mesh for non-manifold edges and vertices
61
+
/// check_mesh_orientation
62
+
/// Enable checking the final mesh for inverted triangles (compares angle between vertex normals and adjacent face normals)
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)
65
+
/// mesh_cleanup
66
+
/// Flag to perform mesh cleanup\n
67
+
/// This implements the method from “Compact isocontours from sampled data” (Moore, Warren; 1992)
68
+
/// 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])
70
+
/// 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).
73
+
/// keep_vertices
74
+
/// Flag to keep any vertices without connectivity resulting from mesh cleanup or decimation step
75
+
/// compute_normals
76
+
/// Flag to compute normals\n
77
+
/// If set to True, the normals will be computed and stored in the mesh.
78
+
/// sph_normals
79
+
/// Flag to compute normals using SPH interpolation instead of geometry-based normals.
80
+
/// normals_smoothing_iters
81
+
/// Number of Laplacian smoothing iterations for the normal field
82
+
/// mesh_smoothing_iters
83
+
/// Number of Laplacian smoothing iterations for the mesh
84
+
/// 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).
87
+
/// mesh_smoothing_weights_normalization
88
+
/// Normalization value for the mesh smoothing weights
89
+
/// generate_quads
90
+
/// Enable trying to convert triangles to quads if they meet quality criteria
91
+
/// 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)
93
+
/// quad_max_normal_angle
94
+
/// Maximum allowed angle (in degrees) between triangle normals to merge them to a quad
95
+
/// quad_max_interior_angle
96
+
/// Maximum allowed vertex interior angle (in degrees) inside a quad to merge two triangles to a quad
97
+
/// output_mesh_smoothing_weights
98
+
/// Flag to store the mesh smoothing weights if smoothing weights are computed.
99
+
/// output_raw_normals
100
+
/// Flag to output the raw normals in addition to smoothed normals if smoothing of normals is enabled
101
+
/// output_raw_mesh
102
+
/// When true, also return the SurfaceReconstruction object with no post-processing applied
103
+
/// mesh_aabb_min
104
+
/// Smallest corner of the axis-aligned bounding box for the mesh
105
+
/// mesh_aabb_max
106
+
/// Largest corner of the axis-aligned bounding box for the mesh
107
+
/// mesh_aabb_clamp_vertices
108
+
/// Flag to clamp the vertices of the mesh to the AABB
109
+
///
26
110
#[gen_stub_pyfunction]
27
111
#[pyfunction]
28
112
#[pyo3(name = "reconstruction_pipeline")]
@@ -35,7 +119,7 @@ use crate::utils::{IndexT, pyerr_unsupported_scalar};
0 commit comments