@@ -32,6 +32,8 @@ def __init__(self,
32
32
self .adjacent_edge_pairs = self ._get_adjacent_edge_pairs ()
33
33
self .nonadjacent_edge_pairs = [edge_pair for edge_pair in self .edge_pairs if edge_pair not in self .adjacent_edge_pairs ]
34
34
35
+
36
+
35
37
@staticmethod
36
38
def _validate_nodes (nodes : list [str ]) -> list [str ]:
37
39
"""
@@ -527,6 +529,19 @@ def _validate_node_positions(self,
527
529
528
530
return node_positions
529
531
532
+ def get_nonadjacent_edge_pairs_with_a_possible_crossing (self ):
533
+
534
+ edges = self .edges
535
+ nodes = self .nodes
536
+ node_positions = self .node_positions
537
+ node_positions_dict = {node : position for node , position in zip (nodes , node_positions )}
538
+ edge_positions = [[node_positions_dict [node ] for node in edge ] for edge in edges ]
539
+
540
+
541
+ nonadjacent_edge_pairs_with_a_possible_crossing = []
542
+
543
+
544
+
530
545
def get_edge_vertices_and_or_crossings (self , edge ):
531
546
"""
532
547
Returns a list of the vertices and crossings along a give edge, specifically ordered from -x to +x.
@@ -1100,6 +1115,7 @@ def get_crossings(self):
1100
1115
crossing_positions = []
1101
1116
1102
1117
1118
+
1103
1119
# TODO Modify nonadjacent edge pairs that are within some axis aligned bounding box
1104
1120
1105
1121
for line_1 , line_2 in self .nonadjacent_edge_pairs :
@@ -1393,7 +1409,7 @@ def plot(self):
1393
1409
1394
1410
# Plot the crossing positions
1395
1411
# TODO, the out of plane as transparent red spheres, connected by a line...
1396
- if self . crossing_positions is not None :
1412
+ if crossing_positions is not None :
1397
1413
for crossing_position in crossing_positions :
1398
1414
height = np .max (node_positions [:, 1 ]) - np .min (node_positions [:, 1 ])
1399
1415
crossing_center = crossing_position #+ np.array([0, height / 2, 0])
0 commit comments