Classes

Additionally to the classes on this page, there exists a F64 version for every class which is otherwise identical to the F32 version.

For more information on the classes, refer to the Rust documentation of splashsurf_lib.

class pysplashsurf.Aabb3dF32(min, max)

Aabb3d wrapper

Methods

center_at_origin()

Translates the AABB to center it at the coordinate origin (moves the centroid to the coordinate origin)

centroid()

Returns the geometric centroid of the AABB (mean of the corner points)

contains_aabb(other)

Checks if the given AABB is inside of the AABB, the AABB is considered to be half-open to its max coordinate

contains_point(point)

Checks if the given point is inside of the AABB, the AABB is considered to be half-open to its max coordinate

enclosing_cube()

Returns the smallest cubical AABB with the same center that encloses this AABB

extents()

Returns the extents of the bounding box (vector connecting min and max point of the box)

from_point(point)

Constructs a degenerate AABB with zero extents centered at the given point

from_points(points)

Constructs the smallest AABB fitting around all the given points

grow_uniformly(margin)

Grows this AABB uniformly in all directions by the given scalar margin (i.e. adding the margin to min/max extents).

is_consistent()

Returns whether the AABB is consistent, i.e. aabb.min()[i] <= aabb.max()[i] for all i.

is_degenerate()

Returns whether the AABB is degenerate in any dimension, i.e. aabb.min()[i] == aabb.max()[i] for any i.

join(other)

Enlarges this AABB to the smallest AABB enclosing both itself and another AABB

join_with_point(point)

Enlarges this AABB to the smallest AABB enclosing both itself and another point

max()

Returns the max coordinate of the bounding box

max_extent()

Returns the largest scalar extent of the AABB over all of its dimensions

min()

Returns the min coordinate of the bounding box

min_extent()

Returns the smallest scalar extent of the AABB over all of its dimensions

par_from_points(points)

Constructs the smallest AABB fitting around all the given points, parallel version

scale_uniformly(scaling)

Multiplies a uniform, local scaling to the AABB (i.e. multiplying its extents as if it was centered at the origin).

translate(vector)

Translates the AABB by the given vector

zeros()

Constructs a degenerate AABB with min and max set to zero

See Aabb3d for more information.

class pysplashsurf.MixedTriQuadMesh3dF32

MixedTriQuadMesh3d wrapper

Attributes:
cells

2D list specifying the vertex indices either for a triangle or a quad

vertices

nx3 array of vertex positions, copies data

Methods

take_vertices_and_cells()

Returns a tuple of vertices and triangles without copying the data, removes the data in the class

See MixedTriQuadMesh3d for more information.

class pysplashsurf.MixedTriQuadMeshWithDataF32(mesh)

MeshWithData wrapper

Attributes:
mesh

Clone of the contained mesh

Methods

get_cell_attribute(name)

Get mesh cell attribute by name

get_cell_attribute_keys()

Get all registered cell attribute names

get_cell_attributes()

Get all cell attributes in a python dictionary

get_point_attribute(name)

Get mesh vertex attribute by name

get_point_attribute_keys()

Get all registered point attribute names

get_point_attributes()

Get all point attributes in a python dictionary

par_clamp_with_aabb(aabb, clamp_vertices, ...)

Removes all cells from the mesh that are completely outside of the given AABB and clamps the remaining cells to the boundary

push_cell_attribute(name, data)

Add a cell attribute to the mesh

push_point_attribute(name, data)

Add a point attribute to the mesh

take_mesh()

Returns mesh without copying the mesh data, removes it from the object

See MeshWithData for more information.

class pysplashsurf.SphInterpolatorF32(particle_positions, particle_densities, particle_rest_mass, compact_support_radius)

SphInterpolator wrapper

Methods

interpolate_normals(interpolation_points)

Interpolates surface normals (i.e. normalized SPH gradient of the indicator function) of the fluid to the given points using SPH interpolation.

interpolate_scalar_quantity(...)

Interpolates a scalar per particle quantity to the given points, panics if the there are less per-particles values than particles

interpolate_vector_quantity(...)

Interpolates a vectorial per particle quantity to the given points, panics if the there are less per-particles values than particles

See SphInterpolator for more information.

class pysplashsurf.SurfaceReconstructionF32

SurfaceReconstruction wrapper

Attributes:
grid

PyUniformGrid clone of the contained grid

mesh

PyTrimesh3d clone of the contained mesh

Methods

particle_densities()

Returns a reference to the global particle density vector if computed during the reconstruction (currently, all reconstruction approaches return this)

particle_neighbors()

Returns a reference to the global list of per-particle neighborhood lists if computed during the reconstruction (None if not specified in the parameters)

See SurfaceReconstruction for more information.

class pysplashsurf.TriMesh3dF32

TriMesh3d wrapper

Attributes:
triangles

nx3 array of the vertex indices that make up a triangle, copies the data

vertices

nx3 array of vertex positions, copies the data

Methods

par_vertex_normals()

Computes the mesh's vertex normals using an area weighted average of the adjacent triangle faces (parallelized version)

take_vertices_and_triangles()

Returns a tuple of vertices and triangles without copying the data, removes the data in the class

vertex_vertex_connectivity()

Returns a mapping of all mesh vertices to the set of their connected neighbor vertices

See TriMesh3d for more information.

class pysplashsurf.TriMeshWithDataF32(mesh)

MeshWithData wrapper

Attributes:
mesh

Clone of the contained mesh

Methods

get_cell_attribute(name)

Get mesh cell attribute by name

get_cell_attribute_keys()

Get all registered cell attribute names

get_cell_attributes()

Get all cell attributes in a python dictionary

get_point_attribute(name)

Get mesh vertex attribute by name

get_point_attribute_keys()

Get all registered point attribute names

get_point_attributes()

Get all point attributes in a python dictionary

par_clamp_with_aabb(aabb, clamp_vertices, ...)

Removes all cells from the mesh that are completely outside of the given AABB and clamps the remaining cells to the boundary

push_cell_attribute(name, data)

Add a cell attribute to the mesh

push_point_attribute(name, data)

Add a point attribute to the mesh

take_mesh()

Returns mesh without copying the mesh data, removes it from the object

See MeshWithData for more information.

class pysplashsurf.UniformGridF32

UniformGrid wrapper

See UniformGrid for more information.