-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(surface): started test module for surfaces
- Loading branch information
1 parent
570f4c8
commit 773c171
Showing
1 changed file
with
24 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,24 @@ | ||
import pytest | ||
from hypervehicle.geometry.vector import Vector3 | ||
from hypervehicle.geometry.surface import CoonsPatch | ||
|
||
|
||
def test_coons_patch(): | ||
# Test instantiation by corners | ||
p00 = Vector3(0, 0, 0) | ||
p10 = Vector3(1, 0, 0) | ||
p01 = Vector3(0, 1, 0) | ||
p11 = Vector3(1, 1, 0) | ||
patch = CoonsPatch(p00=p00, p10=p10, p11=p11, p01=p01) | ||
|
||
assert patch.defined_by_corners == True | ||
|
||
# TODO - Test instantiation by edges | ||
|
||
# Test instantiation by mix of corners and edges | ||
with pytest.raises(Exception) as e_info: | ||
CoonsPatch() | ||
|
||
# Test interpolation | ||
assert patch(0, 0) == p00 | ||
assert patch(1, 1) == p11 |