topologicpy 0.6.3__py3-none-any.whl → 0.7.0__py3-none-any.whl

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.
topologicpy/Grid.py CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  import topologic_core as topologic
18
18
 
19
- class Grid(topologic.Cluster):
19
+ class Grid():
20
20
  @staticmethod
21
21
  def EdgesByDistances(face=None, uOrigin=None, vOrigin=None, uRange=[-0.5,-0.25,0, 0.25,0.5], vRange=[-0.5,-0.25,0, 0.25,0.5], clip=False, tolerance=0.0001):
22
22
  """
@@ -24,11 +24,11 @@ class Grid(topologic.Cluster):
24
24
 
25
25
  Parameters
26
26
  ----------
27
- face : topologic.Face , optional
27
+ face : topologic_core.Face , optional
28
28
  The input face. If set to None, the grid will be created on the XY plane. The default is None.
29
- uOrigin : topologic.Vertex , optional
29
+ uOrigin : topologic_core.Vertex , optional
30
30
  The origin of the *u* grid lines. If set to None: if the face is set, the uOrigin will be set to vertex at the face's 0,0 paratmer. If the face is set to None, the uOrigin will be set to the origin. The default is None.
31
- vOrigin : topologic.Vertex , optional
31
+ vOrigin : topologic_core.Vertex , optional
32
32
  The origin of the *v* grid lines. If set to None: if the face is set, the vOrigin will be set to vertex at the face's 0,0 paratmer. If the face is set to None, the vOrigin will be set to the origin. The default is None.
33
33
  uRange : list , optional
34
34
  A list of distances for the *u* grid lines from the uOrigin. The default is [-0.5,-0.25,0, 0.25,0.5].
@@ -41,7 +41,7 @@ class Grid(topologic.Cluster):
41
41
 
42
42
  Returns
43
43
  -------
44
- topologic.Cluster
44
+ topologic_core.Cluster
45
45
  The created grid. Edges in the grid have an identifying dictionary with two keys: "dir" and "offset". The "dir" key can have one of two values: "u" or "v", the "offset" key contains the offset distance of that grid edge from the specified origin.
46
46
 
47
47
  """
@@ -55,17 +55,17 @@ class Grid(topologic.Cluster):
55
55
  if len(uRange) < 1 or len(vRange) < 1:
56
56
  return None
57
57
  if not uOrigin:
58
- if not isinstance(face, topologic.Face):
58
+ if not Topology.IsInstance(face, "Face"):
59
59
  uOrigin = Vertex.ByCoordinates(0, 0, 0)
60
60
  else:
61
61
  uOrigin = Face.VertexByParameters(face, 0, 0)
62
62
  if not vOrigin:
63
- if not isinstance(face, topologic.Face):
63
+ if not Topology.IsInstance(face, "Face"):
64
64
  vOrigin = Vertex.ByCoordinates(0, 0, 0)
65
65
  else:
66
66
  vOrigin = Face.VertexByParameters(face, 0, 0)
67
67
 
68
- if isinstance(face, topologic.Face):
68
+ if Topology.IsInstance(face, "Face"):
69
69
  v1 = Face.VertexByParameters(face, 0, 0)
70
70
  v2 = Face.VertexByParameters(face, 1, 0)
71
71
  v3 = Face.VertexByParameters(face, 0, 0)
@@ -87,16 +87,15 @@ class Grid(topologic.Cluster):
87
87
  v1 = Vertex.ByCoordinates(uOrigin.X()+tempVec[0], uOrigin.Y()+tempVec[1], uOrigin.Z()+tempVec[2])
88
88
  v2 = Vertex.ByCoordinates(v1.X()+vVector[0], v1.Y()+vVector[1], v1.Z()+vVector[2])
89
89
  e = Edge.ByVertices([v1, v2], tolerance=tolerance)
90
- if clip and isinstance(face, topologic.Face):
90
+ if clip and Topology.IsInstance(face, "Face"):
91
91
  e = e.Intersect(face, False)
92
92
  if e:
93
- if isinstance(e, topologic.Edge):
93
+ if Topology.IsInstance(e, "Edge"):
94
94
  d = Dictionary.ByKeysValues(["dir", "offset"],["u",u])
95
95
  e.SetDictionary(d)
96
96
  gridEdges.append(e)
97
- elif e.Type() > topologic.Edge.Type():
98
- tempEdges = []
99
- _ = e.Edges(None, tempEdges)
97
+ elif Topology.Type(e) > Topology.TypeID("Edge"):
98
+ tempEdges = Topology.Edges(e)
100
99
  for tempEdge in tempEdges:
101
100
  d = Dictionary.ByKeysValues(["dir", "offset"],["u",u])
102
101
  tempEdge.SetDictionary(d)
@@ -109,16 +108,15 @@ class Grid(topologic.Cluster):
109
108
  v1 = Vertex.ByCoordinates(vOrigin.X()+tempVec[0], vOrigin.Y()+tempVec[1], vOrigin.Z()+tempVec[2])
110
109
  v2 = Vertex.ByCoordinates(v1.X()+uVector[0], v1.Y()+uVector[1], v1.Z()+uVector[2])
111
110
  e = Edge.ByVertices([v1, v2], tolerance=tolerance)
112
- if clip and isinstance(face, topologic.Face):
111
+ if clip and Topology.IsInstance(face, "Face"):
113
112
  e = e.Intersect(face, False)
114
113
  if e:
115
- if isinstance(e, topologic.Edge):
114
+ if Topology.IsInstance(e, "Edge"):
116
115
  d = Dictionary.ByKeysValues(["dir", "offset"],["v",v])
117
116
  e.SetDictionary(d)
118
117
  gridEdges.append(e)
119
- elif e.Type() > topologic.Edge.Type():
120
- tempEdges = []
121
- _ = e.Edges(None, tempEdges)
118
+ elif Topology.Type(e) > Topology.TypeID("Edge"):
119
+ tempEdges = Topology.Edges(e)
122
120
  for tempEdge in tempEdges:
123
121
  d = Dictionary.ByKeysValues(["dir", "offset"],["v",v])
124
122
  tempEdge.SetDictionary(d)
@@ -135,7 +133,7 @@ class Grid(topologic.Cluster):
135
133
 
136
134
  Parameters
137
135
  ----------
138
- face : topologic.Face
136
+ face : topologic_core.Face
139
137
  The input face.
140
138
  uRange : list , optional
141
139
  A list of *u* parameters for the *u* grid lines. The default is [0,0.25,0.5, 0.75, 1.0].
@@ -148,17 +146,17 @@ class Grid(topologic.Cluster):
148
146
 
149
147
  Returns
150
148
  -------
151
- topologic.Cluster
149
+ topologic_core.Cluster
152
150
  The created grid. Edges in the grid have an identifying dictionary with two keys: "dir" and "offset". The "dir" key can have one of two values: "u" or "v", the "offset" key contains the offset parameter of that grid edge.
153
151
 
