QRouteLead¶
- class QRouteLead(*args, **kwargs)[source]¶
A simple class to define a an array of points with some properties, defines 2D positions and some of the 2D directions (XY plane).
All values stored as np.ndarray of parsed floats.
QRouteLead is a simple sequence of points.
Used to accurately control one of the QRoute termination points Before that, it adds the variables that are needed to support routing.
- pts¶
Sequence of points. Defaults to None.
- Type:
numpy Nx2
- direction¶
Normal from the last point of the array. Defaults to None.
- Type:
numpy 2x1
Attributes
- length¶
Sum of all segments length, including the head.
- Returns:
Full point_array length
- Return type:
length (float)
Methods
- get_tip() QRoutePoint [source]¶
Access the last element in the QRouteLead.
- Returns:
Last point in the QRouteLead The values are numpy arrays with two float points each.
- Return type:
- go_angle(length: float, angle: float)[source]¶
Straight line at any angle w.r.t lead tip direction.
- Parameters:
length (float) – How much to move by
angle (float) – rotation angle w.r.t lead tip direction
- go_left(length: float)[source]¶
Straight line 90deg counter-clock-wise direction w.r.t. lead tip direction.
- Parameters:
length (float) – How much to move by
- go_left45(length: float)[source]¶
Straight line at 45 angle counter-clockwise w.r.t lead tip direction.
- Parameters:
length (float) – How much to move by
- go_right(length: float)[source]¶
Straight line 90deg clock-wise direction w.r.t. lead tip direction.
- Parameters:
length (float) – How much to move by
- go_right45(length: float)[source]¶
Straight line at 45 angle clockwise w.r.t lead tip direction.
- Parameters:
length (float) – How much to move by
- go_straight(length: float)[source]¶
Add a point ot ‘length’ distance in the same direction.
- Parameters:
length (float) – How much to move by
- seed_from_pin(pin: Dict) QRoutePoint [source]¶
Initialize the QRouteLead by giving it a starting point and a direction.
- Parameters:
pin – object describing the “reference_pin” (not cpw_pin) this is attached to. this is currently (8/4/2020) a dictionary
- Returns:
Last point (for now the single point) in the QRouteLead The values are numpy arrays with two float points each.
- Return type: