-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc60f46
commit 4310a02
Showing
5 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from compas.datastructures import Graph | ||
from compas.geometry import Polygon | ||
from compas_cgal.straight_skeleton_2 import create_offset_polygons_2 | ||
from compas_viewer import Viewer | ||
|
||
points = [ | ||
(-1.91, 3.59, 0.0), | ||
(-5.53, -5.22, 0.0), | ||
(-0.39, -1.98, 0.0), | ||
(2.98, -5.51, 0.0), | ||
(4.83, -2.02, 0.0), | ||
(9.70, -3.63, 0.0), | ||
(12.23, 1.25, 0.0), | ||
(3.42, 0.66, 0.0), | ||
(2.92, 4.03, 0.0), | ||
(-1.91, 3.59, 0.0), | ||
] | ||
polygon = Polygon(points) | ||
offset = 1.5 | ||
|
||
offset_polygons_inner = create_offset_polygons_2(points, offset) | ||
offset_polygons_outer = create_offset_polygons_2(points, -offset) | ||
|
||
# ============================================================================== | ||
# Viz | ||
# ============================================================================== | ||
|
||
viewer = Viewer(width=1600, height=900) | ||
viewer.scene.add(polygon) | ||
|
||
for opolygon in offset_polygons_inner: | ||
viewer.scene.add(opolygon, linecolor=(1.0, 0.0, 0.0)) | ||
for opolygon in offset_polygons_outer: | ||
viewer.scene.add(opolygon, linecolor=(0.0, 0.0, 1.0)) | ||
|
||
viewer.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters