topologicpy 0.7.66__py3-none-any.whl → 0.7.68__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
@@ -165,7 +165,7 @@ class Cell():
165
165
  finalFaces.append(f)
166
166
  finalFinalFaces = []
167
167
  for f in finalFaces:
168
- vertices = Face.Vertices(f)
168
+ vertices = Topology.Vertices(f)
169
169
  w = Wire.Cycles(Face.ExternalBoundary(f), maxVertices=len(vertices))[0]
170
170
  f1 = Face.ByWire(w, tolerance=tolerance, silent=True)
171
171
  if Topology.IsInstance(f1, "Face"):
@@ -1157,6 +1157,7 @@ class Cell():
1157
1157
 
1158
1158
  from topologicpy.Vertex import Vertex
1159
1159
  from topologicpy.Wire import Wire
1160
+ from topologicpy.CellComplex import CellComplex
1160
1161
  from topologicpy.Topology import Topology
1161
1162
  from topologicpy.Dictionary import Dictionary
1162
1163
 
@@ -1194,7 +1195,7 @@ class Cell():
1194
1195
  c = Wire.ByVertices(new_verts, close=False)
1195
1196
  egg = Topology.Spin(c, origin=Vertex.Origin(), triangulate=False, direction=[0, 0, 1], angle=360, sides=uSides, tolerance=tolerance)
1196
1197
  if Topology.IsInstance(egg, "CellComplex"):
1197
- egg = egg.ExternalBoundary()
1198
+ egg = CellComplex.ExternalBoundary(egg)
1198
1199
  if Topology.IsInstance(egg, "Shell"):
1199
1200
  egg = Cell.ByShell(egg)
1200
1201
  egg = Topology.Scale(egg, origin=Vertex.Origin(), x=height, y=height, z=height)
@@ -1232,7 +1233,7 @@ class Cell():
1232
1233
  print("Cell.ExternalBoundary - Error: The input cell parameter is not a valid topologic cell. Returning None.")
1233
1234
  return None
1234
1235
  try:
1235
- return cell.ExternalBoundary()
1236
+ return cell.ExternalBoundary() # Hook to Core
1236
1237
  except:
1237
1238
  print("Cell.ExternalBoundary - Error: Could not compute the external boundary. Returning None.")
1238
1239
  return None
@@ -2131,6 +2132,7 @@ class Cell():
2131
2132
 
2132
2133
  from topologicpy.Vertex import Vertex
2133
2134
  from topologicpy.Wire import Wire
2135
+ from topologicpy.CellComplex import CellComplex
2134
2136
  from topologicpy.Topology import Topology
2135
2137
 
2136
2138
  if not Topology.IsInstance(origin, "Vertex"):
@@ -2142,7 +2144,7 @@ class Cell():
2142
2144
  c = Topology.Rotate(c, origin=Vertex.Origin(), axis=[1, 0, 0], angle=90)
2143
2145
  sphere = Topology.Spin(c, origin=Vertex.Origin(), triangulate=False, direction=[0, 0, 1], angle=360, sides=uSides, tolerance=tolerance)
2144
2146
  if Topology.Type(sphere) == Topology.TypeID("CellComplex"):
2145
- sphere = sphere.ExternalBoundary()
2147
+ sphere = CellComplex.ExternalBoundary(sphere)
2146
2148
  if Topology.Type(sphere) == Topology.TypeID("Shell"):
2147
2149
  sphere = Cell.ByShell(sphere)
2148
2150
  if placement.lower() == "bottom":
@@ -668,24 +668,6 @@ class CellComplex():
668
668
  _ = cellComplex.Edges(None, edges) # Hook to Core
669
669
  return edges
670
670
 
671
- @staticmethod
672
- def ExternalBoundary(cellComplex):
673
- """
674
- Returns the external boundary (cell) of the input cellComplex.
675
-
676
- Parameters
677
- ----------
678
- cellComplex : topologic_core.CellComplex
679
- The input cellComplex.
680
-
681
- Returns
682
- -------
683
- topologic_core.Cell
684
- The external boundary of the input cellComplex.
685
-
686
- """
687
- return cellComplex.ExternalBoundary()
688
-
689
671
  @staticmethod
690
672
  def ExternalBoundary(cellComplex):
