topologicpy 0.2.2__py3-none-any.whl → 0.2.3__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/Vector.py CHANGED
@@ -7,8 +7,6 @@ class Vector(list):
7
7
  @staticmethod
8
8
  def Angle(vectorA, vectorB, mantissa=4):
9
9
  """
10
- Description
11
- ----------
12
10
  Returns the angle in degrees between the two input vectors
13
11
 
14
12
  Parameters
@@ -34,12 +32,32 @@ class Vector(list):
34
32
  cosang = np.dot(vectorA, vectorB)
35
33
  sinang = la.norm(np.cross(vectorA, vectorB))
36
34
  return round(math.degrees(np.arctan2(sinang, cosang)), mantissa)
35
+
36
+ @staticmethod
37
+ def ByCoordinates(x, y, z):
38
+ """
39
+ Creates a vector by the specified x, y, z inputs.
37
40
 
41
+ Parameters
42
+ ----------
43
+ x : float
44
+ The X coordinate.
45
+ y : float
46
+ The Y coordinate.
47
+ z : float
48
+ The Z coodinate.
49
+
50
+ Returns
51
+ -------
52
+ list
53
+ The created vector.
54
+
55
+ """
56
+ return [x,y,z]
57
+
38
58
  @staticmethod
39
59
  def CompassAngle(vectorA, vectorB, mantissa=4, tolerance=0.0001):
40
60
  """
41
- Description
42
- ----------
43
61
  Returns the horizontal compass angle in degrees between the two input vectors. The angle is measured in counter-clockwise fashion. Only the first two elements in the input vectors are considered.
44
62
 
45
63
  Parameters
@@ -70,10 +88,52 @@ class Vector(list):
70
88
  return round(rad2deg((ang1 - ang2) % (2 * pi)), mantissa)
71
89
 
72
90
  @staticmethod
73
- def Cross(vectorA, vectorB, mantissa=4, tolerance=0.0001):
91
+ def Coordinates(vector, outputType="xyz", mantissa=4):
74
92
  """
75
- Description
93
+ Returns the coordinates of the input vector.
94
+
95
+ Parameters
76
96
  ----------
97
+ vector : list
98
+ The input vector.
99
+ outputType : string, optional
100
+ The desired output type. Could be any permutation or substring of "xyz" or the string "matrix". The default is "xyz". The input is case insensitive and the coordinates will be returned in the specified order.
101
+ mantissa : int , optional
102
+ The desired length of the mantissa. The default is 4.
103
+
104
+ Returns
105
+ -------
106
+ list
107
+ The coordinates of the input vertex.
108
+
109
+ """
110
+ if not isinstance(vector, list):
111
+ return None
112
+ x = round(vector[0], mantissa)
113
+ y = round(vector[1], mantissa)
114
+ z = round(vector[2], mantissa)
115
+ matrix = [[1,0,0,x],
116
+ [0,1,0,y],
117
+ [0,0,1,z],
118
+ [0,0,0,1]]
119
+ output = []
120
+ outputType = outputType.lower()
121
+ if outputType == "matrix":
122
+ return matrix
123
+ else:
124
+ outputType = list(outputType)
125
+ for axis in outputType:
126
+ if axis == "x":
127
+ output.append(x)
128
+ elif axis == "y":
129
+ output.append(y)
130
+ elif axis == "z":
131
+ output.append(z)
132
+ return output
133
+
134
+ @staticmethod
135
+ def Cross(vectorA, vectorB, mantissa=4, tolerance=0.0001):
136
+ """
77
137
  Returns the cross product of the two input vectors. The resulting vector is perpendicular to the plane defined by the two input vectors.
78
138
 
79
139
  Parameters
@@ -104,11 +164,33 @@ class Vector(list):
104
164
  return None
105
165
  return [round(vecC[0], mantissa), round(vecC[1], mantissa), round(vecC[2], mantissa)]
106
166
 
167
+ @staticmethod
168
+ def Down():
169
+ """
170
+ Returns the vector representing the *down* direction. In Topologic, the negative ZAxis direction is considered *down* ([0,0,-1]).
171
+
172
+ Returns
173
+ -------
174
+ list
175
+ The vector representing the *down* direction.
176
+ """
177
+ return [0,0,-1]
178
+
179
+ @staticmethod
180
+ def East():
181
+ """
182
+ Returns the vector representing the *east* direction. In Topologic, the positive XAxis direction is considered *east* ([1,0,0]).
183
+
184
+ Returns
185
+ -------
186
+ list
187
+ The vector representing the *east* direction.
188
+ """
189
+ return [1,0,0]
190
+
107
191
  @staticmethod
108
192
  def IsCollinear(vectorA, vectorB, tolerance=0.1):
109
193
  """
