topologicpy 0.6.3__py3-none-any.whl → 0.7.0__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.
@@ -114,8 +114,8 @@ class EnergyModel:
114
114
  return osModel
115
115
 
116
116
  @staticmethod
117
- def ByTopology(building : topologic.Topology,
118
- shadingSurfaces : topologic.Topology = None,
117
+ def ByTopology(building,
118
+ shadingSurfaces = None,
119
119
  osModelPath : str = None,
120
120
  weatherFilePath : str = None,
121
121
  designDayFilePath : str = None,
@@ -134,9 +134,9 @@ class EnergyModel:
134
134
 
135
135
  Parameters
136
136
  ----------
137
- building : topologic.CellComplex or topologic.Cell
137
+ building : topologic_core.CellComplex or topologic_core.Cell
138
138
  The input building topology.
139
- shadingSurfaces : topologic.Topology , optional
139
+ shadingSurfaces : topologic_core.Topology , optional
140
140
  The input topology for shading surfaces. The default is None.
141
141
  osModelPath : str , optional
142
142
  The path to the template OSM file. The default is "./assets/EnergyModel/OSMTemplate-OfficeBuilding-3.5.0.osm".
@@ -176,6 +176,7 @@ class EnergyModel:
176
176
  from topologicpy.Cell import Cell
177
177
  from topologicpy.Topology import Topology
178
178
  from topologicpy.Dictionary import Dictionary
179
+ from topologicpy.Aperture import Aperture
179
180
  try:
180
181
  import openstudio
181
182
  openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
@@ -215,13 +216,13 @@ class EnergyModel:
215
216
  from topologicpy.Cell import Cell
216
217
  from topologicpy.CellComplex import CellComplex
217
218
 
218
- if isinstance(building, topologic.CellComplex):
219
+ if Topology.IsInstance(building, "CellComplex"):
219
220
  d = CellComplex.Decompose(building)
220
221
  bhf = d['bottomHorizontalFaces']
221
222
  ihf = d['internalHorizontalFaces']
222
223
  thf = d ['topHorizontalFaces']
223
224
  hf = bhf+ihf+thf
224
- elif isinstance(building, topologic.Cell):
225
+ elif Topology.IsInstance(building, "Cell"):
225
226
  d = Cell.Decompose(building)
226
227
  bhf = d['bottomHorizontalFaces']
227
228
  thf = d ['topHorizontalFaces']
@@ -287,9 +288,9 @@ class EnergyModel:
287
288
  osBuildingStorys.sort(key=lambda x: x.nominalZCoordinate().get())
288
289
  osSpaces = []
289
290
  spaceNames = []
290
- if isinstance(building, topologic.CellComplex):
291
+ if Topology.IsInstance(building, "CellComplex"):
291
292
  building_cells = Topology.SubTopologies(building, "Cell")
292
- elif isinstance(building, topologic.Cell):
293
+ elif Topology.IsInstance(building, "Cell"):
293
294
  building_cells = [building]
294
295
  for spaceNumber, buildingCell in enumerate(building_cells):
295
296
  osSpace = openstudio.model.Space(osModel)
@@ -373,8 +374,7 @@ class EnergyModel:
373
374
  if len(apertures) > 0:
374
375
  for aperture in apertures:
375
376
  osSubSurfacePoints = []
376
- #apertureFace = TopologySubTopologies.processItem([aperture, topologic.Face])[0]
377
- apertureFace = topologic.Aperture.Topology(aperture)
377
+ apertureFace = Aperture.Topology(aperture)
378
378
  for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
379
379
  osSubSurfacePoints.append(openstudio.Point3d(vertex.X(), vertex.Y(), vertex.Z()))
380
380
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
@@ -412,8 +412,7 @@ class EnergyModel:
412
412
  if len(apertures) > 0:
413
413
  for aperture in apertures:
414
414
  osSubSurfacePoints = []
415
- #apertureFace = TopologySubTopologies.processItem([aperture, "Face"])[0]
416
- apertureFace = topologic.Aperture.Topology(aperture)
415
+ apertureFace = Aperture.Topology(aperture)
417
416
  for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
418
417
  osSubSurfacePoints.append(openstudio.Point3d(vertex.X(), vertex.Y(), vertex.Z()))
419
418
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
@@ -1006,6 +1005,7 @@ class EnergyModel:
1006
1005
  - "shadingFaces"
1007
1006
 
1008
1007
  """
1008
+ from topologicpy.Vertex import Vertex
1009
1009
  from topologicpy.Edge import Edge
1010
1010
  from topologicpy.Wire import Wire
1011
1011
  from topologicpy.Face import Face
@@ -1013,20 +1013,22 @@ class EnergyModel:
1013
1013
  from topologicpy.Cell import Cell
1014
1014
  from topologicpy.Cluster import Cluster
1015
1015
  from topologicpy.Dictionary import Dictionary
1016
+ from topologicpy.Aperture import Aperture
1017
+ from topologicpy.Context import Context
1016
1018
  from topologicpy.Topology import Topology
1017
1019
 
1018
1020
  def surfaceToFace(surface):
1019
1021
  surfaceEdges = []
1020
1022
  surfaceVertices = surface.vertices()
1021
1023
  for i in range(len(surfaceVertices)-1):
1022
- sv = topologic.Vertex.ByCoordinates(surfaceVertices[i].x(), surfaceVertices[i].y(), surfaceVertices[i].z())
1023
- ev = topologic.Vertex.ByCoordinates(surfaceVertices[i+1].x(), surfaceVertices[i+1].y(), surfaceVertices[i+1].z())
1024
+ sv = Vertex.ByCoordinates(surfaceVertices[i].x(), surfaceVertices[i].y(), surfaceVertices[i].z())
1025
+ ev = Vertex.ByCoordinates(surfaceVertices[i+1].x(), surfaceVertices[i+1].y(), surfaceVertices[i+1].z())
1024
1026
  edge = Edge.ByStartVertexEndVertex(sv, ev, tolerance=tolerance, silent=False)
1025
1027
  if not edge:
1026
1028
  continue
1027
1029
  surfaceEdges.append(edge)
1028
- sv = topologic.Vertex.ByCoordinates(surfaceVertices[len(surfaceVertices)-1].x(), surfaceVertices[len(surfaceVertices)-1].y(), surfaceVertices[len(surfaceVertices)-1].z())
1029
- ev = topologic.Vertex.ByCoordinates(surfaceVertices[0].x(), surfaceVertices[0].y(), surfaceVertices[0].z())
1030
+ sv = Vertex.ByCoordinates(surfaceVertices[len(surfaceVertices)-1].x(), surfaceVertices[len(surfaceVertices)-1].y(), surfaceVertices[len(surfaceVertices)-1].z())
1031
+ ev = Vertex.ByCoordinates(surfaceVertices[0].x(), surfaceVertices[0].y(), surfaceVertices[0].z())
1030
1032
  edge = Edge.ByStartVertexEndVertex(sv, ev, tolerance=tolerance, silent=False)
1031
1033
  surfaceEdges.append(edge)
1032
1034
  surfaceWire = Wire.ByEdges(surfaceEdges, tolerance=tolerance)
@@ -1047,12 +1049,11 @@ class EnergyModel:
1047
1049
  u = 0.5
1048
1050
  v = 0.5
1049
1051
  w = 0.5
1050
- context = topologic.Context.ByTopologyParameters(face, u, v, w)
1051
- _ = topologic.Aperture.ByTopologyContext(aperture, context)
1052
+ context = Context.ByTopologyParameters(face, u, v, w)
1053
+ _ = Aperture.ByTopologyContext(aperture, context)
1052
1054
  return face
1053
1055
  spaces = list(model.getSpaces())
1054
1056
 
1055
- vertexIndex = 0
1056
1057
  cells = []
1057
1058
  apertures = []
1058
1059
  shadingFaces = []
@@ -1098,22 +1099,20 @@ class EnergyModel:
1098
1099
  for aSurface in surfaces:
1099
1100
  aFace = surfaceToFace(aSurface)
1100
1101
  aFace = topologic.TopologyUtility.Transform(aFace, osTranslation.x(), osTranslation.y(), osTranslation.z(), rotation11, rotation12, rotation13, rotation21, rotation22, rotation23, rotation31, rotation32, rotation33)
1101
- #aFace.__class__ = topologic.Face
1102
1102
  subSurfaces = aSurface.subSurfaces()
1103
1103
  for aSubSurface in subSurfaces:
1104
1104
  aperture = surfaceToFace(aSubSurface)
1105
1105
  aperture = topologic.TopologyUtility.Transform(aperture, osTranslation.x(), osTranslation.y(), osTranslation.z(), rotation11, rotation12, rotation13, rotation21, rotation22, rotation23, rotation31, rotation32, rotation33)
1106
- # aperture.__class__ = topologic.Face
1107
1106
  apertures.append(aperture)
1108
1107
  addApertures(aFace, apertures)
1109
1108
  spaceFaces.append(aFace)
1110
- spaceFaces = [x for x in spaceFaces if isinstance(x, topologic.Face)]
1109
+ spaceFaces = [x for x in spaceFaces if Topology.IsInstance(x, "Face")]
1111
1110
  spaceCell = Cell.ByFaces(spaceFaces, tolerance=tolerance)
1112
1111
  if not spaceCell:
1113
1112
  spaceCell = Shell.ByFaces(spaceFaces, tolerance=tolerance)
1114
- if not isinstance(spaceCell, topologic.Cell):
1113
+ if not Topology.IsInstance(spaceCell, "Cell"):
1115
1114
  spaceCell = Cluster.ByTopologies(spaceFaces)
1116
- if isinstance(spaceCell, topologic.Topology): #debugging
1115
+ if Topology.IsInstance(spaceCell, "Topology"): #debugging
1117
1116
  # Set Dictionary for Cell
1118
1117
  keys = []
1119
1118
  values = []