LineCurve

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

Bases: Geometry

Python bindings for the openNURBS ON_LineCurve class.

line: Line
dimension() int

Returns 2 or 3 (2 so ON_LineCurve can be uses as a trimming curve).

is_valid(text_log: TextLog | None = None) bool

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

reverse() bool

Reverses the parameterization. Domain changes from [a, b] to [-b, -a].

set_end_point(new_end: Point3d) bool

Forces the curve to end at a specified point.

Parameters:

new_end (Point3d) – The new end point.

Returns:

successTrue if successful, False otherwise.

Return type:

bool

Notes

Some end points cannot be moved. Be sure to check return code.

set_start_point(new_end: Point3d) bool

Forces the curve to start at a specified point.

Parameters:

new_start (Point3d) – The new start point.

Returns:

successTrue if successful, False otherwise.

Return type:

bool

Notes

Some start points cannot be moved. Be sure to check return code.

swap_coordinates(index_i: int, index_j: int) bool

Swaps the coordinates of the given indices.

Returns:

successTrue if successful, False otherwise.

Return type:

bool