110
- Description
111
- -----------
112
194
  Returns True if the input vectors are collinear. Returns False otherwise.
113
195
 
114
196
  Parameters
@@ -129,8 +211,6 @@ class Vector(list):
129
211
  @staticmethod
130
212
  def Magnitude(vector, mantissa=4):
131
213
  """
132
- Description
133
- -----------
134
214
  Returns the magnitude of the input vector.
135
215
 
136
216
  Parameters
@@ -146,13 +226,11 @@ class Vector(list):
146
226
  The magnitude of the input vector.
147
227
  """
148
228
 
149
- return math.round(np.linalg.norm(np.array(vector)), mantissa)
229
+ return round(np.linalg.norm(np.array(vector)), mantissa)
150
230
 
151
231
  @staticmethod
152
232
  def Multiply(vector, magnitude, tolerance=0.0001):
153
233
  """
154
- Description
155
- ----------
156
234
  Multiplies the input vector by the input magnitude.
157
235
 
158
236
  Parameters
@@ -184,8 +262,6 @@ class Vector(list):
184
262
  @staticmethod
185
263
  def Normalize(vector):
186
264
  """
187
- Description
188
- -----------
189
265
  Returns a normalized vector of the input vector. A normalized vector has the same direction as the input vector, but its magnitude is 1.
190
266
 
191
267
  Parameters
@@ -201,11 +277,45 @@ class Vector(list):
201
277
 
202
278
  return list(vector / np.linalg.norm(vector))
203
279
 
280
+ @staticmethod
281
+ def North():
282
+ """
283
+ Returns the vector representing the *north* direction. In Topologic, the positive YAxis direction is considered *north* ([0,1,0]).
284
+
285
+ Returns
286
+ -------
287
+ list
288
+ The vector representing the *north* direction.
289
+ """
290
+ return [0,1,0]
291
+
292
+ @staticmethod
293
+ def NorthEast():
294
+ """
295
+ Returns the vector representing the *northeast* direction. In Topologic, the positive YAxis direction is considered *north* and the positive XAxis direction is considered *east*. Therefore *northeast* is ([1,1,0]).
296
+
297
+ Returns
298
+ -------
299
+ list
300
+ The vector representing the *northeast* direction.
301
+ """
302
+ return [1,1,0]
303
+
304
+ @staticmethod
305
+ def NorthWest():
306
+ """
307
+ Returns the vector representing the *northwest* direction. In Topologic, the positive YAxis direction is considered *north* and the negative XAxis direction is considered *west*. Therefore *northwest* is ([-1,1,0]).
308
+
309
+ Returns
310
+ -------
311
+ list
312
+ The vector representing the *northwest* direction.
313
+ """
314
+ return [-1,1,0]
315
+
204
316
  @staticmethod
205
317
  def Reverse(vector):
