AutoOpenLine2D Module
When Euclid is opened this module will be auto-opened. It only contains extension members for type Line2D.
Type extensions
| Type extension |
Description
|
|
|
Full Usage:
this.ClosestParameters
Parameters:
Line2D
-
The second line.
Returns: float * float
A tuple of two floats, the first is the parameter on lnA, the second on lnB.
|
Finds the parameters of closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are exactly the same. This method uses a default angle tolerance of 0.25 degrees for parallel detection and a length tolerance of 1e-6 for detecting lines that are too short. For more control over these tolerances, use XLine2D.getClosestParameters directly.
Extended Type:
|
|
|
|
Finds the closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same. This method uses a default angle tolerance of 0.25 degrees for parallel detection and a length tolerance of 1e-6 for detecting lines that are too short. For more control over these tolerances, use XLine2D.getClosestPoints directly.
Extended Type:
|
|
|
|
|
|
|
Full Usage:
this.Extend
Parameters:
float
distAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
|
|
Full Usage:
this.ExtendRel
Parameters:
float
relAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
|
|
Full Usage:
this.IsCoincidentAndOpposingToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentAndOpposingTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident on opposing rays within given tolerances. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and opposing if the dot-product is negative (smaller than maxDotProduct) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines.
Extended Type:
|
Full Usage:
this.IsCoincidentAndOrientedToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
minDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentAndOrientedTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident on the same ray within given tolerances. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and oriented in the same direction if the dot-product is positive (bigger than minDotProduct) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines.
Extended Type:
|
Full Usage:
this.IsCoincidentTo
Parameters:
Line2D
distanceTolerance : float
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are coincident on the same ray within the distance tolerance. 1e-6 by default. This means that lines are parallel within the angle tolerance and the distance of second start to the first line is less than the distance tolerance. Also returns false on zero Length lines. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module.
Extended Type:
|
Full Usage:
this.IsCoincidentToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident within a given tolerance for their cross product. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost coincident lines that are very long. Pick a bigger parallelogramAreaTolerance for longer lines.
Extended Type:
|
Full Usage:
this.IsNormalTo
Parameters:
Line2D
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.
Extended Type:
|
Full Usage:
this.IsNormalTo
Parameters:
Vc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is perpendicular to a 2D vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.
Extended Type:
|
Full Usage:
this.IsNormalTo
Parameters:
UnitVc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is perpendicular to a 2D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.
Extended Type:
|
Full Usage:
this.IsParallelAndOpposingToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelToAndOpposingTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product and opposing by having a negative dot-product. Lines are parallel if cross product is less than given parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Line2D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Vc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is parallel to a 2D vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than 1e-12.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is parallel to a 2D unit-vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
minDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelToAndOrientedTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product and oriented in the same direction by having a positive dot-product. Lines are parallel if cross product is less than given parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Line2D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Vc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is parallel to a 2D vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is parallel to a 2D unit-vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product. Lines are parallel if cross product is less than parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost coincident lines that are very long. Pick a bigger parallelogramAreaTolerance for longer lines.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Line2D
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Vc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is perpendicular to a 2D vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D lines is perpendicular to a 2D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
|
|
|
|
Full Usage:
this.IsTiny
Parameters:
float
Returns: bool
Modifiers: inline |
Returns TRUE if line is shorter than tolerance. Or has NaN components.
Extended Type:
|
Full Usage:
this.IsTinySq
Parameters:
float
Returns: bool
Modifiers: inline |
Returns TRUE if the line's square length is shorter than squared tolerance. Or has NaN components.
Extended Type:
|
Full Usage:
this.IsXAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 2D line is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsYAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 2D line is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsZeroLength
Parameters:
unit
Returns: bool
Modifiers: inline |
Check if the line has the same starting and ending point.
Extended Type:
|
Full Usage:
this.LengthFromParam
Parameters:
float
Returns: float
Modifiers: inline |
Returns the length of the line segment from the given parameter till the line End. This length is negative if the parameter is bigger than 1.0.
Extended Type:
|
Full Usage:
this.LengthTillParam
Parameters:
float
Returns: float
Modifiers: inline |
Returns the length of the line segment from the start point to the given parameter. This length is negative if the parameter is negative.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rotate a Line2D by a Rotation2D. The resulting line has the same length as the input.
Extended Type:
|
Full Usage:
this.RotateWithCenter
Parameters:
Pt
r : Rotation2D
Returns: Line2D
Modifiers: inline |
Rotate a Line2D by a Rotation2D around a given center point. The resulting line has the same length as the input.
Extended Type:
|
|
|
|
|
|
|
Full Usage:
this.Shrink
Parameters:
float
distAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finds the parameters of closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are exactly the same
Extended Type:
|
|
|
|
Finds the closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same
Extended Type:
|
|
|
|
|
|
|
|
Returns the Cross Product or Determinant between the vectors of the Two lines. In 2D it is just a scalar equal to the signed area of the parallelogram spanned by the input vectors. If the result is zero the two lines are parallel (or one line is zero-length). Same as Line2D.det
Extended Type:
|
|
Returns the Cross Product or Determinant between the vectors of the Two lines. In 2D it is just a scalar equal to the signed area of the parallelogram spanned by the input vectors. If the result is zero the two lines are parallel (or one line is zero-length). Same as Line2D.cross.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
Divides a 2D line into segments of given length. Includes start and end point. If the line length is smaller than the given distance just the start and end point is returned. Adds end point only if there is a remainder bigger than 0.1% of the segment length.
Extended Type:
|
|
Divides a 2D line into segments of given length. Excludes start and end point. If the line length is smaller than the given distance an empty array is returned. Adds last div point before end only if there is a remainder bigger than 0.1% of the segment length.
Extended Type:
|
|
Divides a 2D line into as few as segments as possible respecting the maximum segment length. Returned Array includes start and endpoint of line. The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.
Extended Type:
|
|
Divides a 2D line into as many as segments as possible respecting the minimum segment length. Returned Array includes start and endpoint of line. The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.
Extended Type:
|
|
A fast test tests if two finite 2D lines truly intersect. Does not use a default tolerance for parallel or coincident lines. Just checks within line range and not NaN. Returns false on zero length lines or if parallel lines are touching or overlapping each other. Use the XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident. This does not check for an explicit angle tolerance, so overlapping almost parallel lines may return true.
Extended Type:
|
|
Tests if two finite 2D lines intersect or touch. Also returns true if parallel lines are touching or overlapping each other. Also returns true if a zero length lines are at the same location. This method uses an angle of 0.25 degrees to classify Lines as parallel. In wich case it also checks if they overlap or touch. Use the Euclid's XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Checks if two 2D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Same as Line2D.isNormalTo
Extended Type:
|
|
A faster Check if two 2D lines are perpendicular to each other. The angle tolerance is 89.75 to 90.25 degrees. This function does not do a check for very short lines. But will return false on zero-length lines. Same as Line2D.isPerpendicularTo'
Extended Type:
|
|
Checks if two 2D lines are Not parallel. Ignoring orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
|
|
|
Checks if two 2D lines are parallel and orientated the same way. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
|
Checks if two 2D lines are parallel. Ignoring orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
|
|
|
Checks if two 2D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Same as Line2D.isNormalTo
Extended Type:
|
|
|
|
|
Full Usage:
Line2D.isTinySq tol l
Parameters:
float
l : Line2D
Returns: bool
Modifiers: inline |
|
|
Checks if the two finite 2D lines are touching each other at any of end points within the given tolerance. This will also return TRUE if the lines are touching on both points. Use getEndsTouching to get more detailed information about which ends are touching.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.rotate r ln
Parameters:
Rotation2D
ln : Line2D
Returns: Line2D
Modifiers: inline |
|
Full Usage:
Line2D.rotateWithCenter cen r ln
Parameters:
Pt
r : Rotation2D
ln : Line2D
Returns: Line2D
Modifiers: inline |
Rotation a Line2D around a given Center.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Divides a 2D line into given amount of segments. Includes a gap between the segments. But not at the start or end. Returns an array of 2D Lines. Returns an empty array if the length of the line is less than gap-size x segment-count-minus-1.
Extended Type:
|
|
Divides a 2D line into as few as segments as possible respecting the maximum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array of 2D lines The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.
Extended Type:
|
|
Divides a 2D line into as many as segments as possible respecting the minimum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array of 2D lines The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.tryGetOverlap lnA lnB
Parameters: Returns: (float * float) option
An option of a tuple of two floats.
Returns the tuple containing the start and end parameter of the overlap on lnA if the lines are parallel and overlapping.
Returns None if the lines are not parallel, not overlapping, our just touching at ends,or too short.
|
Checks if lines are parallel, coincident and overlapping. If the first parameter in the overlap is smaller than the second the lines are oriented in the same direction. If the first parameter is greater than the second the lines are oriented in the opposite direction.
Extended Type:
|
|
A fast intersection of two finite 2D lines. Does not use a default tolerance for parallel or coincident lines. Just checks if both parameters are within line range and not NaN. Use the XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
Intersects two finite 2D Lines. Also returns a point if parallel lines are touching or overlapping each other. Also returns a point a zero length lines are at the same location within 1e-6 distance. This method uses an angle of 0.25 degrees to classify Lines as parallel. In wich case it also checks if they overlap or touch. Use the Euclid's XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
Tries to get intersection point of two rays (rays are 2D lines extended infinitely). If the lines are parallel or coincident, or if the parameter on Line A is bigger than 1e12 in absolute value, None is returned.
Extended Type:
|
|
|
|
Tries to project a line onto another line considered finite. Returns None if there is no overlap. Returns Some (startParam, endParam) if there is an overlap. The parameters are between 0.0 and 1.0 on the target line The first parameter is from the start of the line to project. The second parameter is from the end of the line to project. So the if the first parameter is bigger than the second, the lines are oriented in opposite direction.
Extended Type:
|
|
|
|
|
|
|
|
|
|
Euclid