Utils

medianshape.simplicial.utils.get_bbox_diagonal(mesh_points=None, bbox=None)[source]

Returns the diagonal of a bounding box in 2D or 3D.

medianshape.simplicial.utils.boundary_points(bbox)[source]

Returns corner points of a boundary box in which 4 corners of the bottom rectangle are the first 4 points, oriented CCW starting from (xmin, ymin, zmin). Similarly, 4 corners of the top rectangle are the last 4 points, oriented CCW starting from (xmin, ymin, zmax).

medianshape.simplicial.utils.get_combination(n, vals=[1, -1])[source]

Returns all combinations of given values for n positions.

medianshape.simplicial.utils.vectorize(func_str, X)[source]

Computes function values on X domain.

Parameters:func_str (str) – a name of a function in math module in python or a name of a function within this module (medianshape.simplicial.utils).
Returns:func_values – function values on the given domain.
medianshape.simplicial.utils.x(x)[source]

\(f(x) = x\)

medianshape.simplicial.utils.x2(x)[source]

\(f(x) = x^2\)

medianshape.simplicial.utils.x5(x)[source]

\(f(x) = x^5\)

medianshape.simplicial.utils.sin2pi(x)[source]

\(f(x) = |\sin(2\pi x)|\)

medianshape.simplicial.utils.sin1pi(x)[source]

\(f(x) = |\sin(\pi x)|\)

medianshape.simplicial.utils.half_sin1pi(x)[source]

\(f(x) = \frac{1}{2}|\sin(\pi x)|\)

medianshape.simplicial.utils.small_sin1pi(x)[source]

\(f(x) = \frac{1}{4}|\sin(\pi x)|\)

medianshape.simplicial.utils.func1(x)[source]

\(f(x) = \frac{2}{\pi \cos^{-1}(x)}\)

medianshape.simplicial.utils.func2(x)[source]

\(f(x) = \frac{1}{2}(1 + \sin2\pi x)\)

medianshape.simplicial.utils.curve1(x)[source]

\(f(x) = 10e^{\frac{x}{180}}\sin(\frac{1}{100}\pi x) +25\)

medianshape.simplicial.utils.curve2(x)[source]

\(f(x) = -10e^{\frac{x}{200}}\sin(\frac{1}{50}\pi x) +25\)

medianshape.simplicial.utils.curve3(x)[source]

\(f(x) = 30e^{\frac{-x}{150}}\sin(\frac{1}{50}\pi x) +20\)

medianshape.simplicial.utils.curve4(x)[source]

\(f(x) = 10e^{\frac{-x}{200}}\sin(\frac{1}{30}\pi x) +40\)

medianshape.simplicial.utils.curve5(x)[source]

\(f(x) = 20\sin(\frac{1}{200}\pi x) +25\)

medianshape.simplicial.utils.curve6(x)[source]

\(f(x) = 10e^{\frac{-1}{200}x}\sin(\frac{1}{55}\pi x) +10\)

medianshape.simplicial.utils.deformcurve1(x)[source]

\(f(x) = 20\sin(\frac{1}{190}\pi x) +25\)

medianshape.simplicial.utils.deformcurve2(x)[source]

\(f(x) = -20\sin(\frac{1}{190}\pi x) +25\)