206
318
  """
207
- Description
208
- -----------
209
319
  Returns a reverse vector of the input vector. A reverse vector multiplies all components by -1.
210
320
 
211
321
  Parameters
@@ -221,3 +331,118 @@ class Vector(list):
221
331
  if not isinstance(vector, list):
222
332
  return None
223
333
  return [x*-1 for x in vector]
334
+
335
+ @staticmethod
336
+ def SetMagnitude(vector: list, magnitude: float) -> list:
337
+ """
338
+ Sets the magnitude of the input vector to the input magnitude.
339
+
340
+ Parameters
341
+ ----------
342
+ vector : list
343
+ The input vector.
344
+ magnitude : float
345
+ The desired magnitude.
346
+
347
+ Returns
348
+ -------
349
+ list
350
+ The created vector.
351
+ """
352
+ return (Vector.Multiply(vector=Vector.Normalize(vector), magnitude=magnitude))
353
+
354
+ @staticmethod
355
+ def South():
356
+ """
357
+ Returns the vector representing the *south* direction. In Topologic, the negative YAxis direction is considered *south* ([0,-1,0]).
358
+
359
+ Returns
360
+ -------
361
+ list
362
+ The vector representing the *south* direction.
363
+ """
364
+ return [0,-1,0]
365
+
366
+ @staticmethod
367
+ def SouthEast():
368
+ """
369
+ Returns the vector representing the *southeast* direction. In Topologic, the negative YAxis direction is considered *south* and the positive XAxis direction is considered *east*. Therefore *southeast* is ([1,-1,0]).
370
+
371
+ Returns
372
+ -------
373
+ list
374
+ The vector representing the *southeast* direction.
375
+ """
376
+ return [1,-1,0]
377
+
378
+ @staticmethod
379
+ def SouthWest():
380
+ """
381
+ Returns the vector representing the *southwest* direction. In Topologic, the negative YAxis direction is considered *south* and the negative XAxis direction is considered *west*. Therefore *southwest* is ([-1,-1,0]).
382
+
383
+ Returns
384
+ -------
385
+ list
386
+ The vector representing the *southwest* direction.
387
+ """
388
+ return [-1,-1,0]
389
+
390
+ @staticmethod
391
+ def Up():
392
+ """
393
+ Returns the vector representing the up direction. In Topologic, the positive ZAxis direction is considered "up" ([0,0,1]).
394
+
395
+ Returns
396
+ -------
397
+ list
398
+ The vector representing the "up" direction.
399
+ """
400
+ return [0,0,1]
401
+
402
+ @staticmethod
403
+ def West():
404
+ """
405
+ Returns the vector representing the *west* direction. In Topologic, the negative XAxis direction is considered *west* ([-1,0,0]).
406
+
407
+ Returns
408
+ -------
409
+ list
410
+ The vector representing the *west* direction.
411
+ """
412
+ return [-1,0,0]
413
+
414
+ @staticmethod
415
+ def XAxis():
416
+ """
417
+ Returns the vector representing the XAxis ([1,0,0])
418
+
419
+ Returns
420
+ -------
421
+ list
422
+ The vector representing the XAxis.
423
+ """
424
+ return [1,0,0]
425
+
426
+ @staticmethod
427
+ def YAxis():
428
+ """
429
+ Returns the vector representing the YAxis ([0,1,0])
430
+
431
+ Returns
432
+ -------
433
+ list
434
+ The vector representing the YAxis.
435
+ """
436
+ return [0,1,0]
437
+
438
+ @staticmethod
439
+ def ZAxis():
440
+ """
441
+ Returns the vector representing the ZAxis ([0,0,1])
442
+
443
+ Returns
444
+ -------
445
+ list
446
+ The vector representing the ZAxis.
447
+ """
448
+ return [0,0,1]
topologicpy/Wire.py CHANGED
@@ -469,8 +469,7 @@ class Wire(topologic.Wire):
469
469
  return Wire.ByVertices(vertices, close)
470
470
 
471
471
  @staticmethod
472
- def Circle(origin=None, radius=0.5, sides=16, fromAngle=0, toAngle=360, close=True, dirX=0,
473
- dirY=0, dirZ=1, placement="center", tolerance=0.0001):
472
+ def Circle(origin=None, radius=0.5, sides=16, fromAngle=0, toAngle=360, close=True, direction=[0,0,1], placement="center", tolerance=0.0001):
474
473
  """
475
474
  Creates a circle.
476
475
 
@@ -488,12 +487,8 @@ class Wire(topologic.Wire):
488
487
  The angle in degrees at which to end creating the arc of the circle. The default is 360.
489
488
  close : bool , optional
490
489
  If set to True, arcs will be closed by connecting the last vertex to the first vertex. Otherwise, they will be left open.
491
- dirX : float , optional
492
- The X component of the vector representing the up direction of the circle. The default is 0.
493
- dirY : float , optional
494
- The Y component of the vector representing the up direction of the circle. The default is 0.
495
- dirZ : float , optional
496
- The Z component of the vector representing the up direction of the circle. The default is 1.
490
+ direction : list , optional
491
+ The vector representing the up direction of the circle. The default is [0,0,1].
497
492
  placement : str , optional
498
493
  The description of the placement of the origin of the circle. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
499
494
  tolerance : float , optional
@@ -512,7 +507,8 @@ class Wire(topologic.Wire):
512
507
  radius = abs(radius)
513
508
  if radius < tolerance:
514
509
  return None
515
- if (abs(dirX) + abs(dirY) + abs(dirZ)) < tolerance:
510
+
511
+ if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) < tolerance:
516
512
  return None
517
513
  baseV = []
518
514
  xList = []
@@ -542,9 +538,9 @@ class Wire(topologic.Wire):
542
538
  x1 = origin.X()
543
539
  y1 = origin.Y()
544
540
  z1 = origin.Z()
545
- x2 = origin.X() + dirX
546
- y2 = origin.Y() + dirY
547
- z2 = origin.Z() + dirZ
541
+ x2 = origin.X() + direction[0]
542
+ y2 = origin.Y() + direction[1]
543
+ z2 = origin.Z() + direction[2]
548
544
  dx = x2 - x1
549
545
  dy = y2 - y1
550
546
  dz = z2 - z1
@@ -698,7 +694,7 @@ class Wire(topologic.Wire):
698
694
  return edges
699
695
 
700
696
  @staticmethod
701
- def Ellipse(origin=None, inputMode=1, width=2.0, length=1.0, focalLength=0.866025, eccentricity=0.866025, majorAxisLength=1.0, minorAxisLength=0.5, sides=32, fromAngle=0, toAngle=360, close=True, dirX=0, dirY=0, dirZ=1, placement="center", tolerance=0.0001):
697
+ def Ellipse(origin=None, inputMode=1, width=2.0, length=1.0, focalLength=0.866025, eccentricity=0.866025, majorAxisLength=1.0, minorAxisLength=0.5, sides=32, fromAngle=0, toAngle=360, close=True, direction=[0,0,1], placement="center", tolerance=0.0001):
702
698
  """
703
699
  Creates an ellipse and returns all its geometry and parameters.
704
700
 
@@ -733,12 +729,8 @@ class Wire(topologic.Wire):
733
729
  The angle in degrees at which to end creating the arc of the ellipse. The default is 360.
734
730
  close : bool , optional
735
731
  If set to True, arcs will be closed by connecting the last vertex to the first vertex. Otherwise, they will be left open.
736
- dirX : float , optional
737
- The X component of the vector representing the up direction of the ellipse. The default is 0.
738
- dirY : float , optional
739
- The Y component of the vector representing the up direction of the ellipse. The default is 0.
740
- dirZ : float , optional
741
- The Z component of the vector representing the up direction of the ellipse. The default is 1.
732
+ direction : list , optional
733
+ The vector representing the up direction of the ellipse. The default is [0,0,1].
742
734
  placement : str , optional
743
735
  The description of the placement of the origin of the ellipse. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
744
736
  tolerance : float , optional
@@ -750,11 +742,11 @@ class Wire(topologic.Wire):
750
742
  The created ellipse
751
743
 
752
744
  """
753
- ellipseAll = Wire.EllipseAll(origin=origin, inputMode=inputMode, width=width, length=length, focalLength=focalLength, eccentricity=eccentricity, majorAxisLength=majorAxisLength, minorAxisLength=minorAxisLength, sides=sides, fromAngle=fromAngle, toAngle=toAngle, close=close, dirX=dirX, dirY=dirY, dirZ=dirZ, placement=placement, tolerance=tolerance)
745
+ ellipseAll = Wire.EllipseAll(origin=origin, inputMode=inputMode, width=width, length=length, focalLength=focalLength, eccentricity=eccentricity, majorAxisLength=majorAxisLength, minorAxisLength=minorAxisLength, sides=sides, fromAngle=fromAngle, toAngle=toAngle, close=close, direction=direction, placement=placement, tolerance=tolerance)
754
746
  return ellipseAll["ellipse"]
755
747
 
756
748
  @staticmethod
