Skip to content

Commit

Permalink
no more windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Oct 2, 2024
1 parent 6b29af0 commit 9467bdf
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python: ["3.11"]
os: [macos-latest]
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: compas-dev/compas-actions.build@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
docs:
runs-on: windows-latest
runs-on: macos-latest
steps:
- uses: compas-dev/compas-actions.docs@v3
with:
Expand Down
58 changes: 58 additions & 0 deletions tests/test_straight_skeleton_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from compas_cgal.straight_skeleton_2 import create_interior_straight_skeleton
from compas_cgal.straight_skeleton_2 import create_interior_straight_skeleton_with_holes
from compas_cgal.straight_skeleton_2 import create_offset_polygons_2
from compas_cgal.straight_skeleton_2 import create_weighted_offset_polygons_2


def test_straight_polygon():
points = [
(-1, -1, 0),
(0, -12, 0),
(1, -1, 0),
(12, 0, 0),
(1, 1, 0),
(0, 12, 0),
(-1, 1, 0),
(-12, 0, 0),
]
graph = create_interior_straight_skeleton(points)
assert graph.number_of_edges() == 16


def test_straight_skeleton_with_holes():
points = [
(-1, -1, 0),
(0, -12, 0),
(1, -1, 0),
(12, 0, 0),
(1, 1, 0),
(0, 12, 0),
(-1, 1, 0),
(-12, 0, 0),
]
hole = [(-1, 0, 0), (0, 1, 0), (1, 0, 0), (0, -1, 0)]
graph = create_interior_straight_skeleton_with_holes(points, [hole])
assert graph.number_of_edges() == 32


def test_offset():
points = [
(-1, -1, 0),
(0, -12, 0),
(1, -1, 0),
(12, 0, 0),
(1, 1, 0),
(0, 12, 0),
(-1, 1, 0),
(-12, 0, 0),
]
offset = 0.5
polygons = create_offset_polygons_2(points, offset)
assert len(polygons) == 1, len(polygons)
polygons = create_offset_polygons_2(points, -offset)
assert len(polygons) == 1, len(polygons)
weights = [0.1, 0.5, 0.3, 0.3, 0.9, 1.0, 0.2, 1.0]
polygons = create_weighted_offset_polygons_2(points, offset, weights)
assert len(polygons) == 1, len(polygons)
polygons = create_weighted_offset_polygons_2(points, -offset, weights)
assert len(polygons) == 1, len(polygons)

0 comments on commit 9467bdf

Please # to comment.