Skip to content

Commit 5ef3946

Browse files
authored
Merge branch 'main' into mesh-strip-split
2 parents e1e7af1 + 58ac4d3 commit 5ef3946

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
* Added halfedge loops in `compas.datastructures.Halfedge.halfedge_loop`.
1313
* Added halfedge strips in `compas.datastructures.Halfedge.halfedge_strip`.
1414
* Added `compas.datastructures.mesh_split_strip` and `compas.datastructures.Mesh.split_strip`.
15+
* Added boundingbox to `compas_rhino.conduits.BaseConduit`
1516

1617
### Changed
1718

src/compas_rhino/conduits/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def enabled(self):
3636
finally:
3737
self.disable()
3838

39+
def CalculateBoundingBox(self, e):
40+
bbox = Rhino.Geometry.BoundingBox(-1000, -1000, -1000, 1000, 1000, 1000)
41+
e.IncludeBoundingBox(bbox)
42+
3943
def enable(self):
4044
"""Enable the conduit."""
4145
self.Enabled = True

tests/compas/datastructures/test_halfedge.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import random
23

34
import compas
45

@@ -344,6 +345,29 @@ def test_loops_and_strips_open_corner(grid):
344345
assert edge == loop[-1]
345346

346347

348+
def test_loops_and_strips_open_boundary(grid):
349+
assert grid.number_of_edges() == 220
350+
351+
edge = random.choice(grid.edges_on_boundary())
352+
u, v = edge
353+
354+
loop = grid.edge_loop(edge)
355+
strip = grid.edge_strip(edge)
356+
357+
assert edge in strip
358+
assert len(strip) == 11
359+
assert grid.is_edge_on_boundary(* strip[0])
360+
assert grid.is_edge_on_boundary(* strip[-1])
361+
362+
assert edge in loop
363+
assert len(loop) == 10
364+
365+
if grid.halfedge[u][v] is None:
366+
assert edge == strip[-1]
367+
else:
368+
assert edge == strip[0]
369+
370+
347371
def test_split_strip_closed(box):
348372
edge = box.edge_sample()[0]
349373

@@ -370,4 +394,3 @@ def test_split_strip_open_corner(grid):
370394

371395
assert grid.is_valid()
372396
assert grid.number_of_faces() == 121
373-

0 commit comments

Comments
 (0)