-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fn interface, troubleshooting with sectionprop
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 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 @@ | ||
from .functional_interface import triangulate |
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,19 @@ | ||
from cytriangle.cytriangle import CyTriangle | ||
|
||
|
||
def triangulate(input_dict, flags): | ||
# parse regions | ||
raw_regions = input_dict["regions"] | ||
parsed_regions = [] | ||
for region in raw_regions: | ||
parsed_regions.append( | ||
{ | ||
"vertex": [region[0], region[1]], | ||
"marker": region[2], | ||
"max_area": region[3], | ||
} | ||
) | ||
input_dict["regions"] = parsed_regions | ||
input = CyTriangle(input_dict) | ||
input.triangulate(triswitches=flags) | ||
return input.out.to_dict() |