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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

Center of the object

Calculate(polyline, edge) staticmethod

Calculates the center of a Polyline2D

= 0 whole geo, > 0 concrete edge

Parameters:

Name Type Description Default
polyline Polyline2D

Polyline on which to calculate the center

required
edge int

calculate the center on edge

required
=

0 whole geo, > 0 concrete edge

required

Returns:

Type Description
tuple

center calculated,

tuple

Center of the object

Calculate(polyline, edge) staticmethod

Calculates the center of a Polyline2D

= 0 whole geo, > 0 concrete edge

Parameters:

Name Type Description Default
polyline Polyline3D

Polyline on which to calculate the center

required
edge int

calculate the center on edge

required
=

0 whole geo, > 0 concrete edge

required

Returns:

Type Description
tuple

center calculated,

tuple

Center of the object

Calculate(polygon, bPlaneCenter, edge) staticmethod

Calculates the center of a Polygon2D

= 0 whole geo, > 0 concrete edge

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

calculate the center on edge of first component

required
=

0 whole geo, > 0 concrete edge

required

Returns:

Type Description
tuple

center calculated,

tuple

Center of the object

Calculate(polygon, bPlaneCenter, edge) staticmethod

Calculates the center of an Polygon3D

= 0 whole geo, > 0 concrete edge

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

calculate the center on edge of first component

required
=

0 whole geo, > 0 concrete edge

required

Returns:

Type Description
tuple

True if successful,

tuple

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

Center of the object

required

Returns:

Type Description
tuple

center calculated,

tuple

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

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

Center of the object

required

Returns:

Type Description
tuple

center calculated,

tuple

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

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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
tuple

center calculated,

tuple

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

For polyline and polygon to calculate the center on edge

required
=

0 whole geo, > 0 concrete edge

required

Returns:

Type Description
tuple

center calculated,

tuple

center of the object