691
673
  """
@@ -707,7 +689,7 @@ class CellComplex():
707
689
  if not Topology.IsInstance(cellComplex, "CellComplex"):
708
690
  print("CellComplex.ExternalBoundary - Error: The input cellComplex parameter is not a valid cellComplex. Returning None.")
709
691
  return None
710
- return cellComplex.ExternalBoundary()
692
+ return cellComplex.ExternalBoundary() # Hook to Core
711
693
 
712
694
  @staticmethod
713
695
  def ExternalFaces(cellComplex) -> list:
@@ -726,7 +708,7 @@ class CellComplex():
726
708
 
727
709
  """
728
710
  from topologicpy.Cell import Cell
729
- cell = cellComplex.ExternalBoundary()
711
+ cell = CellComplex.ExternalBoundary(cellComplex)
730
712
  return Cell.Faces(cell)
731
713
 
732
714
  @staticmethod
topologicpy/Cluster.py CHANGED
@@ -248,7 +248,7 @@ class Cluster():
248
248
  print("Cluster.CellComplexes - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
249
249
  return None
250
250
  cellComplexes = []
251
- _ = cluster.CellComplexes(None, cellComplexes)
251
+ _ = cluster.CellComplexes(None, cellComplexes) # Hook to Core
252
252
  return cellComplexes
253
253
 
254
254
  @staticmethod
@@ -273,7 +273,7 @@ class Cluster():
273
273
  print("Cluster.Cells - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
274
274
  return None
275
275
  cells = []
276
- _ = cluster.Cells(None, cells)
276
+ _ = cluster.Cells(None, cells) # Hook to Core
277
277
  return cells
278
278
 
279
279
  @staticmethod
@@ -479,7 +479,7 @@ class Cluster():
479
479
  print("Cluster.Edges - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
480
480
  return None
481
481
  edges = []
482
- _ = cluster.Edges(None, edges)
482
+ _ = cluster.Edges(None, edges) # Hook to Core
483
483
  return edges
484
484
 
485
485
  @staticmethod
@@ -504,7 +504,7 @@ class Cluster():
504
504
  print("Cluster.Faces - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
505
505
  return None
506
506
  faces = []
507
- _ = cluster.Faces(None, faces)
507
+ _ = cluster.Faces(None, faces) # Hook to Core
508
508
  return faces
509
509
 
510
510
  @staticmethod
@@ -531,14 +531,12 @@ class Cluster():
531
531
  if not Topology.IsInstance(cluster, "Cluster"):
532
532
  print("Cluster.FreeCells - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
533
533
  return None
534
- allCells = []
535
- _ = cluster.Cells(None, allCells)
534
+ allCells = Cluster.Cells(cluster)
536
535
  if len(allCells) < 1:
537
536
  return []
538
537
  allCellsCluster = Cluster.ByTopologies(allCells)
539
538
  freeCells = []
540
- cellComplexes = []
541
- _ = cluster.CellComplexes(None, cellComplexes)
539
+ cellComplexes = Cluster.CellComplexes(cluster)
542
540
  cellComplexesCells = []
543
541
  for cellComplex in cellComplexes:
544
542
  tempCells = CellComplex.Cells(cellComplex)
@@ -580,13 +578,11 @@ class Cluster():
580
578
  if not Topology.IsInstance(cluster, "Cluster"):
581
579
  print("Cluster.FreeShells - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
582
580
  return None
583
- allShells = []
584
- _ = cluster.Shells(None, allShells)
581
+ allShells = Cluster.Shells(cluster)
585
582
  if len(allShells) < 1:
586
583
  return []
587
584
  allShellsCluster = Cluster.ByTopologies(allShells)
588
- cells = []
589
- _ = cluster.Cells(None, cells)
585
+ cells = Cluster.Cells(cluster)
590
586
  cellsShells = []
591
587
  for cell in cells:
592
588
  tempShells = Cell.Shells(cell)
@@ -628,13 +624,11 @@ class Cluster():
628
624
  if not Topology.IsInstance(cluster, "Cluster"):
629
625
  print("Cluster.FreeFaces - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
630
626
  return None
631
- allFaces = []
632
- _ = cluster.Faces(None, allFaces)
627
+ allFaces = Cluster.Faces(cluster)
633
628
  if len(allFaces) < 1:
634
629
  return []
635
630
  allFacesCluster = Cluster.ByTopologies(allFaces)
636
- shells = []
637
- _ = cluster.Shells(None, shells)
631
+ shells = Cluster.Shells(cluster)
638
632
  shellFaces = []
639
633
  for shell in shells:
640
634
  tempFaces = Shell.Faces(shell)
@@ -676,13 +670,11 @@ class Cluster():
676
670
  if not Topology.IsInstance(cluster, "Cluster"):
677
671
  print("Cluster.FreeWires - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
678
672
  return None
679
- allWires = []
680
- _ = cluster.Wires(None, allWires)
673
+ allWires = Cluster.Wires(cluster)
681
674
  if len(allWires) < 1:
682
675
  return []
683
676
  allWiresCluster = Cluster.ByTopologies(allWires)
684
- faces = []
685
- _ = cluster.Faces(None, faces)
677
+ faces = Cluster.Faces(cluster)
686
678
  facesWires = []
687
679
  for face in faces:
688
680
  tempWires = Face.Wires(face)
@@ -724,13 +716,11 @@ class Cluster():
724
716
  if not Topology.IsInstance(cluster, "Cluster"):
725
717
  print("Cluster.FreeEdges - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
726
718
  return None
727
- allEdges = []
728
- _ = cluster.Edges(None, allEdges)
719
+ allEdges = Cluster.Edges(cluster)
729
720
  if len(allEdges) < 1:
730
721
  return []
731
722
  allEdgesCluster = Cluster.ByTopologies(allEdges)
732
- wires = []
733
- _ = cluster.Wires(None, wires)
723
+ wires = Cluster.Wires(cluster)
734
724
  wireEdges = []
735
725
  for wire in wires:
736
726
  tempEdges = Wire.Edges(wire)
@@ -772,16 +762,14 @@ class Cluster():
772
762
  if not Topology.IsInstance(cluster, "Cluster"):
773
763
  print("Cluster.FreeVertices - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
774
764
  return None
775
- allVertices = []
776
- _ = cluster.Vertices(None, allVertices)
765
+ allVertices = Topology.Vertices(cluster)
777
766
  if len(allVertices) < 1:
778
767
  return []
779
768
  allVerticesCluster = Cluster.ByTopologies(allVertices)
780
- edges = []
781
- _ = cluster.Edges(None, edges)
769
+ edges = Topology.Edges(cluster)
782
770
  edgesVertices = []
783
771
  for edge in edges:
784
- tempVertices = Edge.Vertices(edge)
772
+ tempVertices = Topology.Vertices(edge)
785
773
  edgesVertices += tempVertices
786
774
  if len(edgesVertices) == 0:
787
775
  return allVertices
@@ -845,25 +833,25 @@ class Cluster():
845
833
  if not Topology.IsInstance(cluster, "Cluster"):
846
834
  print("Cluster.HighestType - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
847
835
  return None
848
- cellComplexes = Cluster.CellComplexes(cluster)
836
+ cellComplexes = Topology.CellComplexes(cluster)
849
837
  if len(cellComplexes) > 0:
850
838
  return Topology.TypeID("CellComplex")
851
- cells = Cluster.Cells(cluster)
839
+ cells = Topology.Cells(cluster)
852
840
  if len(cells) > 0:
853
841
  return Topology.TypeID("Cell")
854
- shells = Cluster.Shells(cluster)
842
+ shells = Topology.Shells(cluster)
855
843
  if len(shells) > 0:
856
844
  return Topology.TypeID("Shell")
857
- faces = Cluster.Faces(cluster)
845
+ faces = Topology.Faces(cluster)
858
846
  if len(faces) > 0:
859
847
  return Topology.TypeID("Face")
860
848
  wires = Cluster.Wires(cluster)
861
849
  if len(wires) > 0:
862
850
  return Topology.TypeID("Wire")
863
- edges = Cluster.Edges(cluster)
851
+ edges = Topology.Edges(cluster)
864
852
  if len(edges) > 0:
865
853
  return Topology.TypeID("Edge")
866
- vertices = Cluster.Vertices(cluster)
854
+ vertices = Topology.Vertices(cluster)
867
855
  if len(vertices) > 0:
868
856
  return Topology.TypeID("Vertex")
869
857
 
@@ -1147,10 +1135,10 @@ class Cluster():
1147
1135
 
1148
1136
  """
1149
1137
  import topologicpy
1150
- from topologicpy.Vertex import Vertex
1151
1138
  from topologicpy.Edge import Edge
1152
1139
  from topologicpy.Wire import Wire
1153
1140
  from topologicpy.Cluster import Cluster
1141
+ from topologicpy.Topology import Topology
1154
1142
  from itertools import combinations
1155
1143
 
1156
1144
  if wire == None:
@@ -1158,7 +1146,7 @@ class Cluster():
1158
1146
  if not Wire.IsClosed(wire):
1159
1147
  print("Cluster.MysticRose - Error: The input wire parameter is not a closed topologic wire. Returning None.")
1160
1148
  return None
1161
- vertices = Wire.Vertices(wire)
1149
+ vertices = Topology.Vertices(wire)
1162
1150
  indices = list(range(len(vertices)))
1163
1151
  combs = [[comb[0],comb[1]] for comb in combinations(indices, 2) if not (abs(comb[0]-comb[1]) == 1) and not (abs(comb[0]-comb[1]) == len(indices)-1)]
1164
1152
  edges = []
@@ -1190,7 +1178,7 @@ class Cluster():
1190
1178
  print("Cluster.Shells - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
1191
1179
  return None
1192
1180
  shells = []
1193
- _ = cluster.Shells(None, shells)
1181
+ _ = cluster.Shells(None, shells) # Hook to Core
1194
1182
  return shells
1195
1183
 
1196
1184
  @staticmethod
@@ -1215,54 +1203,41 @@ class Cluster():
1215
1203
  print("Cluster.Simplify - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
1216
1204
  return None
1217
1205
  resultingTopologies = []
1218
- topCC = []
1219
- _ = cluster.CellComplexes(None, topCC)
1220
- topCells = []
1221
- _ = cluster.Cells(None, topCells)
1222
- topShells = []
1223
- _ = cluster.Shells(None, topShells)
1224
- topFaces = []
1225
- _ = cluster.Faces(None, topFaces)
1226
- topWires = []
1227
- _ = cluster.Wires(None, topWires)
1228
- topEdges = []
1229
- _ = cluster.Edges(None, topEdges)
1230
- topVertices = []
1231
- _ = cluster.Vertices(None, topVertices)
1206
+ topCC = Topology.CellComplexes(cluster)
1207
+ topCells = Topology.Cells(cluster)
1208
+ topShells = Topology.Shells(cluster)
1209
+ topFaces = Topology.Faces(cluster)
1210
+ topWires = Topology.Wires(cluster)
1211
+ topEdges = Topology.Edges(cluster)
1212
+ topVertices = Topology.Vertices(cluster)
1232
1213
  if len(topCC) == 1:
1233
1214
  cc = topCC[0]
1234
- ccVertices = []
1235
- _ = cc.Vertices(None, ccVertices)
1215
+ ccVertices = Topology.Vertices(cc)
1236
1216
  if len(topVertices) == len(ccVertices):
1237
1217
  resultingTopologies.append(cc)
1238
1218
  if len(topCC) == 0 and len(topCells) == 1:
1239
1219
  cell = topCells[0]
1240
- ccVertices = []
1241
- _ = cell.Vertices(None, ccVertices)
1220
+ ccVertices = Topology.Vertices(cell)
1242
1221
  if len(topVertices) == len(ccVertices):
1243
1222
  resultingTopologies.append(cell)
1244
1223
  if len(topCC) == 0 and len(topCells) == 0 and len(topShells) == 1:
1245
1224
  shell = topShells[0]
1246
- ccVertices = []
1247
- _ = shell.Vertices(None, ccVertices)
1225
+ ccVertices = Topology.Vertices(shell)
1248
1226
  if len(topVertices) == len(ccVertices):
1249
1227
  resultingTopologies.append(shell)
1250
1228
  if len(topCC) == 0 and len(topCells) == 0 and len(topShells) == 0 and len(topFaces) == 1:
1251
1229
  face = topFaces[0]
1252
- ccVertices = []
1253
- _ = face.Vertices(None, ccVertices)
1230
+ ccVertices = Topology.Vertices(face)
1254
1231
  if len(topVertices) == len(ccVertices):
1255
1232
  resultingTopologies.append(face)
1256
1233
  if len(topCC) == 0 and len(topCells) == 0 and len(topShells) == 0 and len(topFaces) == 0 and len(topWires) == 1:
1257
1234
  wire = topWires[0]
1258
- ccVertices = []
1259
- _ = wire.Vertices(None, ccVertices)
1235
+ ccVertices = Topology.Vertices(wire)
1260
1236
  if len(topVertices) == len(ccVertices):
1261
1237
  resultingTopologies.append(wire)
1262
1238
  if len(topCC) == 0 and len(topCells) == 0 and len(topShells) == 0 and len(topFaces) == 0 and len(topWires) == 0 and len(topEdges) == 1:
1263
1239
  edge = topEdges[0]
1264
- ccVertices = []
1265
- _ = wire.Vertices(None, ccVertices)
1240
+ ccVertices = Topology.Vertices(edge)
1266
1241
  if len(topVertices) == len(ccVertices):
1267
1242
  resultingTopologies.append(edge)
1268
1243
  if len(topCC) == 0 and len(topCells) == 0 and len(topShells) == 0 and len(topFaces) == 0 and len(topWires) == 0 and len(topEdges) == 0 and len(topVertices) == 1:
@@ -1294,7 +1269,7 @@ class Cluster():
1294
1269
  print("Cluster.Vertices - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
1295
1270
  return None
1296
1271
  vertices = []
1297
- _ = cluster.Vertices(None, vertices)
1272
+ _ = cluster.Vertices(None, vertices) # Hook to Core
1298
1273
  return vertices
1299
1274
 
1300
1275
  @staticmethod
@@ -1319,7 +1294,7 @@ class Cluster():
1319
1294
  print("Cluster.Wires - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
1320
1295
  return None
1321
1296
  wires = []
1322
- _ = cluster.Wires(None, wires)
1297
+ _ = cluster.Wires(None, wires) # Hook to Core
1323
1298
  return wires
1324
1299
 
1325
1300
 
topologicpy/Edge.py CHANGED
@@ -353,7 +353,7 @@ class Edge():
353
353
  if not Topology.IsInstance(cluster, "Cluster"):
354
354
  print("Edge.ByVerticesCluster - Error: The input cluster parameter is not a valid topologic cluster. Returning None.")
355
355
  return None
356
- vertices = Cluster.Vertices(cluster)
356
+ vertices = Topology.Vertices(cluster)
357
357
  vertexList = [x for x in vertices if Topology.IsInstance(x, "Vertex")]
358
358
  if len(vertexList) < 2:
359
359
  print("Edge.ByVerticesCluster - Error: The input cluster parameter contains less than two vertices. Returning None.")
@@ -356,7 +356,7 @@ class EnergyModel:
356
356
  if cellFaces:
357
357
  for faceNumber, buildingFace in enumerate(cellFaces):
358
358
  osFacePoints = []
359
- for vertex in Topology.SubTopologies(buildingFace.ExternalBoundary(), "Vertex"):
359
+ for vertex in Topology.SubTopologies(Face.ExternalBoundary(buildingFace), "Vertex"):
360
360
  osFacePoints.append(openstudio.Point3d(Vertex.X(vertex, mantissa=mantissa), Vertex.Y(vertex, mantissa=mantissa), Vertex.Z(vertex, mantissa=mantissa)))
361
361
  osSurface = openstudio.model.Surface(osFacePoints, osModel)
362
362
  faceNormal = Face.Normal(buildingFace, mantissa=mantissa)
@@ -387,7 +387,7 @@ class EnergyModel:
387
387
  if len(apertures) > 0:
388
388
  for apertureFace in apertures:
389
389
  osSubSurfacePoints = []
390
- for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
390
+ for vertex in Topology.SubTopologies(Face.ExternalBoundary(apertureFace), "Vertex"):
391
391
  osSubSurfacePoints.append(openstudio.Point3d(Vertex.X(vertex, mantissa=mantissa), Vertex.Y(vertex, mantissa=mantissa), Vertex.Z(vertex, mantissa=mantissa)))
392
392
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
393
393
  apertureFaceNormal = Face.Normal(apertureFace, mantissa=mantissa)
@@ -424,7 +424,7 @@ class EnergyModel:
424
424
  if len(apertures) > 0:
425
425
  for apertureFace in apertures:
426
426
  osSubSurfacePoints = []
427
- for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
427
+ for vertex in Topology.SubTopologies(Face.ExternalBoundary(apertureFace), "Vertex"):
428
428
  osSubSurfacePoints.append(openstudio.Point3d(Vertex.X(vertex, mantissa=mantissa), Vertex.Y(vertex, mantissa=mantissa), Vertex.Z(vertex.Z, mantissa=mantissa)))
429
429
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
430
430
  apertureFaceNormal = Face.Normal(apertureFace, mantissa=mantissa)
@@ -453,7 +453,7 @@ class EnergyModel:
453
453
  osShadingGroup = openstudio.model.ShadingSurfaceGroup(osModel)
454
454
  for faceIndex, shadingFace in enumerate(Topology.SubTopologies(shadingSurfaces, "Face")):
455
455
  facePoints = []
456
- for aVertex in Topology.SubTopologies(shadingFace.ExternalBoundary(), "Vertex"):
456
+ for aVertex in Topology.SubTopologies(Face.ExternalBoundary(shadingFace), "Vertex"):
457
457
  facePoints.append(openstudio.Point3d(Vertex.X(aVertex, mantissa=mantissa), Vertex.Y(aVertex, mantissa=mantissa), Vertex.Z(aVertex, mantissa=mantissa)))
458
458
  aShadingSurface = openstudio.model.ShadingSurface(facePoints, osModel)
459
459
  faceNormal = Face.Normal(shadingFace, mantissa=mantissa)
topologicpy/Face.py CHANGED
@@ -64,9 +64,8 @@ class Face():
64
64
  if len(wireList) < 1:
65
65
  print("Face.AddInternalBoundaries - Warning: The input wires parameter does not contain any valid wires. Returning the input face.")
66
66
  return face
67
- faceeb = face.ExternalBoundary()
68
- faceibList = []
69
- _ = face.InternalBoundaries(faceibList)
67
+ faceeb = Face.ExternalBoundary(face)
68
+ faceibList = Face.InternalBoundaries(face)
70
69
  for wire in wires:
71
70
  faceibList.append(wire)
72
71
  return Face.ByWires(faceeb, faceibList)
@@ -98,8 +97,7 @@ class Face():
98
97
  return face
99
98
  if not Topology.IsInstance(cluster, "Cluster"):
100
99
  return face
101
- wires = []
102
- _ = cluster.Wires(None, wires)
100
+ wires = Topology.Wires(cluster)
103
101
  return Face.AddInternalBoundaries(face, wires)
104
102
 
105
103
  @staticmethod
@@ -637,8 +635,7 @@ class Face():
637
635
  print("Face.ByShell - Error: The operation failed. Returning None.")
638
636
  return None
639
637
  elif Topology.IsInstance(ext_boundary, "Cluster"): # The shell has holes.
640
- wires = []
641
- _ = ext_boundary.Wires(None, wires)
638
+ wires = Topology.Wires(ext_boundary)
642
639
  faces = []
643
640
  areas = []
644
641
  for wire in wires:
@@ -654,14 +651,11 @@ class Face():
654
651
  int_boundaries = list(set(faces) - set([ext_boundary]))
655
652
  int_wires = []
656
653
  for int_boundary in int_boundaries:
657
- temp_wires = []
658
- _ = int_boundary.Wires(None, temp_wires)
654
+ temp_wires = Topology.Wires(int_boundary)
659
655
  int_wires.append(Topology.RemoveCollinearEdges(temp_wires[0], angTolerance))
660
- temp_wires = []
661
- _ = ext_boundary.Wires(None, temp_wires)
656
+ temp_wires = Topology.Wires(ext_boundary)
662
657
  ext_wire = Topology.RemoveCollinearEdges(temp_wires[0], angTolerance)
663
658
  face = Face.ByWires(ext_wire, int_wires)
664
-
665
659
  face = Topology.Unflatten(face, origin=origin, direction=normal)
666
660
  return face
667
661
  else:
@@ -701,7 +695,7 @@ class Face():
701
695
  if not Wire.IsManifold(wire):
702
696
  print("Face.ByThickenedWire - Error: The input wire parameter is not a manifold wire. Returning None.")
703
697
  return None
704
- three_vertices = Wire.Vertices(wire)[0:3]
698
+ three_vertices = Topology.Vertices(wire)[0:3]
705
699
  temp_w = Wire.ByVertices(three_vertices, close=True)
706
700
  flat_face = Face.ByWire(temp_w, tolerance=tolerance)
707
701
  origin = Vertex.Origin()
@@ -786,7 +780,7 @@ class Face():
786
780
 
787
781
  if not Topology.IsInstance(cluster, "Cluster"):
788
782
  return None
789
- vertices = Cluster.Vertices(cluster)
783
+ vertices = Topology.Vertices(cluster)
790
784
  return Face.ByVertices(vertices, tolerance=tolerance)
791
785
 
792
786
  @staticmethod
@@ -1076,11 +1070,11 @@ class Face():
1076
1070
  The compactness measure of the input face.
1077
1071
 
1078
1072
  """
1073
+ from topologicpy.Topology import Topology
1079
1074
  from topologicpy.Edge import Edge
1080
1075
 
1081
- exb = face.ExternalBoundary()
1082
- edges = []
1083
- _ = exb.Edges(None, edges)
1076
+ exb = Face.ExternalBoundary(face)
1077
+ edges = Topology.Edges(exb)
1084
1078
  perimeter = 0.0
1085
1079
  for anEdge in edges:
1086
1080
  perimeter = perimeter + abs(Edge.Length(anEdge))
@@ -1148,7 +1142,7 @@ class Face():
1148
1142
  if not Topology.IsInstance(face, "Face"):
1149
1143
  return None
1150
1144
  edges = []
1151
- _ = face.Edges(None, edges)
1145
+ _ = face.Edges(None, edges) # Hook to Core
1152
1146
  return edges
1153
1147
 
1154
1148
  @staticmethod
@@ -1307,7 +1301,7 @@ class Face():
1307
1301
  from topologicpy.Wire import Wire
1308
1302
  from topologicpy.Topology import Topology
1309
1303
 
1310
- eb = face.ExternalBoundary()
1304
+ eb = face.ExternalBoundary() # Hook to Core
1311
1305
  return eb
1312
1306
 
1313
1307
  @staticmethod
@@ -1385,7 +1379,7 @@ class Face():
1385
1379
  eb = Topology.Copy(Face.ExternalBoundary(face))
1386
1380
  ib_list = Face.InternalBoundaries(face)
1387
1381
  ib_list = [Topology.Copy(ib) for ib in ib_list]
1388
- f_vertices = Face.Vertices(face)
1382
+ f_vertices = Topology.Vertices(face)
1389
1383
  if isinstance(radiusKey, str):
1390
1384
  eb = Topology.TransferDictionariesBySelectors(eb, selectors=f_vertices, tranVertices=True)
1391
1385
  eb = Wire.Fillet(eb, radius=radius, radiusKey=radiusKey, tolerance=tolerance)
@@ -1438,12 +1432,12 @@ class Face():
1438
1432
  origin = Topology.Centroid(face)
1439
1433
  flatFace = Topology.Flatten(face, origin=origin, direction=normal)
1440
1434
  world_origin = Vertex.Origin()
1441
- vertices = Wire.Vertices(Face.ExternalBoundary(flatFace))
1435
+ vertices = Topology.Vertices(Face.ExternalBoundary(flatFace))
1442
1436
  harmonizedEB = Wire.ByVertices(vertices)
1443
1437
  internalBoundaries = Face.InternalBoundaries(flatFace)
1444
1438
  harmonizedIB = []
1445
1439
  for ib in internalBoundaries:
1446
- ibVertices = Wire.Vertices(ib)
1440
+ ibVertices = Topology.Vertices(ib)
1447
1441
  harmonizedIB.append(Wire.ByVertices(ibVertices))
1448
1442
  harmonizedFace = Face.ByWires(harmonizedEB, harmonizedIB, tolerance=tolerance)
1449
1443
  harmonizedFace = Topology.Unflatten(harmonizedFace, origin=origin, direction=normal)
@@ -1511,7 +1505,7 @@ class Face():
1511
1505
  if not Topology.IsInstance(face, "Face"):
1512
1506
  return None
1513
1507
  wires = []
1514
- _ = face.InternalBoundaries(wires)
1508
+ _ = face.InternalBoundaries(wires) # Hook to Core
1515
1509
  return list(wires)
1516
1510
 
1517
1511
  @staticmethod
@@ -1573,7 +1567,7 @@ class Face():
1573
1567
  if not Topology.IsInstance(face, "Face"):
1574
1568
  return None
1575
1569
  eb = Face.ExternalBoundary(face)
1576
- vertices = Wire.Vertices(eb)
1570
+ vertices = Topology.Vertices(eb)
1577
1571
  vertices.reverse()
1578
1572
  inverted_wire = Wire.ByVertices(vertices)
1579
1573
  internal_boundaries = Face.InternalBoundaries(face)
@@ -1693,8 +1687,7 @@ class Face():
1693
1687
  from topologicpy.Vector import Vector
1694
1688
 
1695
1689
  def vertexPartofFace(vertex, face, tolerance):
1696
- vertices = []
1697
- _ = face.Vertices(None, vertices)
1690
+ vertices = Topology.Vertices(face)
1698
1691
  for v in vertices:
1699
1692
  if Vertex.Distance(vertex, v) < tolerance:
1700
1693
  return True
@@ -1874,12 +1867,12 @@ class Face():
1874
1867
  medialAxisEdges.append(e)
1875
1868
 
1876
1869
  extBoundary = Face.ExternalBoundary(flatFace)
1877
- extVertices = Wire.Vertices(extBoundary)
1870
+ extVertices = Topology.Vertices(extBoundary)
1878
1871
 
1879
1872
  intBoundaries = Face.InternalBoundaries(flatFace)
1880
1873
  intVertices = []
1881
1874
  for ib in intBoundaries:
1882
- intVertices = intVertices+Wire.Vertices(ib)
1875
+ intVertices = intVertices+Topology.Vertices(ib)
1883
1876
 
1884
1877
  theVertices = []
1885
1878
  if internalVertices:
@@ -2153,9 +2146,8 @@ class Face():
2153
2146
  if not Topology.IsInstance(faceB, "Face"):
2154
2147
  return None
2155
2148
 
2156
- eb = faceA.ExternalBoundary()
2157
- ib_list = []
2158
- _ = faceA.InternalBoundaries(ib_list)
2149
+ eb = Face.ExternalBoundary(faceA)
2150
+ ib_list = Face.InternalBoundaries(faceA)
2159
2151
  p_eb = Wire.Project(wire=eb, face = faceB, direction=direction, mantissa=mantissa, tolerance=tolerance)
2160
2152
  p_ib_list = []
2161
2153
  for ib in ib_list:
@@ -2539,14 +2531,14 @@ class Face():
2539
2531
 
2540
2532
  from topologicpy.Vertex import Vertex
2541
2533
  from topologicpy.Wire import Wire
2542
- from topologicpy.Face import Face
2534
+ from topologicpy.Topology import Topology
2543
2535
 
2544
2536
  if not Topology.IsInstance(face, "Face"):
2545
2537
  print("Face.Triangulate - Error: The input face parameter is not a valid face. Returning None.")
2546
2538
  return None
2547
2539
  if not meshSize:
2548
2540
  bounding_face = Face.BoundingRectangle(face)
2549
- bounding_face_vertices = Face.Vertices(bounding_face)
2541
+ bounding_face_vertices = Topology.Vertices(bounding_face)
2550
2542
  bounding_face_vertices_x = [Vertex.X(i, mantissa=mantissa) for i in bounding_face_vertices]
2551
2543
  bounding_face_vertices_y = [Vertex.Y(i, mantissa=mantissa) for i in bounding_face_vertices]
2552
2544
  width = max(bounding_face_vertices_x)-min(bounding_face_vertices_x)
@@ -2555,7 +2547,7 @@ class Face():
2555
2547
 
2556
2548
  gmsh.initialize()
2557
2549
  face_external_boundary = Face.ExternalBoundary(face)
2558
- external_vertices = Wire.Vertices(face_external_boundary)
2550
+ external_vertices = Topology.Vertices(face_external_boundary)
2559
2551
  external_vertex_number = len(external_vertices)
2560
2552
  for i in range(external_vertex_number):
2561
2553
  gmsh.model.geo.addPoint(Vertex.X(external_vertices[i], mantissa=mantissa), Vertex.Y(external_vertices[i], mantissa=mantissa), Vertex.Z(external_vertices[i], mantissa=mantissa), meshSize, i+1)
@@ -2779,7 +2771,7 @@ class Face():
2779
2771
  if not Topology.IsInstance(face, "Face"):
2780
2772
  return None
2781
2773
  vertices = []
2782
- _ = face.Vertices(None, vertices)
2774
+ _ = face.Vertices(None, vertices) # Hook to Core
2783
2775
  return vertices
2784
2776
 
2785
2777
  @staticmethod
@@ -2821,5 +2813,5 @@ class Face():
2821
2813
  if not Topology.IsInstance(face, "Face"):
2822
2814
  return None
2823
2815
  wires = []
2824
- _ = face.Wires(None, wires)
2816
+ _ = face.Wires(None, wires) # Hook to Core
2825
2817
  return wires