Skip to content

Commit 042f00e

Browse files
committed
merging other PR and a few small fixes
1 parent 927dd0b commit 042f00e

File tree

5 files changed

+7
-3301
lines changed

5 files changed

+7
-3301
lines changed

src/compas/datastructures/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
from .graph.planarity import graph_embed_in_plane_proxy # noqa: F401
1515

16-
# =============================================================================
17-
# Halfedges
18-
# =============================================================================
19-
2016
# =============================================================================
2117
# Meshes
2218
# =============================================================================
@@ -52,8 +48,6 @@
5248
# =============================================================================
5349

5450
from .graph.graph import Graph
55-
from .network.network import Network
56-
from .halfedge.halfedge import HalfEdge
5751
from .mesh.mesh import Mesh
5852
from .halfface.halfface import HalfFace
5953
from .volmesh.volmesh import VolMesh
@@ -68,8 +62,6 @@
6862
__all__ = [
6963
"Datastructure",
7064
"CellNetwork",
71-
"Network",
72-
"HalfEdge",
7365
"Mesh",
7466
"HalfFace",
7567
"VolMesh",

src/compas/datastructures/graph/planarity.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
from 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

188187
def 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

src/compas/datastructures/halfedge/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)