757
- def EllipseAll(origin=None, inputMode=1, width=2.0, length=1.0, focalLength= 0.866025, eccentricity=0.866025, majorAxisLength=1.0, minorAxisLength=0.5, sides=32, fromAngle=0, toAngle=360, close=True, dirX=0, dirY=0, dirZ=1, placement="center", tolerance=0.0001):
749
+ def EllipseAll(origin=None, inputMode=1, width=2.0, length=1.0, focalLength= 0.866025, eccentricity=0.866025, majorAxisLength=1.0, minorAxisLength=0.5, sides=32, fromAngle=0, toAngle=360, close=True, direction=[0,0,1], placement="center", tolerance=0.0001):
758
750
  """
759
751
  Creates an ellipse and returns all its geometry and parameters.
760
752
 
@@ -789,12 +781,8 @@ class Wire(topologic.Wire):
789
781
  The angle in degrees at which to end creating the arc of the ellipse. The default is 360.
790
782
  close : bool , optional
791
783
  If set to True, arcs will be closed by connecting the last vertex to the first vertex. Otherwise, they will be left open.
792
- dirX : float , optional
793
- The X component of the vector representing the up direction of the ellipse. The default is 0.
794
- dirY : float , optional
795
- The Y component of the vector representing the up direction of the ellipse. The default is 0.
796
- dirZ : float , optional
797
- The Z component of the vector representing the up direction of the ellipse. The default is 1.
784
+ direction : list , optional
785
+ The vector representing the up direction of the ellipse. The default is [0,0,1].
798
786
  placement : str , optional
799
787
  The description of the placement of the origin of the ellipse. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
800
788
  tolerance : float , optional
@@ -822,7 +810,7 @@ class Wire(topologic.Wire):
822
810
  return None
823
811
  if placement.lower() not in ["center", "lowerleft"]:
824
812
  return None
825
- if (abs(dirX) + abs(dirY) + abs(dirZ)) < tolerance:
813
+ if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) < tolerance:
826
814
  return None
827
815
  width = abs(width)
828
816
  length = abs(length)
@@ -834,7 +822,6 @@ class Wire(topologic.Wire):
834
822
  if width < tolerance or length < tolerance or focalLength < tolerance or eccentricity < tolerance or majorAxisLength < tolerance or minorAxisLength < tolerance or sides < 3:
835
823
  return None
836
824
  if inputMode == 1:
837
- # origin, w, l, sides, fromAngle, toAngle, close, dirX, dirY, dirZ = item
838
825
  w = width
839
826
  l = length
840
827
  a = width/2
@@ -842,7 +829,6 @@ class Wire(topologic.Wire):
842
829
  c = math.sqrt(abs(b**2 - a**2))
843
830
  e = c/a
844
831
  elif inputMode == 2:
845
- # origin, c, e, sides, fromAngle, toAngle, close, dirX, dirY, dirZ = item
846
832
  c = focalLength
847
833
  e = eccentricity
848
834
  a = c/e
@@ -850,7 +836,6 @@ class Wire(topologic.Wire):
850
836
  w = a*2
851
837
  l = b*2
852
838
  elif inputMode == 3:
853
- # origin, c, b, sides, fromAngle, toAngle, close, dirX, dirY, dirZ = item
854
839
  c = focalLength
855
840
  b = minorAxisLength
856
841
  a = math.sqrt(abs(b**2 + c**2))
@@ -858,7 +843,6 @@ class Wire(topologic.Wire):
858
843
  w = a*2
859
844
  l = b*2
860
845
  elif inputMode == 4:
861
- # origin, a, b, sides, fromAngle, toAngle, close, dirX, dirY, dirZ = item
862
846
  a = majorAxisLength
863
847
  b = minorAxisLength
864
848
  c = math.sqrt(abs(b**2 - a**2))
@@ -896,9 +880,9 @@ class Wire(topologic.Wire):
896
880
  x1 = origin.X()
897
881
  y1 = origin.Y()
898
882
  z1 = origin.Z()
899
- x2 = origin.X() + dirX
900
- y2 = origin.Y() + dirY
901
- z2 = origin.Z() + dirZ
883
+ x2 = origin.X() + direction[0]
884
+ y2 = origin.Y() + direction[1]
885
+ z2 = origin.Z() + direction[2]
902
886
  dx = x2 - x1
903
887
  dy = y2 - y1
904
888
  dz = z2 - z1
@@ -1289,7 +1273,7 @@ class Wire(topologic.Wire):
1289
1273
  return w
1290
1274
 
1291
1275
  @staticmethod
1292
- def Rectangle(origin=None, width=1.0, length=1.0, dirX=0, dirY=0, dirZ=1, placement="center", tolerance=0.0001):
1276
+ def Rectangle(origin=None, width=1.0, length=1.0, direction=[0,0,1], placement="center", tolerance=0.0001):
1293
1277
  """
1294
1278
  Creates a rectangle.
1295
1279
 
@@ -1301,12 +1285,8 @@ class Wire(topologic.Wire):
1301
1285
  The width of the rectangle. The default is 1.0.
1302
1286
  length : float , optional
1303
1287
  The length of the rectangle. The default is 1.0.
1304
- dirX : float , optional
1305
- The X component of the vector representing the up direction of the rectangle. The default is 0.
1306
- dirY : float , optional
1307
- The Y component of the vector representing the up direction of the rectangle. The default is 0.
1308
- dirZ : float , optional
1309
- The Z component of the vector representing the up direction of the rectangle. The default is 1.
1288
+ direction : list , optional
1289
+ The ector representing the up direction of the rectangle. The default is [0,0,1].
1310
1290
  placement : str , optional
1311
1291
  The description of the placement of the origin of the rectangle. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
1312
1292
  tolerance : float , optional
@@ -1330,7 +1310,7 @@ class Wire(topologic.Wire):
1330
1310
  length = abs(length)
1331
1311
  if width < tolerance or length < tolerance:
1332
1312
  return None
