add vertex class

This commit is contained in:
2026-01-12 19:28:01 +01:00
parent 8fd776260d
commit 71e86e0aa1

View File

@@ -1,7 +1,23 @@
import re import re
import numpy as np
from fvr.typing import FloatArray from fvr.typing import FloatArray
class polygon: class Vertex(np.ndarray):
"""Point in 2d space using homogeneous coordinates."""
def __init__(cls, x=0, y=0):
obj = np.asarray([x, y, 1]).view(cls)
@property
def x(self):
return self[0]
@property
def y(self):
return self[1]
class Polygon:
r"""Properties of a simple polygon. r"""Properties of a simple polygon.
""" """