Skip to content

Commit 18422dc

Browse files
committed
Updating visualization
1 parent be5c236 commit 18422dc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/yamada/spatial_graphs.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def __init__(self,
3232
self.adjacent_edge_pairs = self._get_adjacent_edge_pairs()
3333
self.nonadjacent_edge_pairs = [edge_pair for edge_pair in self.edge_pairs if edge_pair not in self.adjacent_edge_pairs]
3434

35+
36+
3537
@staticmethod
3638
def _validate_nodes(nodes: list[str]) -> list[str]:
3739
"""
@@ -527,6 +529,19 @@ def _validate_node_positions(self,
527529

528530
return node_positions
529531

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+
530545
def get_edge_vertices_and_or_crossings(self, edge):
531546
"""
532547
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):
11001115
crossing_positions = []
11011116

11021117

1118+
11031119
# TODO Modify nonadjacent edge pairs that are within some axis aligned bounding box
11041120

11051121
for line_1, line_2 in self.nonadjacent_edge_pairs:
@@ -1393,7 +1409,7 @@ def plot(self):
13931409

13941410
# Plot the crossing positions
13951411
# 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:
13971413
for crossing_position in crossing_positions:
13981414
height = np.max(node_positions[:, 1]) - np.min(node_positions[:, 1])
13991415
crossing_center = crossing_position #+ np.array([0, height / 2, 0])

0 commit comments

Comments
 (0)