94. plugins.centerline — Centerline.py

Determine the (inner) voronoi diagram of a triangulated surface. Determine approximation for the centerline.

94.1. Functions defined in module plugins.centerline

plugins.centerline.circumcenter(nodes, elems)[source]

Calculate the circumcenters of a list of tetrahedrons.

For a description of the method: http://mathworld.wolfram.com/Circumsphere.html The output are the circumcenters and the corresponding radii.

plugins.centerline.voronoi(fn)[source]

Determine the voronoi diagram of a triangulated surface.

fn is the file name of a surface, including the extension (.off, .stl, .gts, .neu or .smesh) The voronoi diagram is determined by Tetgen. The output are the voronoi nodes and the corresponding radii of the voronoi spheres.

plugins.centerline.voronoiInner(fn)[source]

Determine the inner voronoi diagram of a triangulated surface.

fn is the file name of a surface, including the extension (.off, .stl, .gts, .neu or .smesh) The output are the voronoi nodes and the corresponding radii of the voronoi spheres.

plugins.centerline.selectMaxVor(nodesVor, radii, r1=1.0, r2=2.0, q=0.7, maxruns=-1)[source]

Select the local maxima of the voronoi spheres.

Procedure:

  1. The largest voronoi sphere in the record is selected (voronoi node N and radius R).

  2. All the voronoi nodes laying within a cube all deleted from the record. This cube is defined by:

    • the centrum of the cube N.

    • the edge length which is 2*r1*R.

  3. Some voronoi nodes laying within a 2nd, larger cube are also deleted. This is when their corresponding radius is smaller than q times R. This cube is defined by:

    • the centrum of the cube N.

    • the edge length which is 2*r2*R.

  4. These three operations are repeated until all nodes are deleted.

plugins.centerline.connectVorNodes(nodes, radii)[source]

Create connections between the voronoi nodes.

Each of the nodes is connected with its closest neighbours. The input is an array of n nodes and an array of n corresponding radii. Two voronoi nodes are connected if the distance between these two nodes is smaller than the sum of their corresponding radii. The output is an array containing the connectivity information.

plugins.centerline.removeTriangles(elems)[source]

Remove the triangles from the centerline.

This is a clean-up function for the centerline. Triangles appearing in the centerline are removed by this function. Both input and output are the connectivity of the centerline.

plugins.centerline.centerline(fn)[source]

Determine approximated centerline of a triangulated surface.

fn is the file name of a surface, including the extension (.off, .stl, .gts, .neu or .smesh) The output are the centerline nodes, an array containing the connectivity information and radii of the voronoi spheres.