topologicpy 0.7.90__py3-none-any.whl → 0.7.92__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/Plotly.py CHANGED
@@ -411,29 +411,46 @@ class Plotly:
411
411
 
412
412
  if showVertices:
413
413
  vertices = Graph.Vertices(graph)
414
- #v_dictionaries = [Topology.Dictionary(v) for v in vertices]
414
+ v_dictionaries = [Topology.Dictionary(v) for v in vertices]
415
415
  e_cluster = Cluster.ByTopologies(vertices)
416
416
  geo = Topology.Geometry(e_cluster, mantissa=mantissa)
417
417
  vertices = geo['vertices']
418
418
  if len(vertices) > 0:
419
- v_data = Plotly.DataByTopology(e_cluster,
420
- vertexColor=vertexColor,
421
- vertexColorKey=vertexColorKey,
422
- vertexSize=vertexSize,
423
- vertexSizeKey=vertexSizeKey,
424
- vertexLabelKey=vertexLabelKey,
425
- showVertexLabel=showVertexLabel,
426
- vertexGroupKey=vertexGroupKey,
427
- vertexMinGroup=vertexMinGroup,
428
- vertexMaxGroup=vertexMaxGroup,
429
- vertexGroups=vertexGroups,
430
- showVertexLegend=showVertexLegend,
431
- vertexLegendLabel=vertexLegendLabel,
432
- vertexLegendGroup=vertexLegendGroup,
433
- vertexLegendRank=vertexLegendRank,
434
- colorScale=colorScale)
435
-
436
- data += v_data
419
+ v_data = Plotly.vertexData(vertices,
420
+ dictionaries=v_dictionaries,
421
+ color=vertexColor,
422
+ colorKey=vertexColorKey,
423
+ size=vertexSize,
424
+ sizeKey=vertexSizeKey,
425
+ labelKey=vertexLabelKey,
426
+ showVertexLabel=showVertexLabel,
427
+ groupKey=vertexGroupKey,
428
+ minGroup=vertexMinGroup,
429
+ maxGroup=vertexMaxGroup,
430
+ groups=vertexGroups,
431
+ legendLabel=vertexLegendLabel,
432
+ legendGroup=vertexLegendGroup,
433
+ legendRank=vertexLegendRank,
434
+ showLegend=showVertexLegend,
435
+ colorScale=colorScale)
436
+
437
+ # v_data = Plotly.DataByTopology(e_cluster,
438
+ # vertexColor=vertexColor,
439
+ # vertexColorKey=vertexColorKey,
440
+ # vertexSize=vertexSize,
441
+ # vertexSizeKey=vertexSizeKey,
442
+ # vertexLabelKey=vertexLabelKey,
443
+ # showVertexLabel=showVertexLabel,
444
+ # vertexGroupKey=vertexGroupKey,
445
+ # vertexMinGroup=vertexMinGroup,
446
+ # vertexMaxGroup=vertexMaxGroup,
447
+ # vertexGroups=vertexGroups,
448
+ # showVertexLegend=showVertexLegend,
449
+ # vertexLegendLabel=vertexLegendLabel,
450
+ # vertexLegendGroup=vertexLegendGroup,
451
+ # vertexLegendRank=vertexLegendRank,
452
+ # colorScale=colorScale)
453
+ data += [v_data]
437
454
 
438
455
  if showEdges:
439
456
  e_dictionaries = []
@@ -501,7 +518,7 @@ class Plotly:
501
518
  z.append(v[2])
502
519
  colors.append(Color.AnyToHex(color))
503
520
  labels.append("Vertex_"+str(m+1).zfill(n))
504
- sizes.append(size)
521
+ sizes.append(max(size, 1.1))
505
522
  if len(dictionaries) > 0:
506
523
  d = dictionaries[m]
507
524
  if d:
@@ -512,7 +529,11 @@ class Plotly:
512
529
  if not labelKey == None:
513
530
  labels[m] = str(Dictionary.ValueAtKey(d, key=labelKey)) or labels[m]
514
531
  if not sizeKey == None:
515
- sizes[m] = Dictionary.ValueAtKey(d, key=sizeKey) or sizes[m]
532
+ sizes[m] = Dictionary.ValueAtKey(d, key=sizeKey)
533
+ if sizes[m] == None:
534
+ sizes[m] = size
535
+ if sizes[m] <= 0:
536
+ sizes[m] = 1.1
516
537
  if not groupKey == None:
517
538
  c_value = Dictionary.ValueAtKey(d, key=groupKey)
518
539
  if not c_value == None:
