1515from compas .geometry ._core .predicates_2 import is_intersection_segment_segment_xy
1616
1717
18- def graph_embed_in_plane_proxy (data , fixed = None , straightline = True ):
18+ def graph_embed_in_plane_proxy (data , fixed = None ):
1919 from compas .datastructures import Graph
2020
2121 graph = Graph .from_data (data )
22- graph_embed_in_plane (graph , fixed = fixed , straightline = straightline )
22+ graph_embed_in_plane (graph , fixed = fixed )
2323 return graph .to_data ()
2424
2525
@@ -181,8 +181,7 @@ def graph_is_planar(graph):
181181 print ("NetworkX is not installed." )
182182 raise
183183
184- nxgraph = graph .to_networkx ()
185- return nx .is_planar (nxgraph )
184+ return nx .is_planar (graph .to_networkx ())
186185
187186
188187def graph_is_planar_embedding (graph ):
@@ -203,7 +202,7 @@ def graph_is_planar_embedding(graph):
203202 return graph_is_planar (graph ) and graph_is_xy (graph ) and not graph_is_crossed (graph )
204203
205204
206- def graph_embed_in_plane (graph , fixed = None , straightline = True ):
205+ def graph_embed_in_plane (graph , fixed = None ):
207206 """Embed the graph in the plane.
208207
209208 Parameters
@@ -212,8 +211,6 @@ def graph_embed_in_plane(graph, fixed=None, straightline=True):
212211 A graph object.
213212 fixed : [hashable, hashable], optional
214213 Two fixed points.
215- straightline : bool, optional
216- If True, embed using straight lines only.
217214
218215 Returns
219216 -------
@@ -247,8 +244,7 @@ def graph_embed_in_plane(graph, fixed=None, straightline=True):
247244
248245 count = 100
249246 while count :
250- graph = nx .Graph (edges )
251- pos = nx .spring_layout (graph , iterations = 100 , scale = max (xspan , yspan ))
247+ pos = nx .spring_layout (nx .Graph (edges ), iterations = 100 , scale = max (xspan , yspan ))
252248 if not _are_edges_crossed (edges , pos ):
253249 is_embedded = True
254250 break
0 commit comments