Skip to content

Commit eed49fe

Browse files
authored
Merge pull request #1257 from compas-dev/merge-halfedge-mesh
Merge Halfedge into Mesh
2 parents b1e8303 + 042f00e commit eed49fe

File tree

9 files changed

+4039
-4228
lines changed

9 files changed

+4039
-4228
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16+
* Merged `compas.datastructures.Halfedge` into `compas.datastructures.Mesh`.
1617
* Merged `compas.datastructures.Network` into `compas.datastructures.Graph`.
1718

1819
### Removed
1920

2021
* Removed `compas.datastructures.Network`.
22+
* Removed `compas.datastructures.Halfedge`.
2123

2224
## [2.0.0-beta.2] 2024-01-12
2325

src/compas/datastructures/__init__.py

Lines changed: 0 additions & 7 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,7 +48,6 @@
5248
# =============================================================================
5349

5450
from .graph.graph import Graph
55-
from .halfedge.halfedge import HalfEdge
5651
from .mesh.mesh import Mesh
5752
from .halfface.halfface import HalfFace
5853
from .volmesh.volmesh import VolMesh
@@ -67,8 +62,6 @@
6762
__all__ = [
6863
"Datastructure",
6964
"CellNetwork",
70-
"Graph",
71-
"HalfEdge",
7265
"Mesh",
7366
"HalfFace",
7467
"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)