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()