topologicpy 0.7.52__py3-none-any.whl → 0.7.55__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
@@ -969,12 +969,7 @@ class Cell():
969
969
  return code
970
970
 
971
971
  def getApertures(topology):
972
- apTopologies = []
973
- apertures = Topology.Apertures(topology)
974
- if isinstance(apertures, list):
975
- for aperture in apertures:
976
- apTopologies.append(Aperture.Topology(aperture))
977
- return apTopologies
972
+ return Topology.Apertures(topology)
978
973
 
979
974
  if not Topology.IsInstance(cell, "Cell"):
980
975
  print("Cell.Decompose - Error: The input cell parameter is not a valid topologic cell. Returning None.")
@@ -493,12 +493,7 @@ class CellComplex():
493
493
  return code
494
494
 
495
495
  def getApertures(topology):
496
- apertures = []
497
- apTopologies = []
498
- apertures = Topology.Apertures(topology)
499
- for aperture in apertures:
500
- apTopologies.append(Aperture.Topology(aperture))
501
- return apTopologies
496
+ return Topology.Apertures(topology)
502
497
 
503
498
  if not Topology.IsInstance(cellComplex, "CellComplex"):
504
499
  print("CellComplex.Decompose - Error: The input cellcomplex parameter is not a valid topologic cellcomplex. Returning None.")
@@ -382,12 +382,11 @@ class EnergyModel:
382
382
  osSurface.setName(osSpace.name().get() + "_ExternalVerticalFace_" + str(faceNumber))
383
383
  # Check for exterior apertures
384
384
  faceDictionary = buildingFace.GetDictionary()
385
- apertures = []
386
- _ = buildingFace.Apertures(apertures)
385
+ #apertures = []
386
+ apertures = Topology.Apertures(buildingFace)
387
387
  if len(apertures) > 0:
388
- for aperture in apertures:
388
+ for apertureFace in apertures:
389
389
  osSubSurfacePoints = []
390
- apertureFace = Aperture.Topology(aperture)
391
390
  for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
392
391
  osSubSurfacePoints.append(openstudio.Point3d(Vertex.X(vertex, mantissa=mantissa), Vertex.Y(vertex, mantissa=mantissa), Vertex.Z(vertex, mantissa=mantissa)))
393
392
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
@@ -420,12 +419,11 @@ class EnergyModel:
420
419
  osSurface.setName(osSpace.name().get() + "_InternalVerticalFace_" + str(faceNumber))
421
420
  # Check for interior apertures
422
421
  faceDictionary = buildingFace.GetDictionary()
423
- apertures = []
424
- _ = buildingFace.Apertures(apertures)
422
+ #apertures = []
423
+ apertures = Topology.Apertures(buildingFace)
425
424
  if len(apertures) > 0:
426
- for aperture in apertures:
425
+ for apertureFace in apertures:
427
426
  osSubSurfacePoints = []
428
- apertureFace = Aperture.Topology(aperture)
429
427
  for vertex in Topology.SubTopologies(apertureFace.ExternalBoundary(), "Vertex"):
430
428
  osSubSurfacePoints.append(openstudio.Point3d(Vertex.X(vertex, mantissa=mantissa), Vertex.Y(vertex, mantissa=mantissa), Vertex.Z(vertex.Z, mantissa=mantissa)))
431
429
  osSubSurface = openstudio.model.SubSurface(osSubSurfacePoints, osModel)
topologicpy/Face.py CHANGED
@@ -276,7 +276,7 @@ class Face():
276
276
  return face
277
277
 
278
278
  @staticmethod
279
- def ByOffset(face, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = "stepOffsetA", stepOffsetKeyB: str = "stepOffsetB", reverse: bool = False, bisectors: bool = False, transferDictionaries: bool = False, tolerance: float = 0.0001, silent: bool = False):
279
+ def ByOffset(face, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = "stepOffsetA", stepOffsetKeyB: str = "stepOffsetB", reverse: bool = False, bisectors: bool = False, transferDictionaries: bool = False, epsilon: float = 0.01, tolerance: float = 0.0001, silent: bool = False, numWorkers: int = None):
280
280
  """
281
281
  Creates an offset face from the input face. A positive offset value results in an offset to the interior of an anti-clockwise face.
282
282
 
@@ -302,10 +302,15 @@ class Face():
302
302
  If set to True, the direction of offsets is reversed. Otherwise, it is not. The default is False.
303
303
  transferDictionaries : bool , optional
304
304
  If set to True, the dictionaries of the original wire, its edges, and its vertices are transfered to the new wire. Otherwise, they are not. The default is False.
305
+ epsilon : float , optional
306
+ The desired epsilon (another form of tolerance for shortest edge to remove). The default is 0.01. (This is set to a larger number as it was found to work better)
305
307
  tolerance : float , optional
306
308
  The desired tolerance. The default is 0.0001.
307
309
  silent : bool , optional
308
310
  If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
311
+ numWorkers : int , optional
312
+ Number of workers run in parallel to process. If you set it to 1, no parallel processing will take place.
313
+ The default is None which causes the algorithm to use twice the number of cpu cores in the host computer.
309
314
 
310
315
  Returns
311
316
  -------
@@ -338,8 +343,10 @@ class Face():
338
343
  reverse=reverse,
339
344
  bisectors=bisectors,
340
345
  transferDictionaries=transferDictionaries,
346
+ epsilon=epsilon,
341
347
  tolerance=tolerance,
342
- silent=silent)
348
+ silent=silent,
349
+ numWorkers=numWorkers)
343
350
  offset_internal_boundaries = []
344
351
  for internal_boundary in internal_boundaries:
345
352
  offset_internal_boundary = Wire.ByOffset(internal_boundary,
@@ -352,8 +359,10 @@ class Face():
352
359
  reverse=reverse,
353
360
  bisectors=bisectors,
354
361
  transferDictionaries=transferDictionaries,
362
+ epsilon=epsilon,
355
363
  tolerance=tolerance,
356
- silent=silent)
364
+ silent=silent,
365
+ numWorkers=numWorkers)
357
366
  offset_internal_boundaries.append(offset_internal_boundary)
358
367
 
359
368
  if bisectors == True:
@@ -367,8 +376,10 @@ class Face():
367
376
  reverse=reverse,
368
377
  bisectors=False,
369
378
  transferDictionaries=transferDictionaries,
379
+ epsilon=epsilon,
370
380
  tolerance=tolerance,
371
- silent=silent)
381
+ silent=silent,
382
+ numWorkers=numWorkers)
372
383
  all_edges = Topology.Edges(offset_external_boundary)+[Topology.Edges(ib) for ib in offset_internal_boundaries]
373
384
  all_edges += Topology.Edges(face)
374
385
  all_edges = Helper.Flatten(all_edges)