Class AutoRouter.Line
Line description
Namespace: Mechatronics.SystemGraph
Syntax
public class Line
Constructors
Line()
Constructor
Declaration
public Line()
Line(Single, Single, Single, Single)
Constructor with 4 coordinates
Declaration
public Line(float _x1, float _y1, float _x2, float _y2)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | _x1 | X1 point |
| Single | _y1 | Y2 point |
| Single | _x2 | X2 point |
| Single | _y2 | Y2 point |
Line(Vector2, Vector2)
Constructor from 2 points
Declaration
public Line(Vector2 a, Vector2 b)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | a | First point of the line |
| Vector2 | b | Second point of the line |
Fields
name
Name of this line
Declaration
public string name
Field Value
| Type | Description |
|---|---|
| String |
start
Start Point
Declaration
public Vector2 start
Field Value
| Type | Description |
|---|---|
| Vector2 |
stop
Stop Point
Declaration
public Vector2 stop
Field Value
| Type | Description |
|---|---|
| Vector2 |
Methods
GetIntersection(AutoRouter.Line, AutoRouter.Line, ref Vector2, Single)
Get Intersection status and point for 2 lines
Declaration
public static bool GetIntersection(AutoRouter.Line a, AutoRouter.Line b, ref Vector2 v, float tolerance = 0.1F)
Parameters
| Type | Name | Description |
|---|---|---|
| AutoRouter.Line | a | First point |
| AutoRouter.Line | b | Second point |
| Vector2 | v | Intersection point coordinate |
| Single | tolerance | Check for intersection within this tolerance |
Returns
| Type | Description |
|---|---|
| Boolean | True if lines intersect |
IsParallel(AutoRouter.Line, AutoRouter.Line, ref AutoRouter.Direction.Alignment)
This function check Horizontal or Vertical line for parallel!
Declaration
public static bool IsParallel(AutoRouter.Line a, AutoRouter.Line b, ref AutoRouter.Direction.Alignment alignment)
Parameters
| Type | Name | Description |
|---|---|---|
| AutoRouter.Line | a | First line |
| AutoRouter.Line | b | Second line |
| AutoRouter.Direction.Alignment | alignment | Alignment to check for parallel |
Returns
| Type | Description |
|---|---|
| Boolean | True if lines are parallel accoridng to the alignment provided |
SqrLength()
Squared length of the line
Declaration
public float SqrLength()
Returns
| Type | Description |
|---|---|
| Single | Squared length of the line |
ToString()
String representation of the line
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | Representation string of the line |