1333
- if (abs(dirX) + abs(dirY) + abs(dirZ)) < tolerance:
1313
+ if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) < tolerance:
1334
1314
  return None
1335
1315
  xOffset = 0
1336
1316
  yOffset = 0
@@ -1347,9 +1327,9 @@ class Wire(topologic.Wire):
1347
1327
  x1 = origin.X()
1348
1328
  y1 = origin.Y()
1349
1329
  z1 = origin.Z()
1350
- x2 = origin.X() + dirX
1351
- y2 = origin.Y() + dirY
1352
- z2 = origin.Z() + dirZ
1330
+ x2 = origin.X() + direction[0]
1331
+ y2 = origin.Y() + direction[1]
1332
+ z2 = origin.Z() + direction[2]
1353
1333
  dx = x2 - x1
1354
1334
  dy = y2 - y1
1355
1335
  dz = z2 - z1
@@ -1521,7 +1501,7 @@ class Wire(topologic.Wire):
1521
1501
 
1522
1502
 
1523
1503
  @staticmethod
1524
- def Star(origin=None, radiusA=1.0, radiusB=0.4, rays=5, dirX=0, dirY=0, dirZ=1, placement="center", tolerance=0.0001):
1504
+ def Star(origin=None, radiusA=1.0, radiusB=0.4, rays=5, direction=[0,0,1], placement="center", tolerance=0.0001):
1525
1505
  """
1526
1506
  Creates a star.
1527
1507
 
@@ -1535,12 +1515,8 @@ class Wire(topologic.Wire):
1535
1515
  The outer radius of the star. The default is 0.4.
1536
1516
  rays : int , optional
1537
1517
  The number of star rays. The default is 5.
1538
- dirX : float , optional
1539
- The X component of the vector representing the up direction of the star. The default is 0.
1540
- dirY : float , optional
1541
- The Y component of the vector representing the up direction of the star. The default is 0.
1542
- dirZ : float , optional
1543
- The Z component of the vector representing the up direction of the star. The default is 1.
1518
+ direction : list , optional
1519
+ The vector representing the up direction of the star. The default is [0,0,1].
1544
1520
  placement : str , optional
1545
1521
  The description of the placement of the origin of the star. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
1546
1522
  tolerance : float , optional
@@ -1601,9 +1577,9 @@ class Wire(topologic.Wire):
1601
1577
  x1 = origin.X()
1602
1578
  y1 = origin.Y()
1603
1579
  z1 = origin.Z()
1604
- x2 = origin.X() + dirX
1605
- y2 = origin.Y() + dirY
1606
- z2 = origin.Z() + dirZ
1580
+ x2 = origin.X() + direction[0]
1581
+ y2 = origin.Y() + direction[1]
1582
+ z2 = origin.Z() + direction[2]
1607
1583
  dx = x2 - x1
1608
1584
  dy = y2 - y1
1609
1585
  dz = z2 - z1
@@ -1619,7 +1595,7 @@ class Wire(topologic.Wire):
1619
1595
 
1620
1596
 
1621
1597
  @staticmethod
1622
- def Trapezoid(origin=None, widthA=1.0, widthB=0.75, offsetA=0.0, offsetB=0.0, length=1.0, dirX=0, dirY=0, dirZ=1, placement="center", tolerance=0.0001):
1598
+ def Trapezoid(origin=None, widthA=1.0, widthB=0.75, offsetA=0.0, offsetB=0.0, length=1.0, direction=[0,0,1], placement="center", tolerance=0.0001):
1623
1599
  """
1624
1600
  Creates a trapezoid.
1625
1601
 
@@ -1637,12 +1613,8 @@ class Wire(topologic.Wire):
1637
1613
  The offset of the top edge of the trapezoid. The default is 0.0.
1638
1614
  length : float , optional
1639
1615
  The length of the trapezoid. The default is 1.0.
1640
- dirX : float , optional
1641
- The X component of the vector representing the up direction of the trapezoid. The default is 0.
1642
- dirY : float , optional
1643
- The Y component of the vector representing the up direction of the trapezoid. The default is 0.
1644
- dirZ : float , optional
1645
- The Z component of the vector representing the up direction of the trapezoid. The default is 1.
1616
+ direction : list , optional
1617
+ The vector representing the up direction of the trapezoid. The default is [0,0,1].
1646
1618
  placement : str , optional
1647
1619
  The description of the placement of the origin of the trapezoid. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
1648
1620
  tolerance : float , optional
@@ -1683,9 +1655,9 @@ class Wire(topologic.Wire):
1683
1655
  x1 = origin.X()
