topologicpy 0.7.83__py3-none-any.whl → 0.7.84__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/Cell.py CHANGED
@@ -1967,9 +1967,13 @@ class Cell():
1967
1967
  """
1968
1968
  from topologicpy.Face import Face
1969
1969
  from topologicpy.Topology import Topology
1970
-
1970
+ import inspect
1971
+
1971
1972
  if not Topology.IsInstance(cell, "Cell"):
1972
1973
  print("Cell.RemoveCollinearEdges - Error: The input cell parameter is not a valid cell. Returning None.")
1974
+ curframe = inspect.currentframe()
1975
+ calframe = inspect.getouterframes(curframe, 2)
1976
+ print('caller name:', calframe[1][3])
1973
1977
  return None
1974
1978
  faces = Cell.Faces(cell)
1975
1979
  clean_faces = []
@@ -972,9 +972,14 @@ class CellComplex():
972
972
  """
973
973
  from topologicpy.Cell import Cell
974
974
  from topologicpy.Topology import Topology
975
-
975
+ import inspect
976
+
976
977
  if not Topology.IsInstance(cellComplex, "CellComplex"):
977
978
  print("CellComplex.RemoveCollinearEdges - Error: The input cellComplex parameter is not a valid cellComplex. Returning None.")
979
+ print("CellComplex.RemoveCollinearEdges - Inspection:")
980
+ curframe = inspect.currentframe()
981
+ calframe = inspect.getouterframes(curframe, 2)
982
+ print('caller name:', calframe[1][3])
978
983
  return None
979
984
  cells = CellComplex.Cells(cellComplex)
980
985
  clean_cells = []
topologicpy/Edge.py CHANGED
@@ -1477,7 +1477,7 @@ class Edge():
1477
1477
  svb = Edge.StartVertex(edgeB)
1478
1478
  evb = Edge.EndVertex(edgeB)
1479
1479
  intVertex = None
1480
- if Edge.IsCollinear(edgeA, edgeB):
1480
+ if Edge.IsCollinear(edgeA, edgeB, tolerance=tolerance):
1481
1481
  if Vertex.IsInternal(svb, edgeA):
1482
1482
  intVertex = svb
1483
1483
  elif Vertex.IsInternal(evb, edgeA):
topologicpy/Face.py CHANGED
@@ -594,6 +594,7 @@ class Face():
594
594
  # Try the simple method first
595
595
  face = None
596
596
  ext_boundary = Wire.RemoveCollinearEdges(Shell.ExternalBoundary(shell))
597
+ #ext_boundary = Shell.ExternalBoundary(shell)
597
598
  if Topology.IsInstance(ext_boundary, "Wire"):
598
599
  face = Face.ByWire(ext_boundary, silent=silent)
599
600
  elif Topology.IsInstance(ext_boundary, "Cluster"):
@@ -652,8 +653,11 @@ class Face():
652
653
  for int_boundary in int_boundaries:
653
654
  temp_wires = Topology.Wires(int_boundary)
654
655
  int_wires.append(Topology.RemoveCollinearEdges(temp_wires[0], angTolerance))
656
+ #int_wires.append(temp_wires[0])
657
+
655
658
  temp_wires = Topology.Wires(ext_boundary)
656
659
  ext_wire = Topology.RemoveCollinearEdges(temp_wires[0], angTolerance)
660
+ #ext_wire = temp_wires[0]
657
661
  face = Face.ByWires(ext_wire, int_wires)
658
662
  face = Topology.Unflatten(face, origin=origin, direction=normal)
659
663
  return face
@@ -2573,9 +2577,13 @@ class Face():
2573
2577
  """
2574
2578
  from topologicpy.Wire import Wire
2575
2579
  from topologicpy.Topology import Topology
2576
-
2580
+ import inspect
2581
+
2577
2582
  if not Topology.IsInstance(face, "Face"):
2578
2583
  print("Face.RemoveCollinearEdges - Error: The input face parameter is not a valid face. Returning None.")
2584
+ curframe = inspect.currentframe()
2585
+ calframe = inspect.getouterframes(curframe, 2)
2586
+ print('caller name:', calframe[1][3])
2579
2587
  return None
2580
2588
  eb = Wire.RemoveCollinearEdges(Face.Wire(face), angTolerance=angTolerance, tolerance=tolerance)
2581
2589
  ib = [Wire.RemoveCollinearEdges(w, angTolerance=angTolerance, tolerance=tolerance) for w in Face.InternalBoundaries(face)]
topologicpy/Shell.py CHANGED
@@ -1456,9 +1456,13 @@ class Shell():
1456
1456
  """
1457
1457
  from topologicpy.Face import Face
1458
1458
  from topologicpy.Topology import Topology
1459
-
1459
+ import inspect
1460
+
1460
1461
  if not Topology.IsInstance(shell, "Shell"):
1461
1462
  print("Shell.RemoveCollinearEdges - Error: The input shell parameter is not a valid shell. Returning None.")
1463
+ curframe = inspect.currentframe()
1464
+ calframe = inspect.getouterframes(curframe, 2)
1465
+ print('caller name:', calframe[1][3])
1462
1466
  return None
1463
1467
  faces = Shell.Faces(shell)
1464
1468
  clean_faces = []
topologicpy/Topology.py CHANGED
@@ -4184,7 +4184,6 @@ class Topology():
4184
4184
  from topologicpy.Dictionary import Dictionary
4185
4185
  from topologicpy.Helper import Helper
4186
4186
  import inspect
4187
- print("input topologies:", topologies)
4188
4187
 
4189
4188
  topologies_list = []
4190
4189
  if Topology.IsInstance(topologies, "Topology"):
@@ -6749,8 +6748,13 @@ class Topology():
6749
6748
  from topologicpy.Cell import Cell
6750
6749
  from topologicpy.CellComplex import CellComplex
6751
6750
  from topologicpy.Cluster import Cluster
6752
-
6751
+ import inspect
6753
6752
  if not Topology.IsInstance(topology, "Topology"):
6753
+ if not silent:
6754
+ print("Topology.RemoveCollinearEdges - Error: The input topology parameter is not a valid topology. Returning None.")
6755
+ curframe = inspect.currentframe()
6756
+ calframe = inspect.getouterframes(curframe, 2)
6757
+ print('caller name:', calframe[1][3])
6754
6758
  return None
6755
6759
  return_topology = topology
6756
6760
  if Topology.IsInstance(topology, "Vertex") or Topology.IsInstance(topology, "Edge"): #Vertex or Edge or Cluster, return the original topology
@@ -6776,7 +6780,7 @@ class Topology():
6776
6780
  topologies += Cluster.FreeEdges(topology)
6777
6781
  faces = Topology.Faces(topology)
6778
6782
  for face in faces:
6779
- topologies.append(Face.RemoveCollinearEdges(topology, angTolerance=angTolerance, tolerance=tolerance))
6783
+ topologies.append(Face.RemoveCollinearEdges(face, angTolerance=angTolerance, tolerance=tolerance))
6780
6784
  return_topology = Topology.SelfMerge(Cluster.ByTopologies(topologies), tolerance=tolerance)
6781
6785
  return return_topology
6782
6786
 
@@ -9045,7 +9049,7 @@ class Topology():
9045
9049
  r_shells = Topology.Shells(return_topology)
9046
9050
  r_cells = Topology.Cells(return_topology)
9047
9051
  r_cellComplexes = Topology.CellComplexes(return_topology)
9048
-
9052
+
9049
9053
  for i, t in enumerate(r_vertices):
9050
9054
  t = Topology.SetDictionary(t, Topology.Dictionary(vertices[i]), silent=True)
9051
9055
  for i, t in enumerate(r_edges):
topologicpy/Vertex.py CHANGED
@@ -1110,13 +1110,18 @@ class Vertex():
1110
1110
  import inspect
1111
1111
 
1112
1112
  if not Topology.IsInstance(vertex, "Vertex"):
1113
- print("Called from:", inspect.stack()[1][3])
1114
1113
  if not silent:
1115
1114
  print("Vertex.IsInternal - Error: The input vertex parameter is not a valid vertex. Returning None.", vertex, topology)
1115
+ curframe = inspect.currentframe()
1116
+ calframe = inspect.getouterframes(curframe, 2)
1117
+ print('caller name:', calframe[1][3])
1116
1118
  return None
