Line

class py3dm.Line
class Line(start: Point3d, end: Point3d)

Python bindings for the openNURBS ON_Line class.

__eq__(other: object) bool
__getitem__(index: int) Point3d
__ne__(other: object) bool
__setitem__(index: int, value: Point3d) None
create(start: Point3d, end: Point3d) bool

Create a line from two points.

Parameters:
  • start (Point3d) – Point at the start of line segment

  • end (Point3d) – Point at end of line segment

Returns:

successTrue if start and end are distinct points.

Return type:

bool

distance_to(test_point: Point3d, finite_chord: bool = False) float

Returns the distance from the point on the line that is closest to the test_point. If finite_chord is True, the distance is reported to the line as a finite chord.

is_valid() bool

Returns True if start != end and both start and end are valid points.

length() float

Returns the length of the line.

point_at(parameter: float) Point3d

Returns a point on the (infinite) line, calculated as: (1 - parameter) * line.start + parameter * line.end.