-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.py
79 lines (50 loc) · 1.72 KB
/
type.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from typing import TypedDict, Dict, List
from superclasses import ProjectedLineStringWithId, ThreeDLineStringWithId, TwoDPoint, ThreeDPoint
class AnEdge(TypedDict):
verticesIds: List[str]
class AVertex(TypedDict):
x: float
y: float
z: float
class Raw2DShape(TypedDict):
# a shape is made up of vertices linked by edges. Edges can be cyclic or acyclic, joint or disjointed.
type: str
vertices: Dict[str, AVertex]
edges: Dict[str, AnEdge]
Raw2DProjections = Dict[str, Raw2DShape] # projection[axes] -> shape[id] -> [edge, vertices, faces]
class AParsedShape(TypedDict):
edges: Dict[str, ProjectedLineStringWithId]
vertices: Dict[str, TwoDPoint]
type: str
class Parsed2DProjections(TypedDict):
xy: AParsedShape
xz: AParsedShape
yz: AParsedShape
Reconstructed3DVertices = Dict[str, ThreeDPoint]
Reconstructed3DEdges = Dict[str, ThreeDLineStringWithId]
DandlingEdges = Dict[str, ProjectedLineStringWithId]
class DandlingGeometry(TypedDict):
vertices: Reconstructed3DVertices
edges: DandlingEdges
class ReconstructedGeometry(TypedDict):
vertices: Reconstructed3DVertices
edges: Reconstructed3DEdges
class Reconstructed3DModel(TypedDict):
reconstructed: ReconstructedGeometry
dandling: DandlingGeometry
class ExportedPoint:
id: str
ancestorsIds: List[str]
x: float
y: float
z: float
class ExportedLine:
id: str
ancestorsIds: List[str]
threeDPointsIds: List[str]
class ExportedReconstructedGeometry(TypedDict):
vertices: Dict[str, ExportedPoint]
edges: Dict[str, ExportedLine]
class ExportedReconstructed3DModel(TypedDict):
reconstructed: ExportedReconstructedGeometry
dandling: ExportedReconstructedGeometry