Skip to content

Center Calculus

Class full path: NemAll_Python_Geometry.CenterCalculus

Class to calculate the center of an object

Functions

Calculate overload

Calculate(line) staticmethod

Calculates the center of a Line2D

Parameters:

Name Type Description Default
line Line2D

Line2D on which to calculate the center

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(line) staticmethod

Calculates the center of a Line3D

Parameters:

Name Type Description Default
line Line3D

line on which to calculate the center

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(polyline, edge) staticmethod

Calculates the center of a Polyline2D

Parameters:

Name Type Description Default
polyline Polyline2D

Polyline on which to calculate the center

required
edge int

edge index to calculate the center on, when 0 - center for whole polyline will be calculated

required

Returns:

Type Description
bool

center calculated

Point3D

Center of the object

Calculate(polyline, edge) staticmethod

Calculates the center of a Polyline2D

Parameters:

Name Type Description Default
polyline Polyline3D

Polyline on which to calculate the center

required
edge int

edge index to calculate the center on, when 0 - center for whole polyline will be calculated

required

Returns:

Type Description
bool

center calculated

Point3D

Center of the object

Calculate(polygon, bPlaneCenter, edge) staticmethod

Calculates the center of a Polygon2D

Parameters:

Name Type Description Default
polygon Polygon2D

Polygon on which to calculate the center

required
bPlaneCenter bool

To distinguish between the center of the area and on the line.

required
edge int

edge index to calculate the center on, when 0 - center for whole polygon will be calculated

required

Returns:

Type Description
bool

center calculated

Point3D

Center of the object

Calculate(polygon, bPlaneCenter, edge) staticmethod

Calculates the center of an Polygon3D

Parameters:

Name Type Description Default
polygon Polygon3D

Polygon on which to calculate the center

required
bPlaneCenter bool

To distinguish between the center of the area and on the line.

required
edge int

edge index to calculate the center on, when 0 - center for whole polygon will be calculated

required

Returns:

Type Description
bool

True if successful,

Point3D

Center of the object

Calculate(arc, center) staticmethod

Calculates the center of an Arc2D

Parameters:

Name Type Description Default
arc Arc2D

Arc2D on which to calculate the center

required
center bool

True to calculate center point ON the arc, False to calculate center INSIDE the arc

required

Returns:

Type Description
bool

center calculated

Point3D

Center point

Calculate(arc, center) staticmethod

Calculates the center of an Arc3D

Parameters:

Name Type Description Default
arc Arc3D

Arc2D on which to calculate the center

required
center bool

True to calculate center point ON the arc, False to calculate center INSIDE the arc

required

Returns:

Type Description
bool

center calculated

Point3D

Center point

Calculate(spline, eps) staticmethod

Calculates the center of a Spline2D

Parameters:

Name Type Description Default
spline Spline2D

Spline on which to calculate the center

required
eps float

Precision for kurve2

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(spline, eps) staticmethod

Calculates the center of a Spline3D

Parameters:

Name Type Description Default
spline Spline3D

Spline on which to calculate the center

required
eps float

Precision for calculation

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(spline, eps, bAreaCenter) staticmethod

Calculates the center of a BSpline3D

Parameters:

Name Type Description Default
spline BSpline3D

Spline on which to calculate the center

required
eps float

Precision for kurve2

required
bAreaCenter bool

if this is true and BSpline3D is closed boundary of area and you get 'gravity' point, false for center on boundary.

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(spline, eps) staticmethod

Calculates the center of a BSpline2D

Parameters:

Name Type Description Default
spline BSpline2D

Spline on which to calculate the center

required
eps float

Precision for kurve2

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(clothoid, eps) staticmethod

Calculates the center of a Clothoid2D

Parameters:

Name Type Description Default
clothoid Clothoid2D

Clothoid on which to calculate the center

required
eps float

Precision for kurve2

required

Returns:

Type Description
bool

center calculated,

Point3D

Center of the object

Calculate(path, eps, bAreaCenter) staticmethod

Calculates the center of a Path2D

Parameters:

Name Type Description Default
path Path2D

Path on which to calculate the center

required
eps float

Precision for splines and clothoids

required
bAreaCenter bool

True if path is boundary of area and you want to 'gravity' point, false for center on boundary.

required

Returns:

Type Description
bool

center calculated

Point3D

Center of the object

Calculate(path, eps, bAreaCenter) staticmethod

Calculates the center of a Path3D

Parameters:

Name Type Description Default
path Path3D

Path on which to calculate the center

required
eps float

Precision for splines and clothoids

required
bAreaCenter bool

True if path is boundary of area and you want to 'gravity' point, false for center on boundary.

required

Returns:

Type Description
bool

center calculated

Point3D

Center of the object

Calculate(geoObject, eps, bArcCenter, edge) staticmethod

Calculates center of an object

Parameters:

Name Type Description Default
geoObject object

object on which to calculate the center

required
eps float

Precision for splines and clothoids

required
bArcCenter bool

For arcs to distinguish between the center inside the arc and on the arc.

required
edge int

edge index of a polyline or polygon to calculate the center on, when 0 - center for whole polygon or polyline will be calculated

required

Returns:

Type Description
bool

center calculated,

Point3D

center of the object