1684
1656
  y1 = origin.Y()
1685
1657
  z1 = origin.Z()
1686
- x2 = origin.X() + dirX
1687
- y2 = origin.Y() + dirY
1688
- z2 = origin.Z() + dirZ
1658
+ x2 = origin.X() + direction[0]
1659
+ y2 = origin.Y() + direction[1]
1660
+ z2 = origin.Z() + direction[2]
1689
1661
  dx = x2 - x1
1690
1662
  dy = y2 - y1
1691
1663
  dz = z2 - z1
topologicpy/__init__.py CHANGED
@@ -2,7 +2,7 @@ import sys
2
2
  import os, re
3
3
  from sys import platform
4
4
 
5
- __version__ = '0.2.2'
5
+ __version__ = '0.2.3'
6
6
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
7
7
 
8
8
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.2.2
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
@@ -1,14 +1,14 @@
1
1
  topologicpy/Aperture.py,sha256=ySMf1mL3VnboaEWMCnuO_XpKk8DTeu2XVjKGYTD3Zxk,1142
2
- topologicpy/Cell.py,sha256=RWuDpmOjZgJNvQb1Qg51rYKmyPBk-Up3AVEADBGUPhg,62599
3
- topologicpy/CellComplex.py,sha256=ujp1sEzvpLIdkwmT-mHiwrDKdbcQ4MqT4FL-x7BxvE8,28396
4
- topologicpy/Cluster.py,sha256=tsuFWlGtynxCCMR98CXUDhg1RxvgJiwVr9Y-Tx9saA0,19197
2
+ topologicpy/Cell.py,sha256=nOsO5IMCABjcAz9CdDFaGWuaZJfEeDVdKYMviv82JDk,64152
3
+ topologicpy/CellComplex.py,sha256=TvbVV2QzwSQ_jbEZxoPCl3fzjnUNN5wF5eon13ErrdY,27963
4
+ topologicpy/Cluster.py,sha256=V5fL-i3-RJ_znkU6A15FdHNMF_OFY4QxnKnnKayXLPw,18914
5
5
  topologicpy/Color.py,sha256=CtzZitCjDIZVeRhb-Zkzcvxzwt2TAaNl_0zDN3mecpw,2672
6
6
  topologicpy/Context.py,sha256=Ls1QnLtwOLGzM5qABtK-8Nd8RL3-WjkNzVBKNh05FgY,1178
7
- topologicpy/DGL.py,sha256=YXO4ZwKZCn3Ils9s0UsHAlgNMU_l_c480ktZkbpLDf0,71946
7
+ topologicpy/DGL.py,sha256=wATX78pOOxrwog5_D73CbDU8FEibFcdcoP8MaBT-NZI,72103
8
8
  topologicpy/Dictionary.py,sha256=SMM0wQPySr1AvUX97AQpn1tca5mkkicRN-sUMSR7c_M,17016
9
9
  topologicpy/Edge.py,sha256=_T0NtVNOaTYXBBbw8g0dtbu7g4IotkdEcrYDdiklTds,29056
10
10
  topologicpy/EnergyModel.py,sha256=GgP9Z4kwrGXF6UFEiuVLDnTmcOtpmSMHHNe8LgPQsto,37627
11
- topologicpy/Face.py,sha256=m9yhrhvHknWKYQLxUNErLfC8_ZWiNU5Tz-u5-qUhiYc,57588
11
+ topologicpy/Face.py,sha256=7SYuCr63yRq8cI2MN1DqiiFxszIvdT7DzzI1pnogHf8,61202
12
12
  topologicpy/Graph.py,sha256=u1LG1Hv-DWxGx9ec6tbkN9ewgnlVwXKBI7Rug6Aoiuc,128522
13
13
  topologicpy/Graph_Export.py,sha256=SetKzyvHg4IU7dwZC1MiI187CUO3gHhRPsQzEBDldUY,35612
14
14
  topologicpy/Grid.py,sha256=rArW8J3vkhWt8dx9NDzCSyu4oMowUpsly7rEhsLPFII,16449
@@ -16,17 +16,17 @@ topologicpy/Helper.py,sha256=-1kWBB3acH30a4pqnbJ-tgEzAwCt_2d6YIFFK5LFuFI,4380
16
16
  topologicpy/Honeybee.py,sha256=8KJ49JcpnXjtVb9WTH4Jih6X7shzDHEN8RPJShOR29Y,16467
