This commit is contained in:
2019-04-01 16:02:59 +04:00
commit 36d7f037c3
48 changed files with 1933 additions and 0 deletions

31
src/geometry/surface.py Normal file
View File

@@ -0,0 +1,31 @@
from dataclasses import dataclass
from typing import Optional
from geometry.ray import Ray
from geometry.vector import Vector
@dataclass
class Surface:
refraction_index: float
def __and__(self, v: Vector) -> bool:
"""
Does this point lie on the surface itself?
"""
raise NotImplementedError()
def __contains__(self, v: Vector) -> bool:
"""
Is this point _inside_ the region of space, separated by this surface?
"""
raise NotImplementedError()
def normal_at(self, v: Vector) -> Vector:
raise NotImplementedError()
def intersect(self, ray: Ray) -> Optional[float]:
raise NotImplementedError()
def draw2d(self, plt, **kwargs):
raise NotImplementedError()