Line#

class ansys.geometry.core.shapes.curves.line.Line(origin: numpy.ndarray | ansys.geometry.core.typing.RealSequence | ansys.geometry.core.math.point.Point3D, direction: numpy.ndarray | ansys.geometry.core.typing.RealSequence | ansys.geometry.core.math.vector.UnitVector3D | ansys.geometry.core.math.vector.Vector3D)#

Bases: ansys.geometry.core.shapes.curves.curve.Curve

Provides 3D line representation.

Parameters:
originndarray | RealSequence | Point3D

Origin of the line.

directionndarray | RealSequence | UnitVector3D | Vector3D

Direction of the line.

Overview#

contains_param

Check a parameter is within the parametric range of the curve.

contains_point

Check a point is contained by the curve.

evaluate

Evaluate the line at a given parameter.

transformed_copy

Create a transformed copy of the line from a transformation matrix.

project_point

Project a point onto the line and evaluate the line.

is_coincident_line

Determine if the line is coincident with another line.

is_opposite_line

Determine if the line is opposite another line.

parameterization

Get the parametrization of the line.

origin

Origin of the line.

direction

Direction of the line.

__eq__

Equals operator for the Line class.

Import detail#

from ansys.geometry.core.shapes.curves.line import Line

Property detail#

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

Origin of the line.

property Line.direction: ansys.geometry.core.math.vector.UnitVector3D#

Direction of the line.

Method detail#

Line.__eq__(other: object) bool#

Equals operator for the Line class.

Line.evaluate(parameter: float) LineEvaluation#

Evaluate the line at a given parameter.

Parameters:
parameterReal

Parameter to evaluate the line at.

Returns:
LineEvaluation

Resulting evaluation.

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

Create a transformed copy of the line from a transformation matrix.

Parameters:
matrixMatrix44

4X4 transformation matrix to apply to the line.

Returns:
Line

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

Line.project_point(point: ansys.geometry.core.math.point.Point3D) LineEvaluation#

Project a point onto the line and evaluate the line.

Parameters:
pointPoint3D

Point to project onto the line.

Returns:
LineEvaluation

Resulting evaluation.

Line.is_coincident_line(other: Line) bool#

Determine if the line is coincident with another line.

Parameters:
otherLine

Line to determine coincidence with.

Returns:
bool

True if the line is coincident with another line, False otherwise.

Line.is_opposite_line(other: Line) bool#

Determine if the line is opposite another line.

Parameters:
otherLine

Line to determine opposition with.

Returns:
bool

True if the line is opposite to another line.

Line.parameterization() ansys.geometry.core.shapes.parameterization.Parameterization#

Get the parametrization of the line.

The parameter of a line specifies the distance from the origin in the direction of direction.

Returns:
Parameterization

Information about how the line is parameterized.

abstract Line.contains_param(param: ansys.geometry.core.typing.Real) bool#

Check a parameter is within the parametric range of the curve.

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

Check a point is contained by the curve.

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