-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2209 from mikedh/feat/sample_original
Feature: Include Original
- Loading branch information
Showing
3 changed files
with
87 additions
and
14 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 |
---|---|---|
|
@@ -5,7 +5,7 @@ requires = ["setuptools >= 61.0", "wheel"] | |
[project] | ||
name = "trimesh" | ||
requires-python = ">=3.7" | ||
version = "4.3.0" | ||
version = "4.3.1" | ||
authors = [{name = "Michael Dawson-Haggerty", email = "[email protected]"}] | ||
license = {file = "LICENSE.md"} | ||
description = "Import, export, process, analyze and view triangular meshes." | ||
|
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,21 @@ | ||
import numpy as np | ||
|
||
|
||
def test_resample_original(): | ||
# check to see if `include_original` works | ||
|
||
from shapely.geometry import Polygon | ||
|
||
from trimesh.path.traversal import resample_path | ||
|
||
ori = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]], dtype=np.float64) | ||
|
||
re = resample_path(ori, step=0.25, include_original=True) | ||
|
||
a, b = Polygon(ori), Polygon(re) | ||
assert np.isclose(a.area, b.area) | ||
assert np.isclose(a.length, b.length) | ||
|
||
|
||
if __name__ == "__main__": | ||
test_resample_original() |
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