@@ -540,7 +561,7 @@ class Plotly:
540
561
  if len(labels) < 1:
541
562
  labels = "Vertex_1"
542
563
  if len(sizes) < 1:
543
- sizes = size
564
+ sizes = [size]*len(x)
544
565
  if showVertexLabel == True:
545
566
  mode = "markers+text"
546
567
  else:
topologicpy/Vector.py CHANGED
@@ -312,7 +312,7 @@ class Vector(list):
312
312
  return vector
313
313
 
314
314
  @staticmethod
315
- def CompassAngle(vectorA, vectorB, mantissa=6, tolerance=0.0001):
315
+ def CompassAngle(vectorA, vectorB, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
316
316
  """
317
317
  Returns the horizontal compass angle in degrees between the two input vectors. The angle is measured in clockwise fashion.
318
318
  0 is along the positive Y-axis, 90 is along the positive X axis.
@@ -328,6 +328,8 @@ class Vector(list):
328
328
  The length of the desired mantissa. The default is 6.
329
329
  tolerance : float , optional
330
330
  The desired tolerance. The default is 0.0001.
331
+ silent : bool , optional
332
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
331
333
 
332
334
  Returns
333
335
  -------
@@ -335,9 +337,21 @@ class Vector(list):
335
337
  The horizontal compass angle in degrees between the two input vectors.
336
338
 
337
339
  """
340
+ if not isinstance(vectorA, list):
341
+ if not silent:
342
+ print("Vector.Coordinates - Error: The input vectorA parameter is not a valid vector. Returning Nonne.")
343
+ return None
344
+ if not isinstance(vectorB, list):
345
+ if not silent:
346
+ print("Vector.Coordinates - Error: The input vectorB parameter is not a valid vector. Returning Nonne.")
347
+ return None
338
348
  if abs(vectorA[0]) < tolerance and abs(vectorA[1]) < tolerance:
349
+ if not silent:
350
+ print("Vector.CompassAngle - Error: The input vectorA parameter is vertical in the Z Axis. Returning Nonne.")
339
351
  return None
340
352
  if abs(vectorB[0]) < tolerance and abs(vectorB[1]) < tolerance:
353
+ if not silent:
354
+ print("Vector.CompassAngle - Error: The input vectorB parameter is vertical in the Z Axis. Returning Nonne.")
341
355
  return None
342
356
  p1 = (vectorA[0], vectorA[1])
343
357
  p2 = (vectorB[0], vectorB[1])
@@ -346,7 +360,7 @@ class Vector(list):
346
360
  return round(rad2deg((ang1 - ang2) % (2 * pi)), mantissa)
347
361
 
348
362
  @staticmethod
349
- def Coordinates(vector, outputType="xyz", mantissa: int = 6):
363
+ def Coordinates(vector, outputType="xyz", mantissa: int = 6, silent: bool = False):
350
364
  """
351
365
  Returns the coordinates of the input vector.
352
366
 
@@ -358,6 +372,8 @@ class Vector(list):
358
372
  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.
359
373
  mantissa : int , optional
360
374
  The desired length of the mantissa. The default is 6.
375
+ silent : bool , optional
376
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
361
377
 
362
378
  Returns
363
379
  -------
@@ -366,6 +382,8 @@ class Vector(list):
366
382
 
367
383
  """
368
384
  if not isinstance(vector, list):
385
+ if not silent:
386
+ print("Vector.Coordinates - Error: The input vector parameter is not a valid vector. Returning None.")
369
387
  return None
370
388
  x = round(vector[0], mantissa)
371
389
  y = round(vector[1], mantissa)
@@ -390,7 +408,7 @@ class Vector(list):
390
408
  return output
391
409
 
392
410
  @staticmethod
393
- def Cross(vectorA, vectorB, mantissa=6, tolerance=0.0001):
411
+ def Cross(vectorA, vectorB, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
394
412
  """
395
413
  Returns the cross product of the two input vectors. The resulting vector is perpendicular to the plane defined by the two input vectors.
396
414
 
@@ -404,6 +422,8 @@ class Vector(list):
404
422
  The length of the desired mantissa. The default is 6.
405
423
  tolerance : float, optional
406
424
  the desired tolerance. The default is 0.0001.
425
+ silent : bool , optional
426
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
407
427
 
408
428
  Returns
409
429
  -------
@@ -411,9 +431,21 @@ class Vector(list):
411
431
  The vector representing the cross product of the two input vectors.
412
432
 
413
433
  """
414
- if not isinstance(vectorA, list) or not isinstance(vectorB, list):
434
+ if not isinstance(vectorA, list):
435
+ if not silent:
436
+ print("Vector.Cross - Error: The input vectorA parameter is not a valid vector. Returning None.")
437
+ return None
438
+ if not isinstance(vectorB, list):
439
+ if not silent:
440
+ print("Vector.Cross - Error: The input vectorB parameter is not a valid vector. Returning None.")
415
441
  return None
416
- if Vector.Magnitude(vector=vectorA, mantissa=mantissa) < tolerance or Vector.Magnitude(vector=vectorB, mantissa=mantissa) < tolerance:
442
+ if Vector.Magnitude(vector=vectorA, mantissa=mantissa) < tolerance:
443
+ if not silent:
444
+ print("Vector.Cross - Error: The magnitude of the input vectorA parameter is less than the input tolerance parameter. Returning None.")
445
+ return None
446
+ if Vector.Magnitude(vector=vectorB, mantissa=mantissa) < tolerance:
447
+ if not silent:
448
+ print("Vector.Cross - Error: The magnitude of the input vectorB parameter is less than the input tolerance parameter. Returning None.")
417
449
  return None
418
450
  vecA = np.array(vectorA)
419
451
  vecB = np.array(vectorB)
@@ -423,7 +455,7 @@ class Vector(list):
423
455
  return [round(vecC[0], mantissa), round(vecC[1], mantissa), round(vecC[2], mantissa)]
424
456
 
425
457
  @staticmethod
426
- def Dot(vectorA, vectorB, mantissa=6):
458
+ def Dot(vectorA, vectorB, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
427
459
  """
428
460
  Returns the dot product of the two input vectors which is a measure of how much they are aligned.
429
461
 
@@ -435,6 +467,10 @@ class Vector(list):
435
467
  The second vector.
436
468
  mantissa : int, optional
437
469
  The length of the desired mantissa. The default is 6.
470
+ tolerance : float, optional
471
+ the desired tolerance. The default is 0.0001.
472
+ silent : bool , optional
473
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
438
474
 
439
475
  Returns
440
476
  -------
@@ -442,6 +478,22 @@ class Vector(list):
442
478
  The vector representing the cross product of the two input vectors.
443
479
 
444
480
  """
481
+ if not isinstance(vectorA, list):
482
+ if not silent:
483
+ print("Vector.Dot - Error: The input vectorA parameter is not a valid vector. Returning None.")
484
+ return None
485
+ if not isinstance(vectorB, list):
486
+ if not silent:
487
+ print("Vector.Dot - Error: The input vectorB parameter is not a valid vector. Returning None.")
488
+ return None
489
+ if Vector.Magnitude(vector=vectorA, mantissa=mantissa) < tolerance:
490
+ if not silent:
491
+ print("Vector.Dot - Error: The magnitude of the input vectorA parameter is less than the input tolerance parameter. Returning None.")
492
+ return None
493
+ if Vector.Magnitude(vector=vectorB, mantissa=mantissa) < tolerance:
494
+ if not silent:
495
+ print("Vector.Dot - Error: The magnitude of the input vectorB parameter is less than the input tolerance parameter. Returning None.")
496
+ return None
445
497
  return round(sum(a*b for a, b in zip(vectorA, vectorB)), mantissa)
446
498
 
447
499
  @staticmethod
@@ -506,42 +558,6 @@ class Vector(list):
506
558
  # Compute bisecting vector
507
559
  return False
508
560
 
509
- @staticmethod
510
- def IsParallel(vectorA, vectorB):
511
- """
512
- Returns True if the input vectors are parallel. Returns False otherwise.
513
-
514
- Parameters
515
- ----------
516
- vectorA : list
517
- The first input vector.
518
- vectorB : list
519
- The second input vector.
520
-
521
- Returns
522
- -------
523
- bool
524
- True if the input vectors are parallel. False otherwise.
525
-
526
- """
527
- import numpy as np
528
-
529
- # Ensure vectors are numpy arrays
530
- vector1 = np.array(vectorA)
531
- vector2 = np.array(vectorB)
532
-
533
- # Normalize input vectors
534
- vector1_norm = vector1 / np.linalg.norm(vector1)
535
- vector2_norm = vector2 / np.linalg.norm(vector2)
536
-
537
- # Check if the angle between vectors is either 0 or 180 degrees
538
- dot_product = np.dot(vector1_norm, vector2_norm)
539
- if np.isclose(dot_product, 1.0):
540
- return True
541
- else:
542
- # Compute bisecting vector
543
- return False
544
-
545
561
  @staticmethod
546
562
  def IsCollinear(vectorA, vectorB):
547
563
  """
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.90'
1
+ __version__ = '0.7.92'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.90
3
+ Version: 0.7.92
4
4
  Summary: An AI-Powered Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  License: AGPL v3 License
@@ -10,27 +10,27 @@ topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
10
10
  topologicpy/Dictionary.py,sha256=t0O7Du-iPq46FyKqZfcjHfsUK1E8GS_e67R2V5cpkbw,33186
11
11
  topologicpy/Edge.py,sha256=KWOJCkLDwCWyZJ5MKwDhT5umWwCYBHtLOz6ulHrSOfY,67205
12
12
  topologicpy/EnergyModel.py,sha256=AqTtmXE35SxvRXhG3vYAQd7GQDW-6HtjYPHua6ME4Eg,53762
13
- topologicpy/Face.py,sha256=f4DrZJ2AgwnTwIorJpwuOXtWq501wOMRixMgHZC78so,143843
14
- topologicpy/Graph.py,sha256=Zxmoy2FAl5m_MGUd62jDeajmZAFlKXVHf1Fy68TrsSw,436694
13
+ topologicpy/Face.py,sha256=2k1vSRK1M-s588RcqGHEalwIHJ9nT3qgx3pU4ktN0dU,150077
14
+ topologicpy/Graph.py,sha256=LJek7dV9bq9uBf_2akAYrETjbSFfoPgLaMsHs4brvc4,455475
15
15
  topologicpy/Grid.py,sha256=2s9cSlWldivn1i9EUz4OOokJyANveqmRe_vR93CAndI,18245
16
16
  topologicpy/Helper.py,sha256=F3h4_qcOD_PHAoVe0tEbEE7_jYyVcaHjtwVs4QHOZuI,23978
17
17
  topologicpy/Honeybee.py,sha256=HfTaEV1R8K1xOVQQy9sBOhBTF_ap8A2RxZOYhirp_Mw,21835
18
18
  topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
19
19
  topologicpy/Neo4j.py,sha256=t52hgE9cVsqkGc7m7fjRsLnyfRHakVHwdvF4ms7ow78,22342
20
- topologicpy/Plotly.py,sha256=Ld-VrYAn_FwONYwdVoz-7Kqt-5fs-qbVl35Utmcu7OE,114508
20
+ topologicpy/Plotly.py,sha256=Tvo0_zKVEHtPhsMNNvLy5G0HIys5FPAOyp_o4QN_I_A,115760
21
21
  topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
22
22
  topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
23
23
  topologicpy/Shell.py,sha256=UdDz3zfIYmGRjoZIseviJ2cXNtR5Kx5tIsZLhWMyO_U,87906
24
24
  topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
25
25
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
26
26
  topologicpy/Topology.py,sha256=d99wryPPXvw7eRw12GVKV-DT6jhlmVq6GsMAjg-E-40,441693
27
- topologicpy/Vector.py,sha256=A1g83zDHep58iVPY8WQ8iHNrSOfGWFEzvVeDuMnjDNY,33078
27
+ topologicpy/Vector.py,sha256=Cl7besf20cAGmyNPh-9gbFAHnRU5ZWSMChJ3VyFIDs4,35416
28
28
  topologicpy/Vertex.py,sha256=sYWTbAHqKGRUAJRCIUqrCO_xFhvsXK09Sx7E4dafPLQ,73754
29
29
  topologicpy/Wire.py,sha256=HjagWKoJb8Z3zhgOij_4k6ZnKIl5gk8LletHbsT1ZKU,190632
30
30
  topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
31
- topologicpy/version.py,sha256=mYCzbNDO5wSdD-Yv5YhtOF5hGlgyQ-E65V4XiSUOLnk,23
32
- topologicpy-0.7.90.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
- topologicpy-0.7.90.dist-info/METADATA,sha256=h8bGLDHNJXflEvDHHSsD0bDwwj39F_AvSqvvwVvi5Ec,10513
34
- topologicpy-0.7.90.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
35
- topologicpy-0.7.90.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
- topologicpy-0.7.90.dist-info/RECORD,,
31
+ topologicpy/version.py,sha256=hEe71TmHDfYxdkk064adNlI0kHL1_wHg4VoGMKoeSWM,23
32
+ topologicpy-0.7.92.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
+ topologicpy-0.7.92.dist-info/METADATA,sha256=t-giZYVXIF8phaA32BSO55_r4qGngtkKS_MMHUjD-aA,10513
34
+ topologicpy-0.7.92.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
35
+ topologicpy-0.7.92.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
+ topologicpy-0.7.92.dist-info/RECORD,,