154
152
  """
155
- from topologicpy.Vertex import Vertex
156
153
  from topologicpy.Edge import Edge
157
154
  from topologicpy.Face import Face
158
155
  from topologicpy.Cluster import Cluster
159
156
  from topologicpy.Dictionary import Dictionary
157
+ from topologicpy.Topology import Topology
160
158
 
161
- if not isinstance(face, topologic.Face):
159
+ if not Topology.IsInstance(face, "Face"):
162
160
  return None
163
161
  if len(uRange) < 1 and len(vRange) < 1:
164
162
  return None
@@ -176,16 +174,15 @@ class Grid(topologic.Cluster):
176
174
  v1 = Face.VertexByParameters(face, u, 0)
177
175
  v2 = Face.VertexByParameters(face, u, 1)
178
176
  e = Edge.ByVertices([v1, v2], tolerance=tolerance)
179
- if clip and isinstance(face, topologic.Face):
177
+ if clip and Topology.IsInstance(face, "Face"):
180
178
  e = e.Intersect(face, False)
181
179
  if e:
182
- if isinstance(e, topologic.Edge):
180
+ if Topology.IsInstance(e, "Edge"):
183
181
  d = Dictionary.ByKeysValues(["dir", "offset"],["u",u])
184
182
  e.SetDictionary(d)
185
183
  gridEdges.append(e)
186
- elif e.Type() > topologic.Edge.Type():
187
- tempEdges = []
188
- _ = e.Edges(None, tempEdges)
184
+ elif Topology.Type(e) > Topology.TypeID("Edge"):
185
+ tempEdges = Topology.Edges(e)
189
186
  for tempEdge in tempEdges:
190
187
  d = Dictionary.ByKeysValues(["dir", "offset"],["u",u])
191
188
  tempEdge.SetDictionary(d)
@@ -194,14 +191,14 @@ class Grid(topologic.Cluster):
194
191
  v1 = Face.VertexByParameters(face, 0, v)
195
192
  v2 = Face.VertexByParameters(face, 1, v)
196
193
  e = Edge.ByVertices([v1, v2], tolerance=tolerance)
197
- if clip and isinstance(face, topologic.Face):
194
+ if clip and Topology.IsInstance(face, "Face"):
198
195
  e = e.Intersect(face, False)
199
196
  if e:
200
- if isinstance(e, topologic.Edge):
197
+ if Topology.IsInstance(e, "Edge"):
201
198
  d = Dictionary.ByKeysValues(["dir", "offset"],["v",v])
202
199
  e.SetDictionary(d)
203
200
  gridEdges.append(e)
204
- elif e.Type() > topologic.Edge.Type():
201
+ elif Topology.Type(e) > Topology.TypeID("Edge"):
205
202
  tempEdges = []
206
203
  _ = e.Edges(None, tempEdges)
207
204
  for tempEdge in tempEdges:
@@ -221,9 +218,9 @@ class Grid(topologic.Cluster):
221
218
 
222
219
  Parameters
223
220
  ----------
224
- face : topologic.Face , optional
221
+ face : topologic_core.Face , optional
225
222
  The input face. If set to None, the grid will be created on the XY plane. The default is None.
226
- origin : topologic.Vertex , optional
223
+ origin : topologic_core.Vertex , optional
227
224
  The origin of the grid vertices. If set to None: if the face is set, the origin will be set to vertex at the face's 0,0 paratmer. If the face is set to None, the origin will be set to (0, 0, 0). The default is None.
228
225
  uRange : list , optional
229
226
  A list of distances for the *u* grid lines from the uOrigin. The default is [-0.5,-0.25,0, 0.25,0.5].
@@ -236,7 +233,7 @@ class Grid(topologic.Cluster):
236
233
 
237
234
  Returns
238
235
  -------
239
- topologic.Cluster
236
+ topologic_core.Cluster
240
237
  The created grid. Vertices in the grid have an identifying dictionary with two keys: "u" and "v". The "dir" key can have one of two values: "u" or "v" that contain the *u* and *v* offset distances of that grid vertex from the specified origin.
241
238
 
242
239
  """
@@ -250,12 +247,12 @@ class Grid(topologic.Cluster):
250
247
  if len(uRange) < 1 or len(vRange) < 1:
251
248
  return None
252
249
  if not origin:
253
- if not isinstance(face, topologic.Face):
250
+ if not Topology.IsInstance(face, "Face"):
254
251
  origin = Vertex.ByCoordinates(0, 0, 0)
255
252
  else:
256
253
  origin = Face.VertexByParameters(face, 0, 0)
257
254
 
258
- if isinstance(face, topologic.Face):
255
+ if Topology.IsInstance(face, "Face"):
259
256
  v1 = Face.VertexByParameters(face, 0, 0)
260
257
  v2 = Face.VertexByParameters(face, 1, 0)
261
258
  v3 = Face.VertexByParameters(face, 0, 0)
@@ -278,9 +275,9 @@ class Grid(topologic.Cluster):
278
275
  uTempVec = Vector.Multiply(uuVector, u, tolerance)
279
276
  vTempVec = Vector.Multiply(uvVector, v, tolerance)
280
277
  gridVertex = Vertex.ByCoordinates(origin.X()+uTempVec[0], origin.Y()+vTempVec[1], origin.Z()+uTempVec[2])
281
- if clip and isinstance(face, topologic.Face):
278
+ if clip and Topology.IsInstance(face, "Face"):
282
279
  gridVertex = gridVertex.Intersect(face, False)
283
- if isinstance(gridVertex, topologic.Vertex):
280
+ if Topology.IsInstance(gridVertex, "Vertex"):
284
281
  d = Dictionary.ByKeysValues(["u","v"],[u,v])
285
282
  if d:
286
283
  gridVertex.SetDictionary(d)
@@ -297,9 +294,9 @@ class Grid(topologic.Cluster):
297
294
 
298
295
  Parameters
299
296
  ----------
300
- face : topologic.Face , optional
297
+ face : topologic_core.Face , optional
301
298
  The input face. If set to None, the grid will be created on the XY plane. The default is None.
302
- origin : topologic.Vertex , optional
299
+ origin : topologic_core.Vertex , optional
303
300
  The origin of the grid vertices. If set to None: if the face is set, the origin will be set to vertex at the face's 0,0 paratmer. If the face is set to None, the origin will be set to (0, 0, 0). The default is None.