1117
1119
  if not Topology.IsInstance(topology, "Topology"):
1118
1120
  if not silent:
1119
1121
  print("Vertex.IsInternal - Error: The input topology parameter is not a valid topology. Returning None.")
1122
+ curframe = inspect.currentframe()
1123
+ calframe = inspect.getouterframes(curframe, 2)
1124
+ print('caller name:', calframe[1][3])
1120
1125
  return None
1121
1126
 
1122
1127
  if Topology.IsInstance(topology, "Vertex"):
topologicpy/Wire.py CHANGED
@@ -2966,12 +2966,107 @@ class Wire():
2966
2966
  if direction != [0, 0, 1]:
2967
2967
  baseWire = Topology.Orient(baseWire, origin=origin, dirA=[0, 0, 1], dirB=direction)
2968
2968
  return baseWire
2969
-
2969
+
2970
+
2970
2971
  @staticmethod
2971
2972
  def RemoveCollinearEdges(wire, angTolerance: float = 0.1, tolerance: float = 0.0001, silent: bool = False):
2972
2973
  """
2973
2974
  Removes any collinear edges in the input wire.
2974
2975
 
2976
+ Parameters
2977
+ ----------
2978
+ wire : topologic_core.Wire
2979
+ The input wire.
2980
+ angTolerance : float, optional
2981
+ The desired angular tolerance. The default is 0.1.
2982
+ tolerance : float, optional
2983
+ The desired tolerance. The default is 0.0001.
2984
+ silent : bool, optional
2985
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
2986
+
2987
+ Returns
2988
+ -------
2989
+ topologic_core.Wire
2990
+ The wire without collinear edges, or the original wire if no modifications were necessary.
2991
+ """
2992
+ from topologicpy.Vertex import Vertex
2993
+ from topologicpy.Edge import Edge
2994
+ from topologicpy.Wire import Wire
2995
+ from topologicpy.Cluster import Cluster
2996
+ from topologicpy.Topology import Topology
2997
+
2998
+ def cleanup(wire):
2999
+ """Fuses vertices and removes edges below the tolerance distance."""
3000
+ vertices = Vertex.Fuse(Topology.Vertices(wire), tolerance=tolerance)
3001
+ edges = Topology.Edges(wire)
3002
+ new_edges = []
3003
+
3004
+ for edge in edges:
3005
+ sv = vertices[Vertex.Index(Edge.StartVertex(edge), vertices, tolerance=tolerance)]
3006
+ ev = vertices[Vertex.Index(Edge.EndVertex(edge), vertices, tolerance=tolerance)]
3007
+ if Vertex.Distance(sv, ev) > tolerance:
3008
+ new_edges.append(Edge.ByVertices([sv, ev]))
3009
+
3010
+ return Topology.SelfMerge(Cluster.ByTopologies(new_edges, silent=silent), tolerance=tolerance) if new_edges else wire
3011
+
3012
+ def remove_collinear_vertices(wire):
3013
+ """Removes collinear vertices from a wire."""
3014
+ if not Topology.IsInstance(wire, "Wire"):
3015
+ return wire
3016
+
3017
+ vertices = Topology.Vertices(wire)
3018
+ filtered_vertices = []
3019
+
3020
+ for i, vertex in enumerate(vertices):
3021
+ edges = Topology.SuperTopologies(topology=vertex, hostTopology=wire, topologyType="edge")
3022
+
3023
+ if len(edges) != 2:
3024
+ filtered_vertices.append(vertex)
3025
+ elif not Edge.IsCollinear(edges[0], edges[1], tolerance=tolerance):
3026
+ filtered_vertices.append(vertex)
3027
+
3028
+ if len(filtered_vertices) > 2:
3029
+ return Wire.ByVertices(filtered_vertices, close=wire.IsClosed())
3030
+ elif len(filtered_vertices) == 2:
3031
+ return Edge.ByStartVertexEndVertex(filtered_vertices[0], filtered_vertices[1], tolerance=tolerance, silent=True)
3032
+ else:
3033
+ return wire
3034
+
3035
+ # Main function logic
3036
+ if Topology.IsInstance(wire, "Cluster"):
3037
+ wires = Topology.Wires(wire)
3038
+ processed_wires = [Wire.RemoveCollinearEdges(w, angTolerance, tolerance, silent) for w in wires]
3039
+ if len(processed_wires) == 0:
3040
+ if not silent:
3041
+ print("Wire.RemoveCollinearEdges - Error: No wires were produced. Returning None.")
3042
+ return None
3043
+ elif len(processed_wires) == 1:
3044
+ return Topology.SelfMerge(processed_wires[0])
3045
+ else:
3046
+ return Topology.SelfMerge(Cluster.ByTopologies(processed_wires, silent=silent))
3047
+
3048
+ if not Topology.IsInstance(wire, "Wire"):
3049
+ if not silent:
3050
+ print(f"Wire.RemoveCollinearEdges - Error: Input is not a valid wire. Returning None.")
3051
+ return None
3052
+
3053
+ new_wire = cleanup(wire)
3054
+ wires = Wire.Split(new_wire) if not Wire.IsManifold(new_wire) else [new_wire]
3055
+
3056
+ processed_wires = [remove_collinear_vertices(w) for w in wires]
3057
+
3058
+ if len(processed_wires) == 0:
3059
+ return wire
3060
+ elif len(processed_wires) == 1:
3061
+ return Topology.SelfMerge(processed_wires[0])
3062
+ else:
3063
+ return Topology.SelfMerge(Cluster.ByTopologies(processed_wires, silent=silent))
3064
+
3065
+ @staticmethod
3066
+ def RemoveCollinearEdges_old(wire, angTolerance: float = 0.1, tolerance: float = 0.0001, silent: bool = False):
3067
+ """
3068
+ Removes any collinear edges in the input wire.
3069
+
2975
3070
  Parameters
2976
3071
  ----------
2977
3072
  wire : topologic_core.Wire
@@ -3051,8 +3146,6 @@ class Wire():
3051
3146
  return result
3052
3147
  if not Topology.IsInstance(wire, "Wire"):
3053
3148
  if not silent:
3054
- print("The wire is:", wire)
3055
- Topology.Show(wire)
3056
3149
  print("Wire.RemoveCollinearEdges - Error: The input wire parameter is not a valid wire. Returning None.")
3057
3150
  curframe = inspect.currentframe()
3058
3151
  calframe = inspect.getouterframes(curframe, 2)
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.83'
1
+ __version__ = '0.7.84'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.83
3
+ Version: 0.7.84
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
@@ -1,16 +1,16 @@
1
1
  topologicpy/ANN.py,sha256=m_WxD1lgQqDhUpaM20Lia6TmJACDYaAE96wigsi-99U,47932
2
2
  topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
3
3
  topologicpy/BVH.py,sha256=mKVCAu9K8qzcWXtPDVH5usXZV1DNNNJl4n3rU5Lh1ZM,12931
4
- topologicpy/Cell.py,sha256=2izd-YGqy897_JHHgrGlIo5WwUeEIWVD3KspV1z_sj8,107860
5
- topologicpy/CellComplex.py,sha256=5PtnRrDx_3zmtt4aTosxK9XBzZtayzaOC50pkJiIlFY,51170
4
+ topologicpy/Cell.py,sha256=j6e0Hk5GVlCPXhwc39Qo3pSpWZF4nv4uCZojdg3uXO8,108046
5
+ topologicpy/CellComplex.py,sha256=DbSiVZ-_J8vXud1cm69p9Te9sTJUB-_zE3rgbhqKw5E,51424
6
6
  topologicpy/Cluster.py,sha256=51q5G1L5xAzRMfVU8YBXhq0g3g2X9aVNcahU-vYZRrI,55672
7
7
  topologicpy/Color.py,sha256=wPhA7rLr9BTZsWYUUVnQpbmL5ZMkGlDSsa8f3S5B-d4,20250
8
8
  topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
9
9
  topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
10
10
  topologicpy/Dictionary.py,sha256=0AsGoz48pGTye_F4KcJopNjD9STeQ50LHc6PPvERFaA,31932
11
- topologicpy/Edge.py,sha256=9u9SdUxuenLUIK26xwFvPoYV34p0dCfXmHHBxdgvAdM,67164
11
+ topologicpy/Edge.py,sha256=k71TGaJRERI2vgygDu-pYprUgu49N9UApcCxCorQyzc,67185
12
12
  topologicpy/EnergyModel.py,sha256=AqTtmXE35SxvRXhG3vYAQd7GQDW-6HtjYPHua6ME4Eg,53762
13
- topologicpy/Face.py,sha256=tfsm7RSYZ7UbKAhUlUqfPQX4_96UuTJXXo6okTU9lm8,141831
13
+ topologicpy/Face.py,sha256=IAAueOqHOw3Kn_ZPxxBKgVgC5fFdcuiLMC1HeOPI92Y,142159
14
14
  topologicpy/Graph.py,sha256=ZhMVB6ntuhIgTrKLUPryeAJFFBF0cnRsNgESbaohOiw,416914
15
15
  topologicpy/Grid.py,sha256=9N6PE84qCm40TRi2WtlVZSBwXXr47zHpscEpZHg_JW4,18205
16
16
  topologicpy/Helper.py,sha256=vUWbnZJxn0e9YsFUNyJ5Dee8Nh6TmDp9uCzCk4e0qAA,21897
@@ -20,17 +20,17 @@ topologicpy/Neo4j.py,sha256=t52hgE9cVsqkGc7m7fjRsLnyfRHakVHwdvF4ms7ow78,22342
20
20
  topologicpy/Plotly.py,sha256=z7xs9Ra2OwJNv5NMapH27R6didS8UMpjZIN35ZnAQcE,113501
21
21
  topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
22
22
  topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
23
- topologicpy/Shell.py,sha256=8OJjlWk9eCZ3uGOTht6ZVrcMczCafw-YWoDGueaz7eg,87673
23
+ topologicpy/Shell.py,sha256=xYpGxQ1x7hKVYD03_zhEY77lbDAsffttKYZWKiZAsNs,87859
24
24
  topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
25
25
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
26
- topologicpy/Topology.py,sha256=nTthwB8vmfdpfoP8tTQCUhHr29WhjuV7l0btAI1rHkQ,433216
26
+ topologicpy/Topology.py,sha256=9X9Y2Y1tXe_oefNp6oQRG6v7ZgmIec5pZ7KiBxSXKNY,433499
27
27
  topologicpy/Vector.py,sha256=A1g83zDHep58iVPY8WQ8iHNrSOfGWFEzvVeDuMnjDNY,33078
28
- topologicpy/Vertex.py,sha256=uHBSDrU5Wc3Eg8_-Se0czcTKNmhhBORUw7c3Mo0ZRz4,73460
29
- topologicpy/Wire.py,sha256=o6MlOjubkJ_f5s1tUamizCsoPKvcQ2OudtJv0yCF-2o,186477
28
+ topologicpy/Vertex.py,sha256=7oEu6xXl1vi8M_HFnPT66W8OO8Eb3eab2oKvgzzLK-A,73737
29
+ topologicpy/Wire.py,sha256=e9vN5nRIUIqwA0bElVB6Vrto862OXJ97iDHhc-JEt3s,190501
30
30
  topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
31
- topologicpy/version.py,sha256=Uj6-kAXgUUYCxdsrUyFr-xt-NFJYmXeo-tJWkJPzKSE,23
32
- topologicpy-0.7.83.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
- topologicpy-0.7.83.dist-info/METADATA,sha256=k4zYNOlhOqX64ck0YBOhF1u0LdmVQkO1uyiJl6n71HU,10513
34
- topologicpy-0.7.83.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
35
- topologicpy-0.7.83.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
- topologicpy-0.7.83.dist-info/RECORD,,
31
+ topologicpy/version.py,sha256=U66vZMAESD9QWsvrRbFl3J6Cqc8Xv9QpUU903eulUJI,23
32
+ topologicpy-0.7.84.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
+ topologicpy-0.7.84.dist-info/METADATA,sha256=WKYqAGNwpDTkn9KOQDEUQkV7w5v-v4jCEuzpnemh7Cs,10513
34
+ topologicpy-0.7.84.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
35
+ topologicpy-0.7.84.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
+ topologicpy-0.7.84.dist-info/RECORD,,