Line#

class ansys.motorcad.core.geometry.Line(start, end)#

Python representation of Motor-CAD line entity based upon start and end coordinates.

Parameters:
startCoordinate

Start coordinate.

endCoordinate

End coordinate.

Methods

Line.coordinate_on_entity(coordinate)

Get if a coordinate exists on this line.

Line.get_coordinate_from_distance(...)

Get the coordinate at the specified distance along the line from the reference.

Line.get_coordinate_from_percentage_distance(...)

Get the coordinate at the percentage distance along the line from the reference.

Line.get_line_intersection(line)

Get intersection Coordinate of line with another line.

Line.mirror(mirror_line)

Mirror line about a line.

Line.reverse()

Reverse Entity class.

Line.rotate(centre_point, angle)

Rotate entity around a point for a given angle.

Line.translate(x, y)

Translate Entity by specified x,y distances.

Attributes

Line.angle

Get angle of line vector.

Line.gradient

Get gradient of line - A in equation (y = Ax + B).

Line.is_horizontal

Check whether line is horizontal.

Line.is_vertical

Check whether line is vertical.

Line.length

Get length of line.

Line.midpoint

Get midpoint of Line.

Line.y_intercept

Get y intercept of line - B in equation (y = Ax + B).