weldx.geometry.LineSegment#
- class weldx.geometry.LineSegment(points)#
Line segment.
Construct line segment.
- Parameters:
points (
Quantity
) – 2x2 matrix of points. The first column is the starting point and the second column the end point.- Return type:
Examples
Create a ̧̧`LineSegment` starting at
x=-1
,``y=-2`` and ending atx=1
,y=2
>>> from weldx import Q_, LineSegment >>> point_data = Q_([[-1, 1], [-2, 2]], "mm") >>> LineSegment(point_data) <LineSegment> Line: [-1.00 -2.00] mm -> [1.00 2.00] mm Length: 4.47 mm
Methods
Apply an in-place transformation to the segment using a matrix.
Apply a translation in place.
Construct a line segment with two points.
Get an array of the points at the specified relative positions.
Get the length from the start of the segment to the passed relative position.
Interpolate two line segments linearly.
Get an array of discrete raster points of the segment.
Create a new segment transformed by the passed matrix.
Create a new segment translated by the passed vector.
Attributes
Get the length of the segment.
Get the end point of the segment.
Get the starting point of the segment.
Get the segments points in form of a 2x2 matrix.