CenterCalculus
Canonical path: NemAll_Python_Geometry.CenterCalculus
Class to calculate the center of an object
Calculate
overloaded
Calculate(polyline: Polyline2D, edge: int) -> tuple
Calculates the center of a 2D polyline
Parameters:
-
polyline
(Polyline2D
) –Polyline on which to calculate the center.
-
edge
(int
) –Index of the segment to calculate the center on. Set to 0 to calculate the center of the entire polyline.
Returns:
Calculate(polyline: Polyline3D, edge: int) -> tuple
Calculates the center of a 3D polyline
Parameters:
-
polyline
(Polyline3D
) –Polyline on which to calculate the center.
-
edge
(int
) –Index of the segment to calculate the center on. Set to 0 to calculate the center of the entire polyline.
Returns:
Calculates the center of a 2D polygon.
Parameters:
-
polygon
(Polygon2D
) –Polygon on which to calculate the center
-
bPlaneCenter
(bool
) –Whether to calculate the center of the area bounded by the polygon (True) or the center of the outline polyline (False)
-
edge
(int
) –When bPlaneCenter is set to False, this is the index of the segment of the outline polyline to calculate the center on. Set to 0 to calculate the center of the entire outline polyline.
Returns:
Calculates the center of a 3D polygon.
Parameters:
-
polygon
(Polygon3D
) –Polygon on which to calculate the center
-
bPlaneCenter
(bool
) –Whether to calculate the center of the area bounded by the polygon (True) or the center of the outline polyline (False)
-
edge
(int
) –When bPlaneCenter is set to False, this is the index of the segment of the outline polyline to calculate the center on. Set to 0 to calculate the center of the entire outline polyline.
Returns:
Calculates the center of a 2D arc.
Parameters:
-
arc
(Arc2D
) –arc on which to calculate the center
-
center
(bool
) –Whether to calculate the arc's midpoint, that divides the arc into two halves (True) or the arc's center (False)
Returns:
Calculates the center of a 3D arc.
Parameters:
-
arc
(Arc3D
) –arc on which to calculate the center
-
center
(bool
) –Whether to calculate the arc's midpoint, that divides the arc into two halves (True) or the arc's center (False)
Returns:
Calculates the center of a 3D base spline.
Parameters:
-
spline
(BSpline3D
) –B-spline on which to calculate the center
-
eps
(float
) –Precision for calculation
-
bAreaCenter
(bool
) –In case of a closed b-spline: whether to calculate the center of the area bounded by the B-spline (True) or the center of the b-spline curve (False)
Returns:
Calculate(clothoid: Clothoid2D, eps: float) -> tuple
Calculates the center of a 2D clothoid.
Parameters:
-
clothoid
(Clothoid2D
) –clothoid on which to calculate the center
-
eps
(float
) –Precision for calculation
Returns:
Calculates the center of a 2D path.
Parameters:
-
path
(Path2D
) –Path on which to calculate the center
-
eps
(float
) –Precision for calculation
-
bAreaCenter
(bool
) –In case of a closed path: whether to calculate the center of the area bounded by the path (True) or the center of the path itself (False)
Returns:
Calculates the center of a 3D path.
Parameters:
-
path
(Path3D
) –Path on which to calculate the center
-
eps
(float
) –Precision for calculation
-
bAreaCenter
(bool
) –In case of a closed path: whether to calculate the center of the area bounded by the path (True) or the center of the path itself (False)
Returns:
Calculate(geoObject: object, eps: float, bArcCenter: bool, edge: int) -> tuple
Calculates the center of a curve.
Parameters:
-
geoObject
(object
) –object on which to calculate the center
-
eps
(float
) –Precision for calculation
-
bArcCenter
(bool
) –Whether to calculate the arc's midpoint, that divides the arc into two halves (True) or the arc's center (False)
-
edge
(int
) –For polyline and polygon: index of the segment to calculate the center on. Set to 0 to calculate the center of the entire polyline/polygon.
Returns: