topologicpy 0.8.3__py3-none-any.whl → 0.8.5__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
@@ -714,15 +714,6 @@ class Plotly:
714
714
  traces.append(trace)
715
715
  return traces
716
716
 
717
-
718
-
719
-
720
-
721
-
722
-
723
-
724
-
725
-
726
717
  @staticmethod
727
718
  def DataByTopology(topology,
728
719
  showVertices=True,
@@ -1106,9 +1097,10 @@ class Plotly:
1106
1097
  faceColor = Dictionary.ValueAtKey(d, key=faceColorKey) or faceColor
1107
1098
  if not faceOpacityKey == None:
1108
1099
  d = Topology.Dictionary(topology)
1109
- d_opacity = Dictionary.ValueAtKey(d, key=faceOpacityKey) or faceOpacity
1110
- if 0 < d_opacity < 1:
1111
- faceOpacity = d_opacity
1100
+ d_opacity = Dictionary.ValueAtKey(d, key=faceOpacityKey)
1101
+ if not d_opacity == None:
1102
+ if 0 <= d_opacity <= 1:
1103
+ faceOpacity = d_opacity
1112
1104
  if Topology.IsInstance(topology, "Face"):
1113
1105
  tp_faces = [topology]
1114
1106
  else:
topologicpy/Topology.py CHANGED
@@ -4195,8 +4195,10 @@ class Topology():
4195
4195
  if normalize == False:
4196
4196
  scale_factor = 1.0
4197
4197
  else:
4198
- edges = Topology.Edges(translated_top)
4199
- max_edge_length = max([Edge.Length(edge, mantissa=mantissa) for edge in edges])
4198
+ #edges = Topology.Edges(translated_top)
4199
+ #max_edge_length = max([Edge.Length(edge, mantissa=mantissa) for edge in edges])
4200
+ longest_edges = Topology.LongestEdges(translated_top, removeCoplanarFaces=True)
4201
+ max_edge_length = Edge.Length(longest_edges[0])
4200
4202
  scale_factor = 1.0 / max_edge_length if max_edge_length != 0 else 1.0
4201
4203
  scaling_matrix = Matrix.ByScaling(scaleX=scale_factor, scaleY=scale_factor, scaleZ=scale_factor)
4202
4204
  scaled_top = Topology.Scale(translated_top, origin=Vertex.Origin(), x=scale_factor, y=scale_factor, z=scale_factor)
@@ -6602,9 +6604,9 @@ class Topology():
6602
6604
  return None
6603
6605
  return topologic.Topology.IsSame(topologyA, topologyB)
6604
6606
 
6605
- def IsVertexMatched(topologyA, topologyB, mantissa: int = 6, tolerance=0.0001, silent : bool = False):
6607
+ def IsVertexCongruent(topologyA, topologyB, mantissa: int = 6, tolerance=0.0001, silent : bool = False):
6606
6608
  """
6607
- Returns True if the input topologies are vertex matched (have same number of vertices and all vertices are coincedent within a tolerance). Returns False otherwise.
6609
+ Returns True if the input topologies are vertex matched (have same number of vertices and all vertices are congruent within a tolerance). Returns False otherwise.
6608
6610
 
6609
6611
  Parameters
6610
6612
  ----------
@@ -6622,7 +6624,7 @@ class Topology():
6622
6624
  Returns
6623
6625
  -------
6624
6626
  bool
6625
- True of the input topologies are vertex matched. False otherwise.
6627
+ True of the input topologies are vertex congruent. False otherwise.
6626
6628
 
6627
6629
  """
6628
6630
  from topologicpy.Vertex import Vertex
@@ -6683,6 +6685,104 @@ class Topology():
6683
6685
  coords_b = [Vertex.Coordinates(v, mantissa=mantissa) for v in vertices_b]
6684
6686
  return coordinates_match(coords_a, coords_b, tolerance=tolerance)
6685
6687
 
6688
+ @staticmethod
6689
+ def LargestFaces(topology, removeCoplanarFaces: bool = False, epsilon: float = 0.001, tolerance: float = 0.0001, silent: bool = False):
6690
+ """
6691
+ Returns the list of the largest faces found in the input topology.
6692
+
6693
+ Parameters
6694
+ ----------
6695
+ topology : topologic_core.Topology
6696
+ The input topology.
6697
+ removeCoplanarFaces : bool , optional
6698
+ If set to True, coplanar faces are removed to find the true largest faces. Otherwise they are not. The default is False.
6699
+ epsilon : float , optional
6700
+ The desired epsilon (another form of tolerance) for finding if two faces are coplanar. The default is 0.01.
6701
+ tolerance : float , optional
6702
+ The desired tolerance. The default is 0.0001.
6703
+ silent : bool , optional
6704
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
6705
+ Returns
6706
+ -------
6707
+ list
6708
+ The list of the largest faces found in the input topology.
6709
+
6710
+ """
6711
+ from topologicpy.Face import Face
6712
+
6713
+ if not Topology.IsInstance(topology, "topology"):
6714
+ if not silent:
6715
+ print("Topology.LaregestFaces - Error: The input topology parameter is not a valid topology. Returning None.")
6716
+ return None
6717
+ faces = Topology.Faces(topology)
6718
+ if len(faces) == 0:
6719
+ if not silent:
6720
+ print("Topology.LargestFaces - Error: The input topology parameter does not contain any faces. Returning None.")
6721
+ return None
6722
+ if len(faces) == 1:
6723
+ return faces
6724
+
6725
+ if removeCoplanarFaces == True:
6726
+ simple_topology = Topology.RemoveCoplanarFaces(topology)
6727
+ simple_topology = Topology.RemoveCollinearEdges(simple_topology)
6728
+ faces = Topology.Faces(simple_topology)
6729
+ face_areas = [Face.Area(face) for face in faces]
6730
+ max_area = max(face_areas)
6731
+ max_faces = []
6732
+ for i, face_area in enumerate(face_areas):
6733
+ if abs(max_area - face_area) < tolerance:
6734
+ max_faces.append(faces[i])
6735
+ return max_faces
6736
+
6737
+ @staticmethod
6738
+ def LongestEdges(topology, removeCoplanarFaces: bool = False, epsilon: float = 0.001, tolerance: float = 0.0001, silent: bool = False):
6739
+ """
6740
+ Returns the list of the longest edges found in the input topology.
6741
+
6742
+ Parameters
6743
+ ----------
6744
+ topology : topologic_core.Topology
6745
+ The input topology.
6746
+ removeCoplanarFaces : bool , optional
6747
+ If set to True, coplanar faces are removed to find the true longest straight edges. Otherwise they are not. The default is False.
6748
+ epsilon : float , optional
6749
+ The desired epsilon (another form of tolerance) for finding if two faces are coplanar. The default is 0.01.
6750
+ tolerance : float , optional
6751
+ The desired tolerance. The default is 0.0001.
6752
+ silent : bool , optional
6753
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
6754
+ Returns
6755
+ -------
6756
+ list
6757
+ The list of of the longest edges found in the input topology.
6758
+
6759
+ """
6760
+ from topologicpy.Edge import Edge
6761
+
6762
+ if not Topology.IsInstance(topology, "topology"):
6763
+ if not silent:
6764
+ print("Topology.LongestEdges - Error: The input topology parameter is not a valid topology. Returning None.")
6765
+ return None
6766
+ edges = Topology.Edges(topology)
6767
+ if len(edges) == 0:
6768
+ if not silent:
6769
+ print("Topology.LongestEdges - Error: The input topology parameter does not contain any edges. Returning None.")
6770
+ return None
6771
+ if len(edges) == 1:
6772
+ return edges
6773
+
6774
+ if removeCoplanarFaces == True:
6775
+ simple_topology = Topology.RemoveCoplanarFaces(topology)
6776
+ simple_topology = Topology.RemoveCollinearEdges(simple_topology)
6777
+ edges = Topology.Edges(simple_topology)
6778
+ edge_lengths = [Edge.Length(edge) for edge in edges]
6779
+ max_length = max(edge_lengths)
6780
+ max_edges = []
6781
+ for i, edge_length in enumerate(edge_lengths):
6782
+ if abs(max_length - edge_length) < tolerance:
6783
+ max_edges.append(edges[i])
6784
+ return max_edges
6785
+
6686
6786
  @staticmethod
6687
6787
  def MergeAll(topologies, tolerance=0.0001):
6688
6788
  """
@@ -8172,7 +8272,6 @@ class Topology():
8172
8272
  l = None
8173
8273
  return l
8174
8274
 
8175
-
8176
8275
  @staticmethod
8177
8276
  def SharedFaces(topologyA, topologyB):
8178
8277
  """
@@ -8199,7 +8298,56 @@ class Topology():
8199
8298
  except:
8200
8299
  l = None
8201
8300
  return l
8202
-
8301
+
8302
+ @staticmethod
8303
+ def ShortestEdges(topology, removeCoplanarFaces: bool = False, epsilon: float = 0.001, tolerance: float = 0.0001, silent: bool = False):
8304
+ """
8305
+ Returns the list of the shortest edges found in the input topology.
8306
+
8307
+ Parameters
8308
+ ----------
8309
+ topology : topologic_core.Topology
8310
+ The input topology.
8311
+ removeCoplanarFaces : bool , optional
8312
+ If set to True, coplanar faces are removed to find the true shortest straight edges. Otherwise they are not. The default is False.
8313
+ epsilon : float , optional
8314
+ The desired epsilon (another form of tolerance) for finding if two faces are coplanar. The default is 0.01.
8315
+ tolerance : float , optional
8316
+ The desired tolerance. The default is 0.0001.
8317
+ silent : bool , optional
8318
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
8319
+ Returns
8320
+ -------
8321
+ list
8322
+ The list of the shortest edges found in the input topology.
8323
+
8324
+ """
8325
+ from topologicpy.Edge import Edge
8326
+
8327
+ if not Topology.IsInstance(topology, "topology"):
8328
+ if not silent:
8329
+ print("Topology.ShortestEdges - Error: The input topology parameter is not a valid topology. Returning None.")
8330
+ return None
8331
+ edges = Topology.Edges(topology)
8332
+ if len(edges) == 0:
8333
+ if not silent:
8334
+ print("Topology.ShortestEdges - Error: The input topology parameter does not contain any edges. Returning None.")
8335
+ return None
8336
+ if len(edges) == 1:
8337
+ return edges[0]
8338
+
8339
+ if removeCoplanarFaces == True:
8340
+ simple_topology = Topology.RemoveCoplanarFaces(topology)
8341
+ simple_topology = Topology.RemoveCollinearEdges(simple_topology)
8342
+ edges = Topology.Edges(simple_topology)
8343
+ edge_lengths = [Edge.Length(edge) for edge in edges]
8344
+ min_length = min(edge_lengths)
8345
+ min_edges = []
8346
+ for i, edge_length in enumerate(edge_lengths):
8347
+ if abs(min_length - edge_length) < tolerance:
8348
+ min_edges.append(edges[i])
8349
+ return min_edges
8350
+
8203
8351
  @staticmethod
8204
8352
  def Show(*topologies,
8205
8353
  nameKey = "name",
@@ -8618,6 +8766,55 @@ class Topology():
8618
8766
  figure = Plotly.AddColorBar(figure, values=cbValues, nTicks=cbTicks, xPosition=cbX, width=cbWidth, outlineWidth=cbOutlineWidth, title=cbTitle, subTitle=cbSubTitle, units=cbUnits, colorScale=colorScale, mantissa=mantissa)
8619
8767
  Plotly.Show(figure=figure, renderer=renderer, camera=camera, center=center, up=up, projection=projection)
8620
8768
 
8769
+ @staticmethod
8770
+ def SmallestFaces(topology, removeCoplanarFaces: bool = False, epsilon: float = 0.001, tolerance: float = 0.0001, silent: bool = False):
8771
+ """
8772
+ Returns the list of the smallest faces found in the input topology.
8773
+
8774
+ Parameters
8775
+ ----------
8776
+ topology : topologic_core.Topology
8777
+ The input topology.
8778
+ removeCoplanarFaces : bool , optional
8779
+ If set to True, coplanar faces are removed to find the true smallest faces. Otherwise they are not. The default is False.
8780
+ epsilon : float , optional
8781
+ The desired epsilon (another form of tolerance) for finding if two faces are coplanar. The default is 0.01.
8782
+ tolerance : float , optional
8783
+ The desired tolerance. The default is 0.0001.
8784
+ silent : bool , optional
8785
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
8786
+ Returns
8787
+ -------
8788
+ list
8789
+ The list of the smallest faces found in the input topology.
8790
+
8791
+ """
8792
+ from topologicpy.Face import Face
8793
+
8794
+ if not Topology.IsInstance(topology, "topology"):
8795
+ if not silent:
8796
+ print("Topology.SmallestFaces - Error: The input topology parameter is not a valid topology. Returning None.")
8797
+ return None
8798
+ faces = Topology.Faces(topology)
8799
+ if len(faces) == 0:
8800
+ if not silent:
8801
+ print("Topology.SmallestFaces - Error: The input topology parameter does not contain any faces. Returning None.")
8802
+ return None
8803
+ if len(faces) == 1:
8804
+ return faces
8805
+
8806
+ if removeCoplanarFaces == True:
8807
+ simple_topology = Topology.RemoveCoplanarFaces(topology)
8808
+ simple_topology = Topology.RemoveCollinearEdges(simple_topology)
8809
+ faces = Topology.Faces(simple_topology)
8810
+ face_areas = [Face.Area(face) for face in faces]
8811
+ min_area = min(face_areas)
8812
+ min_faces = []
8813
+ for i, face_area in enumerate(face_areas):
8814
+ if abs(min_area - face_area) < tolerance:
8815
+ min_faces.append(faces[i])
8816
+ return min_faces
8817
+
8621
8818
  @staticmethod
8622
8819
  def SortBySelectors(topologies, selectors, exclusive=False, tolerance=0.0001):
8623
8820
  """
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.8.3'
1
+ __version__ = '0.8.5'
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: topologicpy
3
- Version: 0.8.3
3
+ Version: 0.8.5
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
@@ -115,12 +115,12 @@ To cite one of the main papers that defines topologicpy, you can use:
115
115
 
116
116
  Or you can import the following .bib formatted references into your favourite reference manager
117
117
  ```
118
- @misc{Jabi2024,
118
+ @misc{Jabi2025,
119
119
  author = {Wassim Jabi},
120
120
  doi = {https://doi.org/10.5281/zenodo.11555173},
121
121
  title = {topologicpy},
122
122
  url = {http://pypi.org/projects/topologicpy},
123
- year = {2024},
123
+ year = {2025},
124
124
  }
125
125
  ```
126
126
  ```
@@ -140,6 +140,6 @@ Or you can import the following .bib formatted references into your favourite re
140
140
  }
141
141
  ```
142
142
 
143
- topologicpy: © 2024 Wassim Jabi
143
+ topologicpy: © 2025 Wassim Jabi
144
144
 
145
- Topologic: © 2024 Cardiff University and UCL
145
+ Topologic: © 2025 Cardiff University and UCL
@@ -17,20 +17,20 @@ topologicpy/Helper.py,sha256=DAAE_Ie_ekeMnCvcW08xXRwSAGCkjrS4lbz-o3ELuY4,27172
17
17
  topologicpy/Honeybee.py,sha256=Y_El6M8x3ixvvIe_VcRiwj_4C89ZZg5_WlT7adbCkpw,21849
18
18
  topologicpy/Matrix.py,sha256=ydw0EH4rZcGBFeLmBHPIyuk57DVKKL3M1GcArkFsYxM,10941
19
19
  topologicpy/Neo4j.py,sha256=BKOF29fRgXmdpMGkrNzuYbyqgCJ6ElPPMYlfTxXiVbc,22392
20
- topologicpy/Plotly.py,sha256=Tvo0_zKVEHtPhsMNNvLy5G0HIys5FPAOyp_o4QN_I_A,115760
20
+ topologicpy/Plotly.py,sha256=xfd_c2Mcam5KP-gDD-esl42RVXW5TSJsUCCqhUg1VFk,115788
21
21
  topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
22
22
  topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
23
23
  topologicpy/Shell.py,sha256=fLRnQ79vtdBDRW1Xn8Gaap34XheGbw7UBFd-ALJ2Y1g,87978
24
24
  topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
25
25
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
26
- topologicpy/Topology.py,sha256=xbiMgnRrO_My5cHVMajsIuQYU81zsDy6C-7ZQgF5OFU,454552
26
+ topologicpy/Topology.py,sha256=ejgcsZ6KUmQOkJuev102FyqnOSZLuwzupMh1p7g_hCc,463521
27
27
  topologicpy/Vector.py,sha256=Cl7besf20cAGmyNPh-9gbFAHnRU5ZWSMChJ3VyFIDs4,35416
28
28
  topologicpy/Vertex.py,sha256=tv6C-rbuNgXHDGgVLT5fbalynLdXqlUuiCDKtkeQ0vk,77814
29
29
  topologicpy/Wire.py,sha256=Gl3Jpygwp8775SG57ua5r5ffTHcN4FOAkeI87yP1cok,234001
30
30
  topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
31
- topologicpy/version.py,sha256=LokQdkRCwhhLh0zOp7jizhyDgbtAU-IWRIObrz2zLjA,22
32
- topologicpy-0.8.3.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
- topologicpy-0.8.3.dist-info/METADATA,sha256=Alf593hRuyD3EdVldbGvB1qklfCWf2sDcSvktEhmHn8,10512
34
- topologicpy-0.8.3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
35
- topologicpy-0.8.3.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
- topologicpy-0.8.3.dist-info/RECORD,,
31
+ topologicpy/version.py,sha256=Vtr3iQMVF7gSX8AO7oEPv4S6HgRTdmjlmLyqQPj32xc,22
32
+ topologicpy-0.8.5.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
+ topologicpy-0.8.5.dist-info/METADATA,sha256=8Dybj0s_HtTlA0VLOLlmuYS3WP0SKyyiU4Evy5RQBrA,10512
34
+ topologicpy-0.8.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
+ topologicpy-0.8.5.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
+ topologicpy-0.8.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.7.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5