Skip to content

Commit 9467bdf

Browse files
committed
no more windows
1 parent 6b29af0 commit 9467bdf

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [macos-latest, windows-latest]
18-
python: ["3.11"]
17+
os: [macos-latest]
18+
python: ["3.9", "3.10", "3.11", "3.12"]
1919

2020
steps:
2121
- uses: compas-dev/compas-actions.build@v4

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
docs:
15-
runs-on: windows-latest
15+
runs-on: macos-latest
1616
steps:
1717
- uses: compas-dev/compas-actions.docs@v3
1818
with:

tests/test_straight_skeleton_2.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
from compas_cgal.straight_skeleton_2 import create_interior_straight_skeleton
2+
from compas_cgal.straight_skeleton_2 import create_interior_straight_skeleton_with_holes
3+
from compas_cgal.straight_skeleton_2 import create_offset_polygons_2
4+
from compas_cgal.straight_skeleton_2 import create_weighted_offset_polygons_2
5+
6+
7+
def test_straight_polygon():
8+
points = [
9+
(-1, -1, 0),
10+
(0, -12, 0),
11+
(1, -1, 0),
12+
(12, 0, 0),
13+
(1, 1, 0),
14+
(0, 12, 0),
15+
(-1, 1, 0),
16+
(-12, 0, 0),
17+
]
18+
graph = create_interior_straight_skeleton(points)
19+
assert graph.number_of_edges() == 16
20+
21+
22+
def test_straight_skeleton_with_holes():
23+
points = [
24+
(-1, -1, 0),
25+
(0, -12, 0),
26+
(1, -1, 0),
27+
(12, 0, 0),
28+
(1, 1, 0),
29+
(0, 12, 0),
30+
(-1, 1, 0),
31+
(-12, 0, 0),
32+
]
33+
hole = [(-1, 0, 0), (0, 1, 0), (1, 0, 0), (0, -1, 0)]
34+
graph = create_interior_straight_skeleton_with_holes(points, [hole])
35+
assert graph.number_of_edges() == 32
36+
37+
38+
def test_offset():
39+
points = [
40+
(-1, -1, 0),
41+
(0, -12, 0),
42+
(1, -1, 0),
43+
(12, 0, 0),
44+
(1, 1, 0),
45+
(0, 12, 0),
46+
(-1, 1, 0),
47+
(-12, 0, 0),
48+
]
49+
offset = 0.5
50+
polygons = create_offset_polygons_2(points, offset)
51+
assert len(polygons) == 1, len(polygons)
52+
polygons = create_offset_polygons_2(points, -offset)
53+
assert len(polygons) == 1, len(polygons)
54+
weights = [0.1, 0.5, 0.3, 0.3, 0.9, 1.0, 0.2, 1.0]
55+
polygons = create_weighted_offset_polygons_2(points, offset, weights)
56+
assert len(polygons) == 1, len(polygons)
57+
polygons = create_weighted_offset_polygons_2(points, -offset, weights)
58+
assert len(polygons) == 1, len(polygons)

0 commit comments

Comments
 (0)