304
301
  uRange : list , optional
305
302
  A list of *u* parameters for the *u* grid lines from the uOrigin. The default is [0.0,0.25,0.5,0.75,1.0].
@@ -312,7 +309,7 @@ class Grid(topologic.Cluster):
312
309
 
313
310
  Returns
314
311
  -------
315
- topologic.Cluster
312
+ topologic_core.Cluster
316
313
  The created grid. Vertices in the grid have an identifying dictionary with two keys: "u" and "v". The "dir" key can have one of two values: "u" or "v" that contain the *u* and *v* offset distances of that grid vertex from the specified origin.
317
314
 
318
315
  """
@@ -324,7 +321,7 @@ class Grid(topologic.Cluster):
324
321
  from topologicpy.Dictionary import Dictionary
325
322
  from topologicpy.Vector import Vector
326
323
 
327
- if not isinstance(face, topologic.Face):
324
+ if not Topology.IsInstance(face, "Face"):
328
325
  return None
329
326
  if len(uRange) < 1 or len(vRange) < 1:
330
327
  return None
@@ -341,9 +338,9 @@ class Grid(topologic.Cluster):
341
338
  for u in uRange:
342
339
  for v in vRange:
343
340
  gridVertex = Face.VertexByParameters(face, u, v)
344
- if clip and isinstance(face, topologic.Face):
341
+ if clip and Topology.IsInstance(face, "Face"):
345
342
  gridVertex = gridVertex.Intersect(face, False)
346
- if isinstance(gridVertex, topologic.Vertex):
343
+ if Topology.IsInstance(gridVertex, "Vertex"):
347
344
  d = Dictionary.ByKeysValues(["u","v"],[u,v])
348
345
  if d:
349
346
  gridVertex.SetDictionary(d)
topologicpy/Honeybee.py CHANGED
@@ -264,7 +264,7 @@ class Honeybee:
264
264
  else:
265
265
  return createUniqueName(name,nameList, number+1)
266
266
 
267
- if not isinstance(tpBuilding, topologic.Topology):
267
+ if not Topology.IsInstance(tpBuilding, "Topology"):
268
268
  return None
269
269
  rooms = []
270
270
  tpCells = []
topologicpy/Matrix.py CHANGED
@@ -50,7 +50,7 @@ class Matrix:
50
50
  return matC
51
51
 
52
52
  @staticmethod
53
- def ByRotation(rx=0, ry=0, rz=0, order="xyz"):
53
+ def ByRotation(angleX=0, angleY=0, angleZ=0, order="xyz"):
54
54
  """
55
55
  Description
56
56
  ----------
@@ -58,12 +58,12 @@ class Matrix:
58
58
 
59
59
  Parameters
60
60
  ----------
61
- rx : float , optional
62
- The desired rotation around the X axis. The default is 0.
63
- ry : float , optional
64
- The desired rotation around the Y axis. The default is 0.
65
- rz : float , optional
66
- The desired rotation around the Z axis. The default is 0.
61
+ angleX : float , optional
62
+ The desired rotation angle in degrees around the X axis. The default is 0.
63
+ angleY : float , optional
64
+ The desired rotation angle in degrees around the Y axis. The default is 0.
65
+ angleZ : float , optional
66
+ The desired rotation angle in degrees around the Z axis. The default is 0.
67
67
  order : string , optional
68
68
  The order by which the roatations will be applied. The possible values are any permutation of "xyz". This input is case insensitive. The default is "xyz".
69
69
 
@@ -102,9 +102,9 @@ class Matrix:
102
102
  [0, 0, 1, 0],
103
103
  [0, 0, 0, 1]]
104
104
 
105
- xMat = rotateXMatrix(math.radians(rx))
106
- yMat = rotateYMatrix(math.radians(ry))
107
- zMat = rotateZMatrix(math.radians(rz))
105
+ xMat = rotateXMatrix(math.radians(angleX))
106
+ yMat = rotateYMatrix(math.radians(angleY))
107
+ zMat = rotateZMatrix(math.radians(angleZ))
108
108
  if order.lower() == "xyz":
109
109
  return Matrix.Multiply(Matrix.Multiply(zMat,yMat),xMat)
110
110
  if order.lower() == "xzy":
@@ -119,7 +119,7 @@ class Matrix:
119
119
  return Matrix.Multiply(Matrix.Multiply(xMat,yMat),zMat)
120
120
 
121
121
  @staticmethod
