Torus#

class ansys.geometry.core.shapes.surfaces.torus.Torus(origin: beartype.typing.Union[numpy.ndarray, ansys.geometry.core.typing.RealSequence, ansys.geometry.core.math.point.Point3D], major_radius: beartype.typing.Union[pint.Quantity, ansys.geometry.core.misc.measurements.Distance, ansys.geometry.core.typing.Real], minor_radius: beartype.typing.Union[pint.Quantity, ansys.geometry.core.misc.measurements.Distance, ansys.geometry.core.typing.Real], reference: beartype.typing.Union[numpy.ndarray, ansys.geometry.core.typing.RealSequence, ansys.geometry.core.math.vector.UnitVector3D, ansys.geometry.core.math.vector.Vector3D] = UNITVECTOR3D_X, axis: beartype.typing.Union[numpy.ndarray, ansys.geometry.core.typing.RealSequence, ansys.geometry.core.math.vector.UnitVector3D, ansys.geometry.core.math.vector.Vector3D] = UNITVECTOR3D_Z)#

Bases: ansys.geometry.core.shapes.surfaces.surface.Surface

Provides 3D torus representation.

Parameters:
originUnion[ndarray, RealSequence, Point3D],

Centered origin of the torus.

direction_xUnion[ndarray, RealSequence, UnitVector3D, Vector3D]

X-axis direction.

direction_yUnion[ndarray, RealSequence, UnitVector3D, Vector3D]

Y-axis direction.

major_radiusUnion[Quantity, Distance, Real]

Major radius of the torus.

minor_radiusUnion[Quantity, Distance, Real]

Minor radius of the torus.

Overview#

contains_param

Test whether a parameter is within the parametric range of the surface.

contains_point

Test whether the point is contained by the surface.

transformed_copy

Create a transformed copy of the torus based on a transformation matrix.

mirrored_copy

Create a mirrored copy of the torus along the y-axis.

evaluate

Evaluate the torus at the given parameters.

parameterization

Parameterize the torus surface as a tuple (U and V respectively).

project_point

Project a point onto the torus and evaluate the torus.

origin

Origin of the torus.

major_radius

Semi-major radius of the torus.

minor_radius

Semi-minor radius of the torus.

dir_x

X-direction of the torus.

dir_y

Y-direction of the torus.

dir_z

Z-direction of the torus.

volume

Volume of the torus.

surface_area

Surface_area of the torus.

__eq__

Equals operator for the Torus class.

Import detail#

from ansys.geometry.core.shapes.surfaces.torus import Torus

Property detail#

property Torus.origin: ansys.geometry.core.math.point.Point3D#

Origin of the torus.

property Torus.major_radius: pint.Quantity#

Semi-major radius of the torus.

property Torus.minor_radius: pint.Quantity#

Semi-minor radius of the torus.

property Torus.dir_x: ansys.geometry.core.math.vector.UnitVector3D#

X-direction of the torus.

property Torus.dir_y: ansys.geometry.core.math.vector.UnitVector3D#

Y-direction of the torus.

property Torus.dir_z: ansys.geometry.core.math.vector.UnitVector3D#

Z-direction of the torus.

property Torus.volume: pint.Quantity#

Volume of the torus.

property Torus.surface_area: pint.Quantity#

Surface_area of the torus.

Method detail#

Torus.__eq__(other: Torus) bool#

Equals operator for the Torus class.

Torus.transformed_copy(matrix: ansys.geometry.core.math.matrix.Matrix44) Torus#

Create a transformed copy of the torus based on a transformation matrix.

Parameters:
matrixMatrix44

4x4 transformation matrix to apply to the torus.

Returns:
Torus

New torus that is the transformed copy of the original torus.

Torus.mirrored_copy() Torus#

Create a mirrored copy of the torus along the y-axis.

Returns:
Torus

New torus that is a mirrored copy of the original torus.

Torus.evaluate(parameter: ansys.geometry.core.shapes.parameterization.ParamUV) TorusEvaluation#

Evaluate the torus at the given parameters.

Parameters:
parameterParamUV

Parameters (u,v) to evaluate the torus at.

Returns:
TorusEvaluation

Resulting evaluation.

Torus.parameterization() beartype.typing.Tuple[ansys.geometry.core.shapes.parameterization.Parameterization, ansys.geometry.core.shapes.parameterization.Parameterization]#

Parameterize the torus surface as a tuple (U and V respectively).

The U parameter specifies the longitude angle, increasing clockwise (east) about the axis (right-hand corkscrew law). It has a zero parameter at Geometry.Frame.DirX and a period of 2*pi.

The V parameter specifies the latitude, increasing north, with a zero parameter at the equator. For the donut, where the major radius is greater than the minor radius, the range is [-pi, pi] and the parameterization is periodic. For a degenerate torus, the range is restricted accordingly and the parameterization is non-periodic.

Returns:
Tuple[Parameterization, Parameterization]

Information about how a torus’s u and v parameters are parameterized, respectively.

Torus.project_point(point: ansys.geometry.core.math.point.Point3D) TorusEvaluation#

Project a point onto the torus and evaluate the torus.

Parameters:
pointPoint3D

Point to project onto the torus.

Returns:
TorusEvaluation

Resulting evaluation.

abstract Torus.contains_param(param_uv: ansys.geometry.core.shapes.parameterization.ParamUV) bool#

Test whether a parameter is within the parametric range of the surface.

abstract Torus.contains_point(point: ansys.geometry.core.math.point.Point3D) bool#

Test whether the point is contained by the surface.

The point can either lie within the surface or on its boundary.