17
17
  topologicpy/Matrix.py,sha256=GHd_o714eEWbTOhRM5X-fXcgsV5yYJJSj6xFdnkwC14,7625
18
18
  topologicpy/Neo4jGraph.py,sha256=_5Mqnwx98EWDA_gfGD93SlivdELSXUhcQ7WjqXLVi_I,10771
19
- topologicpy/Plotly.py,sha256=ZPtfH5bx_pEt5xWIt8YGTFIvUWO07HZ9G2mekFXh8dc,43488
19
+ topologicpy/Plotly.py,sha256=hX-WAOQpQ9gNEg-wyV9pBWsh5D14O5dadCZVCAPj1WY,44815
20
20
  topologicpy/Process.py,sha256=YyPYq9HdzIwyEMog7gF_jIBskD_vVWAzTrVS8mcEwOc,53710
21
21
  topologicpy/SQL.py,sha256=6pdbdBAkpNi0VbIat996Swna-qQ-Osm31Kq6YCTEOH8,1892
22
- topologicpy/Shell.py,sha256=z7LJjUld1l5lgS4l9q0Dzh62UjqcLDRXNN0U7ymBXhM,46746
22
+ topologicpy/Shell.py,sha256=9hUmykMLwOkFgrlZ5GRu5S2KjkmzXniTCI8bOU_Cn5g,45389
23
23
  topologicpy/Speckle.py,sha256=65IHXjuNhHAusy4kPp70wlPF8QueSPJ-85v6dPc0uo4,11548
24
- topologicpy/Topology.py,sha256=pLiPExACXOWO1VuzvdUL0e07tg8h_oltHzy5MbBoQfU,200502
25
- topologicpy/UnitTest.py,sha256=nv64QO_be6Hf3UvW9AMmwLwCROH8FlpbVD4cd8Q1Hxw,1386
26
- topologicpy/Vector.py,sha256=9BiTr6vCkn6yn__lXI347XlMTMTAulKyHMim5SpiEaA,6702
24
+ topologicpy/Topology.py,sha256=YUVTKqhWe106n757lcbXJbTQd9UD2k_L50IswTIa3D8,202561
25
+ topologicpy/UnitTest.py,sha256=JBgLkWaJQd4Ee1XSyLVojEbRJKcxj-DbeVSxoeHmiOs,1380
26
+ topologicpy/Vector.py,sha256=TrOubkCxt88fbx-hM8we1w1JE2j0zbJPJMBInolyVNU,13353
27
27
  topologicpy/Vertex.py,sha256=HrYxLJSctxl0ZwCDgSCsX5-L8EZm-eezd06Q5FkRGNY,23122
28
- topologicpy/Wire.py,sha256=HkGvDsNmYECGZVjNY1L4ll00tFhe_6OW1wLx3tdseRU,71315
29
- topologicpy/__init__.py,sha256=Qgzw_bRSJLKlr66ONUt7uUsYtTrwhCslBoK5m_MccI0,641
28
+ topologicpy/Wire.py,sha256=3QF6aXHiZLqcvBfIAoAIBq-hNebJ2VcUrThrtOI7QhI,69372
29
+ topologicpy/__init__.py,sha256=HIlqMnCOLsyj7UgN8RZ-_etEexuh-9EQwgPvmWjgBlI,641
30
30
  topologicpy/bin/linux/topologic/__init__.py,sha256=qdj8gyp_GtYre27ZdFiVdLzLViOgX62woBZLTy9K91c,58
31
31
  topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so,sha256=uvar01STZ8qu1c8fRmtYdVnK8evxBv305QScASXY9go,1852112
32
32
  topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so,sha256=42yjVWetFu_qn6-eZcDxgd_A8SQN_wHqkdw91txKt9U,1852112
@@ -69,8 +69,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
69
69
  topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
70
70
  topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
71
71
  topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
72
- topologicpy-0.2.2.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
73
- topologicpy-0.2.2.dist-info/METADATA,sha256=pHCV9xuGAiZvWCNiWQZYQe4Ix5hAe187miIRBu9gI38,7162
74
- topologicpy-0.2.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
75
- topologicpy-0.2.2.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
76
- topologicpy-0.2.2.dist-info/RECORD,,
72
+ topologicpy-0.2.3.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
73
+ topologicpy-0.2.3.dist-info/METADATA,sha256=a22jVVpE7Bk8peOhZFQJOU7imYa4ail_iTJuZlRmo78,7162
74
+ topologicpy-0.2.3.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
75
+ topologicpy-0.2.3.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
76
+ topologicpy-0.2.3.dist-info/RECORD,,