-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurface.py
33 lines (24 loc) · 812 Bytes
/
surface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Author: Dominic Williams
# Date created: 10 Aug 2022
#
# Classes for surfaces ( collection of faces ( list of indexes to vertices ))
from pydantic import BaseModel
from typing import List, Optional
class surface_cell(BaseModel):
vertex_list: List = []
normal: List = []
culled = False
index:Optional[int] = 0
# add index to the index list for this face
def add_face_index(self,vl:List):
self.vertex_list = vl
# return the number of vertex indices for this face
def face_index_count(self):
return(len(self.vertex_list))
class surface(BaseModel):
surface_list: List = []
def add_face(self,f:surface_cell) -> None:
self.surface_list.append(f)
return None
def surface_count(self) -> int:
return(len(self.surface_list))