Basics¶
The basic classes are as follows:
-
class
line_intersect_2d.basics.
Point
¶ A single point.
This is immutable, hashable and __eq__able. Take care when comparing floats.
This overloads +, -, * and /
- Parameters
x (float) – x coordinate
y (float) – y coordinate
- Variables
x – x coordinate (float)
y – y coordinate (float)
-
add
()¶
-
div
()¶ - Returns
result of dividing this point by a factor
- Parameters
p (float) – point p
- Returns
new Point
- Return type
-
mul
()¶ - Returns
result of multiplying this point by a factor
- Parameters
p (float) – point p
- Returns
new Point
- Return type
-
class
line_intersect_2d.basics.
Segment
¶ A segment.
This is immutable (save for tag), __eq__able and hashable.
- Parameters
start (Vector) – start point
stop (Vector) – stop point
- Variables
start – start point (Point)
stop – stop point (Point)
tag – tag (int), writable
q_nodes – numbers of q-nodes that this segment belongs to (tp.List[int])
-
class
line_intersect_2d.quadtrees.
Path
¶ A path made from connected segments.
This is immutable.
Constructor works as:
>>> p = Path([Segment(...), Segment(...)])
or
>>> p = Path((x1, y1), (x2, y2), ...)
- Variables
segments – list of segments (tp.List[Segment])