topologicpy 0.2.1__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. {topologicpy-0.2.1/src/topologicpy.egg-info → topologicpy-0.2.3}/PKG-INFO +1 -1
  2. {topologicpy-0.2.1 → topologicpy-0.2.3}/pyproject.toml +3 -1
  3. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Cell.py +129 -127
  4. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/CellComplex.py +21 -23
  5. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Cluster.py +7 -11
  6. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/DGL.py +10 -5
  7. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Face.py +124 -38
  8. topologicpy-0.2.3/src/topologicpy/Honeybee.py +357 -0
  9. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Plotly.py +51 -33
  10. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Shell.py +30 -50
  11. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Topology.py +231 -79
  12. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/UnitTest.py +2 -2
  13. topologicpy-0.2.3/src/topologicpy/Vector.py +448 -0
  14. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Wire.py +38 -66
  15. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/__init__.py +1 -1
  16. {topologicpy-0.2.1 → topologicpy-0.2.3/src/topologicpy.egg-info}/PKG-INFO +1 -1
  17. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy.egg-info/requires.txt +2 -0
  18. topologicpy-0.2.1/src/topologicpy/Honeybee.py +0 -533
  19. topologicpy-0.2.1/src/topologicpy/Vector.py +0 -223
  20. {topologicpy-0.2.1 → topologicpy-0.2.3}/LICENSE +0 -0
  21. {topologicpy-0.2.1 → topologicpy-0.2.3}/MANIFEST.in +0 -0
  22. {topologicpy-0.2.1 → topologicpy-0.2.3}/README.md +0 -0
  23. {topologicpy-0.2.1 → topologicpy-0.2.3}/setup.cfg +0 -0
  24. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Aperture.py +0 -0
  25. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Color.py +0 -0
  26. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Context.py +0 -0
  27. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Dictionary.py +0 -0
  28. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Edge.py +0 -0
  29. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/EnergyModel.py +0 -0
  30. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Graph.py +0 -0
  31. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Graph_Export.py +0 -0
  32. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Grid.py +0 -0
  33. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Helper.py +0 -0
  34. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Matrix.py +0 -0
  35. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Neo4jGraph.py +0 -0
  36. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Process.py +0 -0
  37. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/SQL.py +0 -0
  38. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Speckle.py +0 -0
  39. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/Vertex.py +0 -0
  40. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  41. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  42. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  43. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  44. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  45. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  46. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  47. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  48. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  49. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  50. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  51. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  52. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  53. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  54. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  55. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  56. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  57. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  58. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  59. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  60. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  61. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  62. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  63. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  64. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  65. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  66. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  67. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  68. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  69. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  70. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  71. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  72. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  73. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  74. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  75. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  76. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  77. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  78. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  79. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  80. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  81. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  82. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  83. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  84. {topologicpy-0.2.1 → topologicpy-0.2.3}/src/topologicpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -3,7 +3,7 @@ requires = ["setuptools>=61"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "topologicpy"
6
- version = "0.2.1"
6
+ version = "0.2.3"
7
7
  authors = [
8
8
  { name="Wassim Jabi", email="wassim.jabi@gmail.com" },
9
9
  ]
@@ -16,6 +16,8 @@ classifiers = [
16
16
  "Operating System :: OS Independent",
17
17
  ]
18
18
  dependencies = [
19
+ "honeybee_energy",
20
+ "honeybee_radiance",
19
21
  "ifcopenshell",
20
22
  "plotly",
21
23
  "numpy",
@@ -6,7 +6,7 @@ import math
6
6
 
7
7
  class Cell(Topology):
8
8
  @staticmethod
9
- def Area(cell, mantissa=4):
9
+ def Area(cell: topologic.Cell, mantissa: int = 4) -> float:
10
10
  """
11
11
  Returns the surface area of the input cell.
12
12
 
@@ -31,8 +31,7 @@ class Cell(Topology):
31
31
  return round(area, mantissa)
32
32
 
33
33
  @staticmethod
34
- def Box(origin=None, width=1, length=1, height=1, uSides=1, vSides=1, wSides=1, dirX=0,
35
- dirY=0, dirZ=1, placement="center"):
34
+ def Box(origin: topologic.Vertex = None, width: float = 1, length: float = 1, height: float = 1, uSides: int = 1, vSides:int = 1, wSides:int = 1, direction: list = [0,0,1], placement: str ="center") -> topologic.Cell:
36
35
  """
37
36
  Creates a box.
38
37
 
@@ -52,12 +51,8 @@ class Cell(Topology):
52
51
  The number of sides along the length. The default is 1.
53
52
  wSides : int , optional
54
53
  The number of sides along the height. The default is 1.
55
- dirX : float , optional
56
- The X component of the vector representing the up direction of the box. The default is 0.
57
- dirY : float , optional
58
- The Y component of the vector representing the up direction of the box. The default is 0.
59
- dirZ : float , optional
60
- The Z component of the vector representing the up direction of the box. The default is 1.
54
+ direction : list , optional
55
+ The vector representing the up direction of the box. The default is [0,0,1].
61
56
  placement : str , optional
62
57
  The description of the placement of the origin of the box. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
63
58
 
@@ -67,11 +62,10 @@ class Cell(Topology):
67
62
  The created box.
68
63
 
69
64
  """
70
- return Cell.Prism(origin=origin, width=width, length=length, height=height, uSides=uSides, vSides=vSides, wSides=wSides, dirX=dirX,
71
- dirY=dirY, dirZ=dirZ, placement=placement)
65
+ return Cell.Prism(origin=origin, width=width, length=length, height=height, uSides=uSides, vSides=vSides, wSides=wSides, direction=direction, placement=placement)
72
66
 
73
67
  @staticmethod
74
- def ByFaces(faces, tolerance=0.0001):
68
+ def ByFaces(faces: list, planarize: bool = False, tolerance: float = 0.0001) -> topologic.Cell:
75
69
  """
76
70
  Creates a cell from the input list of faces.
77
71
 
@@ -79,6 +73,8 @@ class Cell(Topology):
79
73
  ----------
80
74
  faces : list
81
75
  The input list of faces.
76
+ planarize : bool, optional
77
+ If set to True, the input faces are planarized before building the cell. Otherwise, they are not. The default is False.
82
78
  tolerance : float , optional
83
79
  The desired tolerance. The default is 0.0001.
84
80
 
@@ -88,18 +84,40 @@ class Cell(Topology):
88
84
  The created cell.
89
85
 
90
86
  """
87
+ from topologicpy.Wire import Wire
88
+ from topologicpy.Face import Face
89
+ from topologicpy.Topology import Topology
91
90
  from topologicpy.Cluster import Cluster
92
91
  if not isinstance(faces, list):
93
92
  return None
94
93
  faceList = [x for x in faces if isinstance(x, topologic.Face)]
95
- cell = topologic.Cell.ByFaces(faceList, tolerance)
96
- if cell:
97
- return cell
98
- else:
94
+ if len(faceList) < 1:
99
95
  return None
96
+ planarizedList = []
97
+ enlargedList = []
98
+ if planarize:
99
+ planarizedList = [Face.Planarize(f) for f in faceList]
100
+ enlargedList = [Face.ByOffset(f, offset=-tolerance*10) for f in planarizedList]
101
+ cell = topologic.Cell.ByFaces(enlargedList, tolerance)
102
+ faces = Topology.SubTopologies(cell, subTopologyType="face")
103
+ finalFaces = []
104
+ for f in faces:
105
+ centroid = Topology.Centroid(f)
106
+ n = Face.Normal(f)
107
+ v = Topology.Translate(centroid, n[0]*0.01,n[1]*0.01,n[2]*0.01)
108
+ if not Cell.IsInside(cell, v):
109
+ finalFaces.append(f)
110
+ finalFinalFaces = []
111
+ for f in finalFaces:
112
+ vertices = Face.Vertices(f)
113
+ w = Wire.Cycles(Face.ExternalBoundary(f), maxVertices=len(vertices))[0]
114
+ finalFinalFaces.append(Face.ByWire(w))
115
+ return topologic.Cell.ByFaces(finalFinalFaces)
116
+ else:
117
+ return topologic.Cell.ByFaces(faces, tolerance)
100
118
 
101
119
  @staticmethod
102
- def ByShell(shell):
120
+ def ByShell(shell: topologic.Shell, planarize: bool = False, tolerance: float = 0.0001) -> topologic.Cell:
103
121
  """
104
122
  Creates a cell from the input shell.
105
123
 
@@ -107,6 +125,10 @@ class Cell(Topology):
107
125
  ----------
108
126
  shell : topologic.Shell
109
127
  The input shell. The shell must be closed for this method to succeed.
128
+ planarize : bool, optional
129
+ If set to True, the input faces of the input shell are planarized before building the cell. Otherwise, they are not. The default is False.
130
+ tolerance : float , optional
131
+ The desired tolerance. The default is 0.0001.
110
132
 
111
133
  Returns
112
134
  -------
@@ -114,15 +136,15 @@ class Cell(Topology):
114
136
  The created cell.
115
137
 
116
138
  """
117
-
118
- try:
119
- return topologic.Cell.ByShell(shell)
120
- except:
139
+ from topologicpy.Topology import Topology
140
+ if not isinstance(shell, topologic.Shell):
121
141
  return None
142
+ faces = Topology.SubTopologies(shell, subTopologyType="face")
143
+ return Cell.ByFaces(faces, planarize=planarize, tolerance=tolerance)
122
144
 
123
145
  @staticmethod
124
- def ByThickenedFace(face, thickness=1.0, bothSides=True, reverse=False,
125
- tolerance=0.0001):
146
+ def ByThickenedFace(face: topologic.Face, thickness: float = 1.0, bothSides: bool = True, reverse: bool = False,
147
+ tolerance: float = 0.0001) -> topologic.Cell:
126
148
  """
127
149
  Creates a cell by thickening the input face.
128
150
 
@@ -145,34 +167,37 @@ class Cell(Topology):
145
167
  The created cell.
146
168
 
147
169
  """
170
+ from topologicpy.Edge import Edge
171
+ from topologicpy.Face import Face
148
172
  from topologicpy.Cluster import Cluster
173
+ from topologicpy.Topology import Topology
149
174
 
150
175
  if not isinstance(face, topologic.Face):
151
176
  return None
152
177
  if reverse == True and bothSides == False:
153
178
  thickness = -thickness
154
- faceNormal = topologic.FaceUtility.NormalAtParameters(face, 0.5, 0.5)
179
+ faceNormal = Face.Normal(face)
155
180
  if bothSides:
156
- bottomFace = topologic.TopologyUtility.Translate(face, -faceNormal[0]*0.5*thickness, -faceNormal[1]*0.5*thickness, -faceNormal[2]*0.5*thickness)
157
- topFace = topologic.TopologyUtility.Translate(face, faceNormal[0]*0.5*thickness, faceNormal[1]*0.5*thickness, faceNormal[2]*0.5*thickness)
181
+ bottomFace = Topology.Translate(face, -faceNormal[0]*0.5*thickness, -faceNormal[1]*0.5*thickness, -faceNormal[2]*0.5*thickness)
182
+ topFace = Topology.Translate(face, faceNormal[0]*0.5*thickness, faceNormal[1]*0.5*thickness, faceNormal[2]*0.5*thickness)
158
183
  else:
159
184
  bottomFace = face
160
- topFace = topologic.TopologyUtility.Translate(face, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
185
+ topFace = Topology.Translate(face, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
161
186
 
162
187
  cellFaces = [bottomFace, topFace]
163
188
  bottomEdges = []
164
189
  _ = bottomFace.Edges(None, bottomEdges)
165
190
  for bottomEdge in bottomEdges:
166
- topEdge = topologic.TopologyUtility.Translate(bottomEdge, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
167
- sideEdge1 = topologic.Edge.ByStartVertexEndVertex(bottomEdge.StartVertex(), topEdge.StartVertex())
168
- sideEdge2 = topologic.Edge.ByStartVertexEndVertex(bottomEdge.EndVertex(), topEdge.EndVertex())
191
+ topEdge = Topology.Translate(bottomEdge, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
192
+ sideEdge1 = Edge.ByVertices([bottomEdge.StartVertex(), topEdge.StartVertex()])
193
+ sideEdge2 = Edge.ByVertices([bottomEdge.EndVertex(), topEdge.EndVertex()])
169
194
  cellWire = Cluster.SelfMerge(Cluster.ByTopologies([bottomEdge, sideEdge1, topEdge, sideEdge2]))
170
- cellFaces.append(topologic.Face.ByExternalBoundary(cellWire))
171
- return topologic.Cell.ByFaces(cellFaces, tolerance)
195
+ cellFaces.append(Face.ByWire(cellWire))
196
+ return Cell.ByFaces(cellFaces, planarize=False, tolerance=tolerance)
172
197
 
173
198
  @staticmethod
174
- def ByThickenedShell(shell, direction=[0,0,1], thickness=1.0, bothSides=True, reverse=False,
175
- tolerance=0.0001):
199
+ def ByThickenedShell(shell: topologic.Shell, direction: list = [0,0,1], thickness: float = 1.0, bothSides: bool = True, reverse: bool = False,
200
+ tolerance: float = 0.0001) -> topologic.Cell:
176
201
  """
177
202
  Creates a cell by thickening the input shell. The shell must be open.
178
203
 
@@ -221,10 +246,10 @@ class Cell(Topology):
221
246
  cellWire = Cluster.SelfMerge(Cluster.ByTopologies([bottomEdge, sideEdge1, topEdge, sideEdge2]))
222
247
  cellFace = Face.ByWire(cellWire)
223
248
  cellFaces.append(cellFace)
224
- return Cell.ByFaces(cellFaces, tolerance=tolerance)
249
+ return Cell.ByFaces(cellFaces, palanarize=False, tolerance=tolerance)
225
250
 
226
251
  @staticmethod
227
- def ByWires(wires, close=False, triangulate=True, tolerance=0.0001):
252
+ def ByWires(wires: list, close: bool = False, triangulate: bool = True, tolerance: float = 0.0001) -> topologic.Cell:
228
253
  """
229
254
  Creates a cell by lofting through the input list of wires.
230
255
 
@@ -330,7 +355,7 @@ class Cell(Topology):
330
355
  return Cell.ByFaces(faces, tolerance)
331
356
 
332
357
  @staticmethod
333
- def ByWiresCluster(cluster, close=False, triangulate=True, tolerance=0.0001):
358
+ def ByWiresCluster(cluster: topologic.Cluster, close: bool = False, triangulate: bool = True, tolerance: float = 0.0001) -> topologic.Cell:
334
359
  """
335
360
  Creates a cell by lofting through the input cluster of wires.
336
361
 
@@ -363,7 +388,7 @@ class Cell(Topology):
363
388
  return Cell.ByWires(wires, close=close, tolerance=tolerance)
364
389
 
365
390
  @staticmethod
366
- def Compactness(cell, mantissa=4):
391
+ def Compactness(cell: topologic.Cell, mantissa: int = 4) -> float:
367
392
  """
368
393
  Returns the compactness measure of the input cell. This is also known as 'sphericity' (https://en.wikipedia.org/wiki/Sphericity).
369
394
 
@@ -400,8 +425,8 @@ class Cell(Topology):
400
425
  return round(compactness, mantissa)
401
426
 
402
427
  @staticmethod
403
- def Cone(origin=None, baseRadius=0.5, topRadius=0, height=1, uSides=16, vSides=1, dirX=0, dirY=0,
404
- dirZ=1, placement="center", tolerance=0.0001):
428
+ def Cone(origin: topologic.Vertex = None, baseRadius: float = 0.5, topRadius: float = 0, height: float = 1, uSides: int = 16, vSides: int = 1, direction: list = [0,0,1],
429
+ dirZ: float = 1, placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
405
430
  """
406
431
  Creates a cone.
407
432
 
@@ -417,12 +442,8 @@ class Cell(Topology):
417
442
  The height of the cone. The default is 1.
418
443
  sides : int , optional
419
444
  The number of sides of the cone. The default is 16.
420
- dirX : float , optional
421
- The X component of the vector representing the up direction of the cone. The default is 0.
422
- dirY : float , optional
423
- The Y component of the vector representing the up direction of the cone. The default is 0.
424
- dirZ : float , optional
425
- The Z component of the vector representing the up direction of the cone. The default is 1.
445
+ direction : list , optional
446
+ The vector representing the up direction of the cone. The default is [0,0,1].
426
447
  placement : str , optional
427
448
  The description of the placement of the origin of the cone. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
428
449
  tolerance : float , optional
@@ -523,9 +544,9 @@ class Cell(Topology):
523
544
  x1 = origin.X()
524
545
  y1 = origin.Y()
525
546
  z1 = origin.Z()
526
- x2 = origin.X() + dirX
527
- y2 = origin.Y() + dirY
528
- z2 = origin.Z() + dirZ
547
+ x2 = origin.X() + direction[0]
548
+ y2 = origin.Y() + direction[1]
549
+ z2 = origin.Z() + direction[2]
529
550
  dx = x2 - x1
530
551
  dy = y2 - y1
531
552
  dz = z2 - z1
@@ -540,8 +561,8 @@ class Cell(Topology):
540
561
  return cone
541
562
 
542
563
  @staticmethod
543
- def Cylinder(origin=None, radius=0.5, height=1, uSides=16, vSides=1, dirX=0, dirY=0, dirZ=1,
544
- placement="center", tolerance=0.0001):
564
+ def Cylinder(origin: topologic.Vertex = None, radius: float = 0.5, height: float = 1, uSides: int = 16, vSides:int = 1, direction: list = [0,0,1],
565
+ placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
545
566
  """
546
567
  Creates a cylinder.
547
568
 
@@ -557,12 +578,8 @@ class Cell(Topology):
557
578
  The number of circle segments of the cylinder. The default is 16.
558
579
  vSides : int , optional
559
580
  The number of vertical segments of the cylinder. The default is 1.
560
- dirX : float , optional
561
- The X component of the vector representing the up direction of the cylinder. The default is 0.
562
- dirY : float , optional
563
- The Y component of the vector representing the up direction of the cylinder. The default is 0.
564
- dirZ : float , optional
565
- The Z component of the vector representing the up direction of the cylinder. The default is 1.
581
+ direction : list , optional
582
+ The vector representing the up direction of the cylinder. The default is [0,0,1].
566
583
  placement : str , optional
567
584
  The description of the placement of the origin of the cylinder. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "bottom".
568
585
  tolerance : float , optional
@@ -593,8 +610,7 @@ class Cell(Topology):
593
610
  yOffset = radius
594
611
  circle_origin = Vertex.ByCoordinates(origin.X() + xOffset, origin.Y() + yOffset, origin.Z() + zOffset)
595
612
 
596
- baseWire = Wire.Circle(origin=circle_origin, radius=radius, sides=uSides, fromAngle=0, toAngle=360, close=True, dirX=0,
597
- dirY=0, dirZ=1, placement="center", tolerance=tolerance)
613
+ baseWire = Wire.Circle(origin=circle_origin, radius=radius, sides=uSides, fromAngle=0, toAngle=360, close=True, direction=[0,0,1], placement="center", tolerance=tolerance)
598
614
  baseFace = Face.ByWire(baseWire)
599
615
  cylinder = Cell.ByThickenedFace(face=baseFace, thickness=height, bothSides=False, reverse=False,
600
616
  tolerance=tolerance)
@@ -613,9 +629,9 @@ class Cell(Topology):
613
629
  x1 = origin.X()
614
630
  y1 = origin.Y()
615
631
  z1 = origin.Z()
616
- x2 = origin.X() + dirX
617
- y2 = origin.Y() + dirY
618
- z2 = origin.Z() + dirZ
632
+ x2 = origin.X() + direction[0]
633
+ y2 = origin.Y() + direction[1]
634
+ z2 = origin.Z() + direction[2]
619
635
  dx = x2 - x1
620
636
  dy = y2 - y1
621
637
  dz = z2 - z1
@@ -630,7 +646,7 @@ class Cell(Topology):
630
646
  return cylinder
631
647
 
632
648
  @staticmethod
633
- def Decompose(cell, tiltAngle=10, tolerance=0.0001):
649
+ def Decompose(cell: topologic.Cell, tiltAngle: float = 10, tolerance: float = 0.0001) -> dict:
634
650
  """
635
651
  Decomposes the input cell into its logical components. This method assumes that the positive Z direction is UP.
636
652
 
@@ -738,7 +754,7 @@ class Cell(Topology):
738
754
  return d
739
755
 
740
756
  @staticmethod
741
- def Edges(cell):
757
+ def Edges(cell: topologic.Cell) -> list:
742
758
  """
743
759
  Returns the edges of the input cell.
744
760
 
@@ -760,7 +776,7 @@ class Cell(Topology):
760
776
  return edges
761
777
 
762
778
  @staticmethod
763
- def ExternalBoundary(cell):
779
+ def ExternalBoundary(cell: topologic.Cell) -> topologic.Shell:
764
780
  """
765
781
  Returns the external boundary of the input cell.
766
782
 
@@ -785,7 +801,7 @@ class Cell(Topology):
785
801
  return None
786
802
 
787
803
  @staticmethod
788
- def Faces(cell):
804
+ def Faces(cell: topologic.Cell) -> list:
789
805
  """
790
806
  Returns the faces of the input cell.
791
807
 
@@ -807,8 +823,8 @@ class Cell(Topology):
807
823
  return faces
808
824
 
809
825
  @staticmethod
810
- def Hyperboloid(origin=None, baseRadius=0.5, topRadius=0.5, height=1, sides=16, dirX=0,
811
- dirY=0, dirZ=1, twist=360, placement="center", tolerance=0.0001):
826
+ def Hyperboloid(origin: topologic.Cell = None, baseRadius: float = 0.5, topRadius: float = 0.5, height: float = 1, sides: int = 16, direction: list = [0,0,1],
827
+ twist: float = 360, placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
812
828
  """
813
829
  Creates a hyperboloid.
814
830
 
@@ -824,12 +840,8 @@ class Cell(Topology):
824
840
  The height of the cone. The default is 1.
825
841
  sides : int , optional
826
842
  The number of sides of the cone. The default is 16.
827
- dirX : float , optional
828
- The X component of the vector representing the up direction of the hyperboloid. The default is 0.
829
- dirY : float , optional
830
- The Y component of the vector representing the up direction of the hyperboloid. The default is 0.
831
- dirZ : float , optional
832
- The Z component of the vector representing the up direction of the hyperboloid. The default is 1.
843
+ direction : list , optional
844
+ The vector representing the up direction of the hyperboloid. The default is [0,0,1].
833
845
  twist : float , optional
834
846
  The angle to twist the base cylinder. The default is 360.
835
847
  placement : str , optional
@@ -904,9 +916,9 @@ class Cell(Topology):
904
916
  x1 = origin.X()
905
917
  y1 = origin.Y()
906
918
  z1 = origin.Z()
907
- x2 = origin.X() + dirX
908
- y2 = origin.Y() + dirY
909
- z2 = origin.Z() + dirZ
919
+ x2 = origin.X() + direction[0]
920
+ y2 = origin.Y() + direction[1]
921
+ z2 = origin.Z() + direction[2]
910
922
  dx = x2 - x1
911
923
  dy = y2 - y1
912
924
  dz = z2 - z1
@@ -921,7 +933,7 @@ class Cell(Topology):
921
933
  return hyperboloid
922
934
 
923
935
  @staticmethod
924
- def InternalBoundaries(cell):
936
+ def InternalBoundaries(cell: topologic.Cell) -> list:
925
937
  """
926
938
  Returns the internal boundaries of the input cell.
927
939
 
@@ -941,7 +953,7 @@ class Cell(Topology):
941
953
  return shells
942
954
 
943
955
  @staticmethod
944
- def InternalVertex(cell, tolerance=0.0001):
956
+ def InternalVertex(cell: topologic.Cell, tolerance: float = 0.0001):
945
957
  """
946
958
  Creates a vertex that is guaranteed to be inside the input cell.
947
959
 
@@ -968,7 +980,7 @@ class Cell(Topology):
968
980
  return None
969
981
 
970
982
  @staticmethod
971
- def IsInside(cell, vertex, tolerance=0.0001):
983
+ def IsInside(cell: topologic.Cell, vertex: topologic.Vertex, tolerance: float = 0.0001) -> bool:
972
984
  """
973
985
  Returns True if the input vertex is inside the input cell. Returns False otherwise.
974
986
 
@@ -997,7 +1009,7 @@ class Cell(Topology):
997
1009
  return None
998
1010
 
999
1011
  @staticmethod
1000
- def Pipe(edge, profile=None, radius=0.5, sides=16, startOffset=0, endOffset=0, endcapA=None, endcapB=None):
1012
+ def Pipe(edge: topologic.Edge, profile: topologic.Wire = None, radius: float = 0.5, sides: int = 16, startOffset: float = 0, endOffset: float = 0, endcapA: topologic.Topology = None, endcapB: topologic.Topology = None) -> dict:
1001
1013
  """
1002
1014
  Description
1003
1015
  ----------
@@ -1024,8 +1036,11 @@ class Cell(Topology):
1024
1036
 
1025
1037
  Returns
1026
1038
  -------
1027
- list
1028
- A list containing the pipe as the first element, the start endcap as the second element, and the end endcap as the last element if they have been specified.
1039
+ dict
1040
+ A dictionary containing the pipe, the start endcap, and the end endcap if they have been specified. The dictionary has the following keys:
1041
+ 'pipe'
1042
+ 'endcapA'
1043
+ 'endcapB'
1029
1044
 
1030
1045
  """
1031
1046
  from topologicpy.Topology import Topology
@@ -1123,11 +1138,11 @@ class Cell(Topology):
1123
1138
  endcapB = topologic.TopologyUtility.Rotate(endcapB, zzz, 0, 0, 1, phi + 180)
1124
1139
  endcapB = topologic.TopologyUtility.Translate(endcapB, origin.X(), origin.Y(), origin.Z())
1125
1140
  returnList.append(endcapB)
1126
- return returnList
1141
+ return {'pipe': returnList[0], 'endcapA': returnList[1], 'endcapB': returnList[2]}
1127
1142
 
1128
1143
  @staticmethod
1129
- def Prism(origin=None, width=1, length=1, height=1, uSides=1, vSides=1, wSides=1, dirX=0,
1130
- dirY=0, dirZ=1, placement="center"):
1144
+ def Prism(origin: topologic.Vertex = None, width: float = 1, length: float = 1, height: float = 1, uSides: int = 1, vSides: int = 1, wSides: int = 1,
1145
+ direction: list = [0,0,1], placement: str ="center") -> topologic.Cell:
1131
1146
  """
1132
1147
  Description
1133
1148
  ----------
@@ -1149,12 +1164,8 @@ class Cell(Topology):
1149
1164
  The number of sides along the length. The default is 1.
1150
1165
  wSides : int , optional
1151
1166
  The number of sides along the height. The default is 1.
1152
- dirX : float , optional
1153
- The X component of the vector representing the up direction of the prism. The default is 0.
1154
- dirY : float , optional
1155
- The Y component of the vector representing the up direction of the prism. The default is 0.
1156
- dirZ : float , optional
1157
- The Z component of the vector representing the up direction of the prism. The default is 1.
1167
+ direction : list , optional
1168
+ The vector representing the up direction of the prism. The default is [0,0,1].
1158
1169
  placement : str , optional
1159
1170
  The description of the placement of the origin of the prism. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
1160
1171
 
@@ -1215,9 +1226,9 @@ class Cell(Topology):
1215
1226
  x1 = origin.X()
1216
1227
  y1 = origin.Y()
1217
1228
  z1 = origin.Z()
1218
- x2 = origin.X() + dirX
1219
- y2 = origin.Y() + dirY
1220
- z2 = origin.Z() + dirZ
1229
+ x2 = origin.X() + direction[0]
1230
+ y2 = origin.Y() + direction[1]
1231
+ z2 = origin.Z() + direction[2]
1221
1232
  dx = x2 - x1
1222
1233
  dy = y2 - y1
1223
1234
  dz = z2 - z1
@@ -1232,7 +1243,7 @@ class Cell(Topology):
1232
1243
  return prism
1233
1244
 
1234
1245
  @staticmethod
1235
- def Sets(inputCells, superCells, tolerance=0.0001):
1246
+ def Sets(inputCells: list, superCells: list, tolerance: float = 0.0001) -> list:
1236
1247
  """
1237
1248
  Classifies the input cells into sets based on their enclosure within the input list of super cells. The order of the sets follows the order of the input list of super cells.
1238
1249
 
@@ -1275,7 +1286,7 @@ class Cell(Topology):
1275
1286
  return sets
1276
1287
 
1277
1288
  @staticmethod
1278
- def Shells(cell):
1289
+ def Shells(cell: topologic.Cell) -> list:
1279
1290
  """
1280
1291
  Returns the shells of the input cell.
1281
1292
 
@@ -1297,8 +1308,8 @@ class Cell(Topology):
1297
1308
  return shells
1298
1309
 
1299
1310
  @staticmethod
1300
- def Sphere(origin=None, radius=0.5, uSides=16, vSides=8, dirX=0, dirY=0, dirZ=1,
1301
- placement="center", tolerance=0.0001):
1311
+ def Sphere(origin: topologic.Vertex = None, radius: float = 0.5, uSides: int = 16, vSides: int = 8, direction: list = [0,0,1],
1312
+ placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
1302
1313
  """
1303
1314
  Creates a sphere.
1304
1315
 
@@ -1312,12 +1323,8 @@ class Cell(Topology):
1312
1323
  The number of sides along the longitude of the sphere. The default is 16.
1313
1324
  vSides : int , optional
1314
1325
  The number of sides along the latitude of the sphere. The default is 8.
1315
- dirX : float , optional
1316
- The X component of the vector representing the up direction of the sphere. The default is 0.
1317
- dirY : float , optional
1318
- The Y component of the vector representing the up direction of the sphere. The default is 0.
1319
- dirZ : float , optional
1320
- The Z component of the vector representing the up direction of the sphere. The default is 1.
1326
+ direction : list , optional
1327
+ The vector representing the up direction of the sphere. The default is [0,0,1].
1321
1328
  placement : str , optional
1322
1329
  The description of the placement of the origin of the sphere. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
1323
1330
  tolerance : float , optional
@@ -1336,7 +1343,7 @@ class Cell(Topology):
1336
1343
  if not isinstance(origin, topologic.Vertex):
1337
1344
  return None
1338
1345
  c = Wire.Circle(origin, radius, vSides, 90, 270, False, 0, 1, 0, "center")
1339
- s = Topology.Spin(c, origin=origin, triangulate=False, dirX=0, dirY=0, dirZ=1, degree=360, sides=uSides, tolerance=tolerance)
1346
+ s = Topology.Spin(c, origin=origin, triangulate=False, direction=[0,0,1], degree=360, sides=uSides, tolerance=tolerance)
1340
1347
  if s.Type() == topologic.CellComplex.Type():
1341
1348
  s = s.ExternalBoundary()
1342
1349
  if s.Type() == topologic.Shell.Type():
@@ -1348,9 +1355,9 @@ class Cell(Topology):
1348
1355
  x1 = origin.X()
1349
1356
  y1 = origin.Y()
1350
1357
  z1 = origin.Z()
1351
- x2 = origin.X() + dirX
1352
- y2 = origin.Y() + dirY
1353
- z2 = origin.Z() + dirZ
1358
+ x2 = origin.X() + direction[0]
1359
+ y2 = origin.Y() + direction[1]
1360
+ z2 = origin.Z() + direction[2]
1354
1361
  dx = x2 - x1
1355
1362
  dy = y2 - y1
1356
1363
  dz = z2 - z1
@@ -1365,7 +1372,7 @@ class Cell(Topology):
1365
1372
  return s
1366
1373
 
1367
1374
  @staticmethod
1368
- def SurfaceArea(cell, mantissa=4):
1375
+ def SurfaceArea(cell: topologic.Cell, mantissa: int = 4) -> float:
1369
1376
  """
1370
1377
  Returns the surface area of the input cell.
1371
1378
 
@@ -1382,11 +1389,10 @@ class Cell(Topology):
1382
1389
  The surface area of the input cell.
1383
1390
 
1384
1391
  """
1385
- return Cell.Area(cell, mantissa)
1392
+ return Cell.Area(cell=cell, mantissa=mantissa)
1386
1393
 
1387
1394
  @staticmethod
1388
- def Torus(origin=None, majorRadius=0.5, minorRadius=0.125, uSides=16, vSides=8, dirX=0, dirY=0,
1389
- dirZ=1, placement="center", tolerance=0.0001):
1395
+ def Torus(origin: topologic.Vertex = None, majorRadius: float = 0.5, minorRadius: float = 0.125, uSides: int = 16, vSides: int = 8, direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
1390
1396
  """
1391
1397
  Creates a torus.
1392
1398
 
@@ -1402,14 +1408,10 @@ class Cell(Topology):
1402
1408
  The number of sides along the longitude of the torus. The default is 16.
1403
1409
  vSides : int , optional
1404
1410
  The number of sides along the latitude of the torus. The default is 8.
1405
- dirX : float , optional
1406
- The X component of the vector representing the up direction of the sphere. The default is 0.
1407
- dirY : float , optional
1408
- The Y component of the vector representing the up direction of the sphere. The default is 0.
1409
- dirZ : float , optional
1410
- The Z component of the vector representing the up direction of the sphere. The default is 1.
1411
+ direction : list , optional
1412
+ The vector representing the up direction of the torus. The default is [0,0,1].
1411
1413
  placement : str , optional
1412
- The description of the placement of the origin of the sphere. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
1414
+ The description of the placement of the origin of the torus. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
1413
1415
  tolerance : float , optional
1414
1416
  The desired tolerance. The default is 0.0001.
1415
1417
 
@@ -1428,7 +1430,7 @@ class Cell(Topology):
1428
1430
  return None
1429
1431
  c = Wire.Circle(origin, minorRadius, vSides, 0, 360, False, 0, 1, 0, "center")
1430
1432
  c = topologic.TopologyUtility.Translate(c, abs(majorRadius-minorRadius), 0, 0)
1431
- s = Topology.Spin(c, origin=origin, triangulate=False, dirX=0, dirY=0, dirZ=1, degree=360, sides=uSides, tolerance=tolerance)
1433
+ s = Topology.Spin(c, origin=origin, triangulate=False, direction=[0,0,1], degree=360, sides=uSides, tolerance=tolerance)
1432
1434
  if s.Type() == topologic.Shell.Type():
1433
1435
  s = topologic.Cell.ByShell(s)
1434
1436
  #s = Topology.RemoveCoplanarFaces(s, angTol=0.1, tolerance=tolerance)
@@ -1439,9 +1441,9 @@ class Cell(Topology):
1439
1441
  x1 = origin.X()
1440
1442
  y1 = origin.Y()
1441
1443
  z1 = origin.Z()
1442
- x2 = origin.X() + dirX
1443
- y2 = origin.Y() + dirY
1444
- z2 = origin.Z() + dirZ
1444
+ x2 = origin.X() + direction[0]
1445
+ y2 = origin.Y() + direction[1]
1446
+ z2 = origin.Z() + direction[2]
1445
1447
  dx = x2 - x1
1446
1448
  dy = y2 - y1
1447
1449
  dz = z2 - z1
@@ -1456,7 +1458,7 @@ class Cell(Topology):
1456
1458
  return s
1457
1459
 
1458
1460
  @staticmethod
1459
- def Vertices(cell):
1461
+ def Vertices(cell: topologic.Cell) -> list:
1460
1462
  """
1461
1463
  Returns the vertices of the input cell.
1462
1464
 
@@ -1478,7 +1480,7 @@ class Cell(Topology):
1478
1480
  return vertices
1479
1481
 
1480
1482
  @staticmethod
1481
- def Volume(cell, mantissa=4):
1483
+ def Volume(cell: topologic.Cell, mantissa: int = 4) -> float:
1482
1484
  """
1483
1485
  Returns the volume of the input cell.
1484
1486
 
@@ -1500,7 +1502,7 @@ class Cell(Topology):
1500
1502
  return round(topologic.CellUtility.Volume(cell), mantissa)
1501
1503
 
1502
1504
  @staticmethod
1503
- def Wires(cell):
1505
+ def Wires(cell: topologic.Cell) -> list:
1504
1506
  """
1505
1507
  Returns the wires of the input cell.
1506
1508