PolyRedistributePts¶
The PolyRedistributePts class is used to help redistribute pts on a polyline.
There are several functions on this class used to set options
(set_constant_size_bias
,
set_constant_size_func
,
set_size_func
) as well as the
function redistribute
that actaully does all the work.
Example:
from xmsmesh.meshing import PolyRedistributePts
polygon_corners = [(0, 0, 0), (0, 100, 0), (100, 100, 0),
(100, 0, 0), (0, 0, 0)]
rp = PolyRedistributePts()
rp.set_constant_size_func(10)
redistributed_points = rp.redistribute(polygon_corners)
-
class
xmsmesh.meshing.
PolyRedistributePts
¶ -
redistribute
(self: xmsmesh.meshing.PolyRedistributePts, poly_line: iterable) → iterable¶ Redistributes points on closed loop polylines. The length of edges in the redistribution comes from a size function that is interpolated to the points that make up the polylines. By default this size function comes from the edge lengths in the original polygon.
Parameters: poly_line (iterable) – List of (x, y, z) coordinates defining the polygon Returns: Redistributed polyline. Return type: iterable
-
set_constant_size_bias
(self: xmsmesh.meshing.PolyRedistributePts, size_bias: float) → None¶ Sets the bias for constant value size function
Parameters: size_bias (float) – Transition rate for size function
-
set_constant_size_func
(self: xmsmesh.meshing.PolyRedistributePts, size: float) → None¶ Sets the size function to a constant value
Parameters: size (float) – The element edge size.
-
set_size_func
(self: xmsmesh.meshing.PolyRedistributePts, interp: xms::InterpBase) → None¶ Sets the size function interpolator
Parameters: interp ( InterpBase
) – Size function interpolator class
-
set_size_func_from_poly
(self: xmsmesh.meshing.PolyRedistributePts, out_poly: iterable, inside_polys: iterable, size_bias: float) → None¶
-
set_use_curvature_redistribution
(self: xmsmesh.meshing.PolyRedistributePts, feature_size: float, mean_spacing: float, minimum_curvature: float, smooth: bool) → None¶ Specifies that curvature redistribution will be used.
Parameters: - feature_size (float) – The size of the smallest feature in the polyline to be detected.
- mean_spacing (float) – The mean spacing between the distributed points.
- minimum_curvature (float) – The value of the curvature to be used instead of 0 in staight lines. It limits the maximum spacing between points. If not included, the default is 0.001.
- smooth (bool) – Detemines if the curvatures are to be averaged by a rolling 0.25-0.5-0.25 weighted rolling average.
-