miv_simulator.geometry.alphavol#

Alpha Shape implementation.

Functions

alpha_shape(pts, radius[, tri])

Alpha shape of 2D or 3D point set.

angular_deviation(P)

Computes angle between two 3d triangles that share two vertices.

circumcenters(simplices, points)

Determine circumcenters of polyhedra as described in the following page: http://mathworld.wolfram.com/Circumsphere.html

feature_edges(G, points[, theta])

A feature edge is a triangulation edge that has any of the following attributes:

free_boundary(simplices)

Returns the facets that are referenced only by simplex of the given triangulation.

tri_graph(triangles)

Returns a graph of the triangulation edges.

true_boundary(simplices, points)

volumes(simplices, points)

Volumes/areas of tetrahedra/triangles.

Classes

AlphaShape(points, simplices, bounds)

class miv_simulator.geometry.alphavol.AlphaShape(points, simplices, bounds)#

Bases: tuple

bounds#

Alias for field number 2

points#

Alias for field number 0

simplices#

Alias for field number 1

miv_simulator.geometry.alphavol.tri_graph(triangles)[source]#

Returns a graph of the triangulation edges.

miv_simulator.geometry.alphavol.angular_deviation(P)[source]#

Computes angle between two 3d triangles that share two vertices.

miv_simulator.geometry.alphavol.feature_edges(G, points, theta=1e-06)[source]#

A feature edge is a triangulation edge that has any of the following attributes:

  • The edge belongs to only one triangle.

  • The edge is shared by more than two triangles.

  • The edge is shared by a pair of triangles with angular deviation greater than the angle theta.

miv_simulator.geometry.alphavol.volumes(simplices, points)[source]#

Volumes/areas of tetrahedra/triangles.

miv_simulator.geometry.alphavol.circumcenters(simplices, points)[source]#

Determine circumcenters of polyhedra as described in the following page: http://mathworld.wolfram.com/Circumsphere.html

miv_simulator.geometry.alphavol.free_boundary(simplices)[source]#

Returns the facets that are referenced only by simplex of the given triangulation.

miv_simulator.geometry.alphavol.alpha_shape(pts, radius, tri=None)[source]#
Alpha shape of 2D or 3D point set.

V = ALPHAVOL(X,R) gives the area or volume V of the basic alpha shape for a 2D or 3D point set. X is a coordinate matrix of size Nx2 or Nx3.

R is the probe radius with default value R = Inf. In the default case the basic alpha shape (or alpha hull) is the convex hull.

Returns a structure AlphaShape with fields:

  • points - Triangulation of the alpha shape (Mx3 or Mx4)

  • simplices - Circumradius of simplices in triangulation (Mx1)

  • bounds - Boundary facets (Px2 or Px3)

Based on MATLAB code by Jonas Lundgren <splinefit@gmail.com>