122
- def ByScaling(sx=1.0, sy=1.0, sz=1.0):
122
+ def ByScaling(scaleX=1.0, scaleY=1.0, scaleZ=1.0):
123
123
  """
124
124
  Description
125
125
  ----------
@@ -127,11 +127,11 @@ class Matrix:
127
127
 
128
128
  Parameters
129
129
  ----------
130
- sx : float , optional
130
+ scaleX : float , optional
131
131
  The desired scaling factor along the X axis. The default is 1.
132
- sy : float , optional
132
+ scaleY : float , optional
133
133
  The desired scaling factor along the X axis. The default is 1.
134
- sz : float , optional
134
+ scaleZ : float , optional
135
135
  The desired scaling factor along the X axis. The default is 1.
136
136
 
137
137
  Returns
@@ -140,13 +140,13 @@ class Matrix:
140
140
  The created 4X4 scaling matrix.
141
141
 
142
142
  """
143
- return Matrix.Transpose([[sx,0,0,0],
144
- [0,sy,0,0],
145
- [0,0,sz,0],
146
- [0,0,0,1]])
143
+ return [[scaleX,0,0,0],
144
+ [0,scaleY,0,0],
145
+ [0,0,scaleZ,0],
146
+ [0,0,0,1]]
147
147
 
148
148
  @staticmethod
149
- def ByTranslation(tx=0, ty=0, tz=0):
149
+ def ByTranslation(translateX=0, translateY=0, translateZ=0):
150
150
  """
151
151
  Description
152
152
  ----------
@@ -154,11 +154,11 @@ class Matrix:
154
154
 
155
155
  Parameters
156
156
  ----------
157
- tx : float , optional
157
+ translateX : float , optional
158
158
  The desired translation distance along the X axis. The default is 0.
159
- ty : float , optional
159
+ translateY : float , optional
160
160
  The desired translation distance along the X axis. The default is 0.
161
- tz : float , optional
161
+ translateZ : float , optional
162
162
  The desired translation distance along the X axis. The default is 0.
163
163
 
164
164
  Returns
@@ -167,17 +167,18 @@ class Matrix:
167
167
  The created 4X4 translation matrix.
168
168
 
169
169
  """
170
- return Matrix.Transpose([[1,0,0,tx],
171
- [0,1,0,ty],
172
- [0,0,1,tz],
173
- [0,0,0,1]])
170
+ return [[1,0,0,0],
171
+ [0,1,0,0],
172
+ [0,0,1,0],
173
+ [translateX,translateY,translateZ,1]]
174
174
 
175
175
  @staticmethod
176
176
  def Multiply(matA, matB):
177
177
  """
178
178
  Description
179
179
  ----------
180
- Multiplies the two input matrices.
180
+ Multiplies the two input matrices. When transforming an object, the first input matrix is applied first
181
+ then the second input matrix.
181
182
 
182
183
  Parameters
183
184
  ----------
topologicpy/Neo4j.py CHANGED
@@ -50,7 +50,7 @@ class Neo4j:
50
50
 
51
51
  Returns
52
52
  -------
53
- topologic.Vertex
53
+ topologic_core.Vertex
54
54
  The output topologic vertex.
55
55
 
56
56
  """
@@ -111,7 +111,7 @@ class Neo4j:
111
111
 
112
112
  Returns
113
113
  -------
114
- topologic.Graph
114
+ topologic_core.Graph
115
115
  The output topologic graph.
116
116
 
117
117
  """
@@ -199,7 +199,7 @@ class Neo4j:
199
199
 
200
200
  Returns
201
201
  -------
202
- topologic.Graph
202
+ topologic_core.Graph
203
203
  The output topologic graph.
204
204
 
205
205
  """
@@ -284,7 +284,7 @@ class Neo4j:
284
284
  ----------
285
285
  neo4jGraph : Neo4j.Graph
286
286
  The input neo4j graph.
287
- graph : topologic.Graph
287
+ graph : topologic_core.Graph
288
288
  The input topologic graph.
289
289
  categoryKey : str
290
290
  The category key in the dictionary under which to look for the category value.
@@ -435,7 +435,7 @@ class Neo4j:
435
435
  ----------
436
436
  neo4jGraph : Neo4j.Graph
437
437
  The input neo4j graph.
438
- graph : topologic.Graph
438
+ graph : topologic_core.Graph
439
439
  The input topologic graph.
440
440
  labelKey : str , optional
441
441
  The dictionary key under which to find the vertex's label value. The default is None which means the vertex gets the name 'TopologicGraphVertex'.