topologicpy 0.7.93__py3-none-any.whl → 0.7.96__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
@@ -348,8 +348,8 @@ class Cell():
348
348
  bottomEdges = Topology.Edges(bottomFace)
349
349
  for bottomEdge in bottomEdges:
350
350
  topEdge = Topology.Translate(bottomEdge, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
351
- sideEdge1 = Edge.ByVertices([bottomEdge.StartVertex(), topEdge.StartVertex()], tolerance=tolerance, silent=True)
352
- sideEdge2 = Edge.ByVertices([bottomEdge.EndVertex(), topEdge.EndVertex()], tolerance=tolerance, silent=True)
351
+ sideEdge1 = Edge.ByVertices([Edge.StartVertex(bottomEdge), Edge.StartVertex(topEdge)], tolerance=tolerance, silent=True)
352
+ sideEdge2 = Edge.ByVertices([Edge.EndVertex(bottomEdge), Edge.EndVertex(topEdge)], tolerance=tolerance, silent=True)
353
353
  cellWire = Topology.SelfMerge(Cluster.ByTopologies([bottomEdge, sideEdge1, topEdge, sideEdge2]), tolerance=tolerance)
354
354
  cellFaces.append(Face.ByWire(cellWire, tolerance=tolerance))
355
355
  return Cell.ByFaces(cellFaces, planarize=planarize, tolerance=tolerance)
@@ -485,23 +485,23 @@ class Cell():
485
485
  e3 = None
486
486
  e4 = None
487
487
  try:
488
- e3 = Edge.ByVertices([e1.StartVertex(), e2.StartVertex()], tolerance=tolerance, silent=True)
488
+ e3 = Edge.ByVertices([Edge.StartVertex(e1), Edge.StartVertex(e2)], tolerance=tolerance, silent=True)
489
489
  except:
490
490
  try:
491
- e4 = Edge.ByVertices([e1.EndVertex(), e2.EndVertex()], tolerance=tolerance, silent=True)
491
+ e4 = Edge.ByVertices([Edge.EndVertex(e1), Edge.EndVertex(e2)], tolerance=tolerance, silent=True)
492
492
  faces.append(Face.ByWire(Wire.ByEdges([e1, e2, e4], tolerance=tolerance), tolerance=tolerance))
493
493
  except:
494
494
  pass
495
495
  try:
496
- e4 = Edge.ByVertices([e1.EndVertex(), e2.EndVertex()], tolerance=tolerance, silent=True)
496
+ e4 = Edge.ByVertices([Edge.EndVertex(e1), Edge.EndVertex(e2)], tolerance=tolerance, silent=True)
497
497
  except:
498
498
  try:
499
- e3 = Edge.ByVertices([e1.StartVertex(), e2.StartVertex()], tolerance=tolerance, silent=True)
499
+ e3 = Edge.ByVertices([Edge.StartVertex(e1), Edge.StartVertex(e2)], tolerance=tolerance, silent=True)
500
500
  faces.append(Face.ByWire(Wire.ByEdges([e1, e2, e3], tolerance=tolerance), tolerance=tolerance))
501
501
  except:
502
502
  pass
503
503
  if e3 and e4:
504
- e5 = Edge.ByVertices([e1.StartVertex(), e2.EndVertex()], tolerance=tolerance, silent=True)
504
+ e5 = Edge.ByVertices([Edge.StartVertex(e1), Edge.EndVertex(e2)], tolerance=tolerance, silent=True)
505
505
  faces.append(Face.ByWire(Wire.ByEdges([e1, e5, e4], tolerance=tolerance), tolerance=tolerance))
506
506
  faces.append(Face.ByWire(Wire.ByEdges([e2, e5, e3], tolerance=tolerance), tolerance=tolerance))
507
507
  else:
@@ -511,17 +511,17 @@ class Cell():
511
511
  e3 = None
512
512
  e4 = None
513
513
  try:
514
- e3 = Edge.ByVertices([e1.StartVertex(), e2.StartVertex()], tolerance=tolerance, silent=True)
514
+ e3 = Edge.ByVertices([Edge.StartVertex(e1), Edge.StartVertex(e2)], tolerance=tolerance, silent=True)
515
515
  except:
516
516
  try:
517
- e4 = Edge.ByVertices([e1.EndVertex(), e2.EndVertex()], tolerance=tolerance, silent=True)
517
+ e4 = Edge.ByVertices([Edge.EndVertex(e1), Edge.EndVertex(e2)], tolerance=tolerance, silent=True)
518
518
  except:
519
519
  pass
520
520
  try:
521
- e4 = Edge.ByVertices([e1.EndVertex(), e2.EndVertex()], tolerance=tolerance, silent=True)
521
+ e4 = Edge.ByVertices([Edge.EndVertex(e1), Edge.EndVertex(e2)], tolerance=tolerance, silent=True)
522
522
  except:
523
523
  try:
524
- e3 = Edge.ByVertices([e1.StartVertex(), e2.StartVertex()], tolerance=tolerance, silent=True)
524
+ e3 = Edge.ByVertices([Edge.StartVertex(e1), Edge.StartVertex(e2)], tolerance=tolerance, silent=True)
525
525
  except:
526
526
  pass
527
527
  if e3 and e4:
@@ -764,8 +764,8 @@ class Cell():
764
764
  yOffset = max(baseRadius, topRadius)
765
765
  zOffset = 0
766
766
 
767
- baseZ = origin.Z() + zOffset
768
- topZ = origin.Z() + zOffset + height
767
+ baseZ = Vertex.Z(origin) + zOffset
768
+ topZ = Vertex.Z(origin) + zOffset + height
769
769
  baseV = []
770
770
  topV = []
771
771
  for i in range(uSides):
@@ -913,7 +913,7 @@ class Cell():
913
913
  baseY = Vertex.Y(origin, mantissa=mantissa) + yOffset
914
914
  size = radius*3
915
915
  for i in range(1, vSides):
916
- baseZ = origin.Z() + zOffset + float(height)/float(vSides)*i
916
+ baseZ = Vertex.Z(origin) + zOffset + float(height)/float(vSides)*i
917
917
  tool_origin = Vertex.ByCoordinates(baseX, baseY, baseZ)
918
918
  cutting_planes.append(Face.ByWire(Wire.Rectangle(origin=tool_origin, width=size, length=size), tolerance=tolerance))
919
919
  cutting_planes_cluster = Cluster.ByTopologies(cutting_planes)
@@ -950,6 +950,7 @@ class Cell():
950
950
  8. "inclinedApertures": list of inclined apertures
951
951
 
952
952
  """
953
+ from topologicpy.Vertex import Vertex
953
954
  from topologicpy.Face import Face
954
955
  from topologicpy.Vector import Vector
955
956
  from topologicpy.Aperture import Aperture
@@ -986,7 +987,7 @@ class Cell():
986
987
  faces = Cell.Faces(cell)
987
988
  zList = []
988
989
  for f in faces:
989
- zList.append(f.Centroid().Z())
990
+ zList.append(Vertex.Z(Topology.Centroid(f)))
990
991
  zMin = min(zList)
991
992
  zMax = max(zList)
992
993
  up = [0, 0, 1]
@@ -997,14 +998,14 @@ class Cell():
997
998
  verticalFaces.append(aFace)
998
999
  verticalApertures += getApertures(aFace)
999
1000
  elif aCode == 1:
1000
- if abs(aFace.Centroid().Z() - zMin) < tolerance:
1001
+ if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin) < tolerance:
1001
1002
  bottomHorizontalFaces.append(aFace)
1002
1003
  bottomHorizontalApertures += getApertures(aFace)
1003
1004
  else:
1004
1005
  topHorizontalFaces.append(aFace)
1005
1006
  topHorizontalApertures += getApertures(aFace)
1006
1007
  elif aCode == 2:
1007
- if abs(aFace.Centroid().Z() - zMax) < tolerance:
1008
+ if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax) < tolerance:
1008
1009
  topHorizontalFaces.append(aFace)
1009
1010
  topHorizontalApertures += getApertures(aFace)
1010
1011
  else:
@@ -1344,8 +1345,8 @@ class Cell():
1344
1345
  elif placement.lower() == "lowerleft":
1345
1346
  xOffset = max(baseRadius, topRadius)
1346
1347
  yOffset = max(baseRadius, topRadius)
1347
- baseZ = w_origin.Z() + zOffset
1348
- topZ = w_origin.Z() + zOffset + height
1348
+ baseZ = Vertex.Z(w_origin) + zOffset
1349
+ topZ = Vertex.Z(w_origin) + zOffset + height
1349
1350
  for i in range(sides):
1350
1351
  angle = math.radians(360/sides)*i
1351
1352
  if baseRadius > 0:
@@ -1789,8 +1790,8 @@ class Cell():
1789
1790
  topV = []
1790
1791
 
1791
1792
  if Topology.IsInstance(profile, "Wire"):
1792
- baseWire = Topology.Translate(profile, 0 , 0, sv.Z())
1793
- topWire = Topology.Translate(profile, 0 , 0, sv.Z()+dist)
1793
+ baseWire = Topology.Translate(profile, 0 , 0, Vertex.Z(sv))
1794
+ topWire = Topology.Translate(profile, 0 , 0, Vertex.Z(sv)+dist)
1794
1795
  else:
1795
1796
  for i in range(sides):
1796
1797
  angle = math.radians(360/sides)*i
@@ -1813,13 +1814,13 @@ class Cell():
1813
1814
  pipe = Topology.Rotate(pipe, origin=sv, axis=[0, 0, 1], angle=phi)
1814
1815
  zzz = Vertex.ByCoordinates(0, 0, 0)
1815
1816
  if endcapA:
1816
- origin = edge.StartVertex()
1817
+ origin = Edge.StartVertex(edge)
1817
1818
  x1 = Vertex.X(origin, mantissa=mantissa)
1818
1819
  y1 = Vertex.Y(origin, mantissa=mantissa)
1819
1820
  z1 = Vertex.Z(origin, mantissa=mantissa)
1820
- x2 = Vertex.X(edge.EndVertex(), mantissa=mantissa)
1821
- y2 = Vertex.Y(edge.EndVertex(), mantissa=mantissa)
1822
- z2 = Vertex.Z(edge.EndVertex(), mantissa=mantissa)
1821
+ x2 = Vertex.X(Edge.EndVertex(edge), mantissa=mantissa)
1822
+ y2 = Vertex.Y(Edge.EndVertex(edge), mantissa=mantissa)
1823
+ z2 = Vertex.Z(Edge.EndVertex(edge), mantissa=mantissa)
1823
1824
  dx = x2 - x1
1824
1825
  dy = y2 - y1
1825
1826
  dz = z2 - z1
@@ -1834,13 +1835,13 @@ class Cell():
1834
1835
  endcapA = Topology.Rotate(endcapA, origin=zzz, axis=[0, 0, 1], angle=phi+180)
1835
1836
  endcapA = Topology.Translate(endcapA, Vertex.X(origin, mantissa=mantissa), Vertex.Y(origin, mantissa=mantissa), Vertex.Z(origin, mantissa=mantissa))
1836
1837
  if endcapB:
1837
- origin = edge.EndVertex()
1838
+ origin = Edge.EndVertex(edge)
1838
1839
  x1 = Vertex.X(origin, mantissa=mantissa)
1839
1840
  y1 = Vertex.Y(origin, mantissa=mantissa)
1840
1841
  z1 = Vertex.Z(origin, mantissa=mantissa)
1841
- x2 = Vertex.X(edge.StartVertex(), mantissa=mantissa)
1842
- y2 = Vertex.Y(edge.StartVertex(), mantissa=mantissa)
1843
- z2 = Vertex.Z(edge.StartVertex(), mantissa=mantissa)
1842
+ x2 = Vertex.X(Edge.StartVertex(edge), mantissa=mantissa)
1843
+ y2 = Vertex.Y(Edge.StartVertex(edge), mantissa=mantissa)
1844
+ z2 = Vertex.Z(Edge.StartVertex(edge), mantissa=mantissa)
1844
1845
  dx = x2 - x1
1845
1846
  dy = y2 - y1
1846
1847
  dz = z2 - z1
@@ -350,10 +350,10 @@ class CellComplex():
350
350
  e3 = None
351
351
  e4 = None
352
352
  try:
353
- e3 = Edge.ByStartVertexEndVertex(e1.StartVertex(), e2.StartVertex(), tolerance=tolerance, silent=True)
353
+ e3 = Edge.ByStartVertexEndVertex(Edge.StartVertex(e1), Edge.StartVertex(e2), tolerance=tolerance, silent=True)
354
354
  except:
355
355
  try:
356
- e4 = Edge.ByStartVertexEndVertex(e1.EndVertex(), e2.EndVertex(), tolerance=tolerance, silent=True)
356
+ e4 = Edge.ByStartVertexEndVertex(Edge.EndVertex(e1), Edge.EndVertex(e2), tolerance=tolerance, silent=True)
357
357
  f = Face.ByExternalBoundary(Wire.ByEdges([e1, e2, e4], tolerance=tolerance))
358
358
  if triangulate == True:
359
359
  if len(Topology.Vertices(face)) > 3:
@@ -366,10 +366,10 @@ class CellComplex():
366
366
  except:
367
367
  pass
368
368
  try:
369
- e4 = Edge.ByStartVertexEndVertex(e1.EndVertex(), e2.EndVertex(), tolerance=tolerance, silent=True)
369
+ e4 = Edge.ByStartVertexEndVertex(Edge.EndVertex(e1), Edge.EndVertex(e2), tolerance=tolerance, silent=True)
370
370
  except:
371
371
  try:
372
- e3 = Edge.ByStartVertexEndVertex(e1.StartVertex(), e2.StartVertex(), tolerance=tolerance, silent=True)
372
+ e3 = Edge.ByStartVertexEndVertex(Edge.StartVertex(e1), Edge.StartVertex(e2), tolerance=tolerance, silent=True)
373
373
  f = Face.ByWire(Wire.ByEdges([e1, e2, e3], tolerance=tolerance), tolerance=tolerance)
374
374
  if triangulate == True:
375
375
  if len(Topology.Vertices(face)) > 3:
@@ -383,7 +383,7 @@ class CellComplex():
383
383
  pass
384
384
  if e3 and e4:
385
385
  if triangulate == True:
386
- e5 = Edge.ByStartVertexEndVertex(e1.StartVertex(), e2.EndVertex(), tolerance=tolerance, silent=True)
386
+ e5 = Edge.ByStartVertexEndVertex(Edge.StartVertex(e1), Edge.EndVertex(e2), tolerance=tolerance, silent=True)
387
387
  faces.append(Face.ByWire(Wire.ByEdges([e1, e5, e4], tolerance=tolerance), tolerance=tolerance))
388
388
  faces.append(Face.ByWire(Wire.ByEdges([e2, e5, e3], tolerance=tolerance), tolerance=tolerance))
389
389
  else:
@@ -485,6 +485,7 @@ class CellComplex():
485
485
  15. "internalInclinedApertures": list of internal inclined apertures
486
486
 
487
487
  """
488
+ from topologicpy.Vertex import Vertex
488
489
  from topologicpy.Face import Face
489
490
  from topologicpy.Vector import Vector
490
491
  from topologicpy.Aperture import Aperture
@@ -527,7 +528,7 @@ class CellComplex():
527
528
  faces = CellComplex.Faces(cellComplex)
528
529
  zList = []
529
530
  for f in faces:
530
- zList.append(f.Centroid().Z())
531
+ zList.append(Vertex.Z(Topology.Centroid(f)))
531
532
  zMin = min(zList)
532
533
  zMax = max(zList)
533
534
  up = [0, 0, 1]
@@ -545,7 +546,7 @@ class CellComplex():
545
546
  internalVerticalApertures += getApertures(aFace)
546
547
  elif aCode == 1:
547
548
  if n == 1:
548
- if abs(aFace.Centroid().Z() - zMin) < tolerance:
549
+ if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin) < tolerance:
549
550
  bottomHorizontalFaces.append(aFace)
