Skip to content

Commit

Permalink
test(surface): started test module for surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-mackle committed Aug 25, 2024
1 parent 570f4c8 commit 773c171
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_surface.py
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

0 comments on commit 773c171

Please sign in to comment.