550
551
  bottomHorizontalApertures += getApertures(aFace)
551
552
  else:
@@ -556,7 +557,7 @@ class CellComplex():
556
557
  internalHorizontalApertures += getApertures(aFace)
557
558
  elif aCode == 2:
558
559
  if n == 1:
559
- if abs(aFace.Centroid().Z() - zMax) < tolerance:
560
+ if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax) < tolerance:
560
561
  topHorizontalFaces.append(aFace)
561
562
  topHorizontalApertures += getApertures(aFace)
562
563
  else:
topologicpy/DGL.py CHANGED
@@ -1633,6 +1633,7 @@ class DGL:
1633
1633
 
1634
1634
  """
1635
1635
  from topologicpy.Vertex import Vertex
1636
+ from topologicpy.Edge import Edge
1636
1637
  from topologicpy.Graph import Graph
1637
1638
  from topologicpy.Dictionary import Dictionary
1638
1639
  from topologicpy.Topology import Topology
@@ -1661,8 +1662,8 @@ class DGL:
1661
1662
 
1662
1663
  for i in range(len(edges)):
1663
1664
  e = edges[i]
1664
- sv = e.StartVertex()
1665
- ev = e.EndVertex()
1665
+ sv = Edge.StartVertex(e)
1666
+ ev = Edge.EndVertex(e)
1666
1667
  sn = nodes[Vertex.Index(vertex=sv, vertices=vertices, strict=False, tolerance=tolerance)]
1667
1668
  en = nodes[Vertex.Index(vertex=ev, vertices=vertices, strict=False, tolerance=tolerance)]
1668
1669
  if (([sn,en] in graph_edges) == False) and (([en,sn] in graph_edges) == False):
topologicpy/Edge.py CHANGED
@@ -427,8 +427,8 @@ class Edge():
427
427
  if not Topology.IsInstance(edge, "Edge"):
428
428
  print("Edge.Direction - Error: The input edge parameter is not a valid topologic edge. Returning None.")
429
429
  return None
430
- ev = edge.EndVertex()
431
- sv = edge.StartVertex()
430
+ sv = Edge.StartVertex(edge)
431
+ ev = Edge.EndVertex(edge)
432
432
  x = Vertex.X(ev, mantissa=mantissa) - Vertex.X(sv, mantissa=mantissa)
433
433
  y = Vertex.Y(ev, mantissa=mantissa) - Vertex.Y(sv, mantissa=mantissa)
434
434
  z = Vertex.Z(ev, mantissa=mantissa) - Vertex.Z(sv, mantissa=mantissa)
@@ -461,7 +461,7 @@ class Edge():
461
461
  return None
462
462
  vert = None
463
463
  try:
464
- vert = edge.EndVertex()
464
+ vert = edge.EndVertex() # Hook to core
465
465
  except:
466
466
  vert = None
467
467
  return vert
@@ -1247,11 +1247,11 @@ class Edge():
1247
1247
  print("Edge.Normalize - Error: The input edge parameter is not a valid topologic edge. Returning None.")
1248
1248
  return None
1249
1249
  if not useEndVertex:
1250
- sv = edge.StartVertex()
1251
- ev = Edge.VertexByDistance(edge, 1.0, edge.StartVertex())
1250
+ sv = Edge.StartVertex(edge)
1251
+ ev = Edge.VertexByDistance(edge, 1.0, Edge.StartVertex(edge))
1252
1252
  else:
1253
- sv = Edge.VertexByDistance(edge, 1.0, edge.StartVertex())
1254
- ev = edge.EndVertex()
1253
+ sv = Edge.VertexByDistance(edge, 1.0, Edge.StartVertex(edge))
1254
+ ev = Edge.EndVertex(edge)
1255
1255
  return Edge.ByVertices([sv, ev], tolerance=tolerance)
1256
1256
 
1257
1257
  @staticmethod
@@ -1316,7 +1316,7 @@ class Edge():
1316
1316
  if not Topology.IsInstance(edge, "Edge"):
1317
1317
  print("Edge.Reverse - Error: The input edge parameter is not a valid topologic edge. Returning None.")
1318
1318
  return None
1319
- return Edge.ByVertices([edge.EndVertex(), edge.StartVertex()], tolerance=tolerance)
1319
+ return Edge.ByVertices([Edge.EndVertex(edge), Edge.StartVertex(edge)], tolerance=tolerance)
1320
1320
 
1321
1321
  @staticmethod
1322
1322
  def SetLength(edge , length: float = 1.0, bothSides: bool = True, reverse: bool = False, tolerance: float = 0.0001):
@@ -1375,7 +1375,7 @@ class Edge():
1375
1375
  return None
1376
1376
  vert = None
1377
1377
  try:
1378
- vert = edge.StartVertex()
1378
+ vert = edge.StartVertex() # Hook to core
1379
1379
  except:
1380
1380
  vert = None
1381
1381
  return vert
@@ -1534,12 +1534,12 @@ class Edge():
1534
1534
  print("Edge.TrimByEdge2D - Error: The input edge parameter is not a valid topologic edge. Returning None.")
1535
1535
  return None
1536
1536
  if not Topology.IsInstance(origin, "Vertex"):
1537
- origin = edge.StartVertex()
1537
+ origin = Edge.StartVertex(edge)
1538
1538
  if not Topology.IsInstance(origin, "Vertex"):
1539
1539
  print("Edge.TrimByEdge2D - Error: The input origin parameter is not a valid topologic vertex. Returning None.")
1540
1540
  return None
1541
- sv = edge.StartVertex()
1542
- ev = edge.EndVertex()
1541
+ sv = Edge.StartVertex(edge)
1542
+ ev = Edge.EndVertex(edge)
1543
1543
  vx = Vertex.X(ev, mantissa=mantissa) - Vertex.X(sv, mantissa=mantissa)
1544
1544
  vy = Vertex.Y(ev, mantissa=mantissa) - Vertex.Y(sv, mantissa=mantissa)
1545
1545
  vz = Vertex.Z(ev, mantissa=mantissa) - Vertex.Z(sv, mantissa=mantissa)
@@ -1572,9 +1572,9 @@ class Edge():
1572
1572
  return None
1573
1573
  vertex = None
1574
1574
  if u == 0:
1575
- vertex = edge.StartVertex()
1575
+ vertex = Edge.StartVertex(edge)
1576
1576
  elif u == 1:
1577
- vertex = edge.EndVertex()
1577
+ vertex = Edge.EndVertex(edge)
1578
1578
  else:
1579
1579
  dir = Edge.Direction(edge)
1580
1580
  edge_length = Edge.Length(edge)
@@ -307,7 +307,7 @@ class EnergyModel:
307
307
  building_cells = [building]
308
308
  for spaceNumber, buildingCell in enumerate(building_cells):
309
309
  osSpace = openstudio.model.Space(osModel)
310
- osSpaceZ = Vertex.Z(buildingCell.CenterOfMass(), mantissa=mantissa)
310
+ osSpaceZ = Vertex.Z(Topology.CenterOfMass(buildingCell), mantissa=mantissa)
311
311
  osBuildingStory = osBuildingStorys[0]
312
312
  for x in osBuildingStorys:
313
313
  osBuildingStoryZ = x.nominalZCoordinate().get()
@@ -372,7 +372,7 @@ class EnergyModel:
372
372
  osSurface.setSurfaceType("RoofCeiling")
373
373
  osSurface.setOutsideBoundaryCondition("Outdoors")
374
374
  osSurface.setName(osSpace.name().get() + "_TopHorizontalSlab_" + str(faceNumber))
375
- if max(list(map(lambda vertex: vertex.Z(), Topology.SubTopologies(buildingFace, "Vertex")))) < 1e-6:
375
+ if max(list(map(lambda vertex: Vertex.Z(vertex), Topology.SubTopologies(buildingFace, "Vertex")))) < 1e-6:
376
376
  osSurface.setSurfaceType("Floor")
377
377
  osSurface.setOutsideBoundaryCondition("Ground")
378
378
  osSurface.setName(osSpace.name().get() + "_BottomHorizontalSlab_" + str(faceNumber))
@@ -1039,14 +1039,14 @@ class EnergyModel:
1039
1039
  surfaceEdges = []
1040
1040
  surfaceVertices = surface.vertices()
1041
1041
  for i in range(len(surfaceVertices)-1):
1042
- sv = Vertex.ByCoordinates(surfaceVertices[i].x(), surfaceVertices[i].y(), surfaceVertices[i].z())
1043
- ev = Vertex.ByCoordinates(surfaceVertices[i+1].x(), surfaceVertices[i+1].y(), surfaceVertices[i+1].z())
1042
+ sv = Vertex.ByCoordinates(Vertex.X(surfaceVertices[i]), Vertex.Y(surfaceVertices[i]), Vertex.Z(surfaceVertices[i]))
1043
+ ev = Vertex.ByCoordinates(Vertex.X(surfaceVertices[i+1]), Vertex.Y(surfaceVertices[i+1]), Vertex.Z(surfaceVertices[i+1]))
1044
1044
  edge = Edge.ByStartVertexEndVertex(sv, ev, tolerance=tolerance, silent=False)
1045
1045
  if not edge:
1046
1046
  continue
1047
1047
  surfaceEdges.append(edge)
1048
- sv = Vertex.ByCoordinates(surfaceVertices[len(surfaceVertices)-1].x(), surfaceVertices[len(surfaceVertices)-1].y(), surfaceVertices[len(surfaceVertices)-1].z())
1049
- ev = Vertex.ByCoordinates(surfaceVertices[0].x(), surfaceVertices[0].y(), surfaceVertices[0].z())
1048
+ sv = Vertex.ByCoordinates(Vertex.X(surfaceVertices[len(surfaceVertices)-1]), Vertex.Y(surfaceVertices[len(surfaceVertices)-1]), Vertex.Z(surfaceVertices[len(surfaceVertices)-1]))
1049
+ ev = Vertex.ByCoordinates(Vertex.X(surfaceVertices[0]), Vertex.Y(surfaceVertices[0]), Vertex.Z(surfaceVertices[0]))
1050
1050
  edge = Edge.ByStartVertexEndVertex(sv, ev, tolerance=tolerance, silent=False)
1051
1051
  surfaceEdges.append(edge)
1052
1052
  surfaceWire = Wire.ByEdges(surfaceEdges, tolerance=tolerance)
@@ -1057,7 +1057,7 @@ class EnergyModel:
1057
1057
  def addApertures(face, apertures):
1058
1058
  usedFaces = []
1059
1059
  for aperture in apertures:
1060
- cen = aperture.CenterOfMass()
1060
+ cen = Topology.CenterOfMass(aperture)
1061
1061
  try:
1062
1062
  params = face.ParametersAtVertex(cen)
1063
1063
  u = params[0]