topologicpy 0.5.1__py3-none-any.whl → 0.5.3__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.
@@ -443,20 +443,21 @@ class CellComplex(Topology):
443
443
  -------
444
444
  dictionary
445
445
  A dictionary with the following keys and values:
446
- 1. "externalVerticalFaces": list of external vertical faces
447
- 2. "internalVerticalFaces": list of internal vertical faces
448
- 3. "topHorizontalFaces": list of top horizontal faces
449
- 4. "bottomHorizontalFaces": list of bottom horizontal faces
450
- 5. "internalHorizontalFaces": list of internal horizontal faces
451
- 6. "externalInclinedFaces": list of external inclined faces
452
- 7. "internalInclinedFaces": list of internal inclined faces
453
- 8. "externalVerticalApertures": list of external vertical apertures
454
- 9. "internalVerticalApertures": list of internal vertical apertures
455
- 10. "topHorizontalApertures": list of top horizontal apertures
456
- 11. "bottomHorizontalApertures": list of bottom horizontal apertures
457
- 12. "internalHorizontalApertures": list of internal horizontal apertures
458
- 13. "externalInclinedApertures": list of external inclined apertures
459
- 14. "internalInclinedApertures": list of internal inclined apertures
446
+ 1. "cells": list of cells
447
+ 2. "externalVerticalFaces": list of external vertical faces
448
+ 3. "internalVerticalFaces": list of internal vertical faces
449
+ 4. "topHorizontalFaces": list of top horizontal faces
450
+ 5. "bottomHorizontalFaces": list of bottom horizontal faces
451
+ 6. "internalHorizontalFaces": list of internal horizontal faces
452
+ 7. "externalInclinedFaces": list of external inclined faces
453
+ 8. "internalInclinedFaces": list of internal inclined faces
454
+ 9. "externalVerticalApertures": list of external vertical apertures
455
+ 10. "internalVerticalApertures": list of internal vertical apertures
456
+ 11. "topHorizontalApertures": list of top horizontal apertures
457
+ 12. "bottomHorizontalApertures": list of bottom horizontal apertures
458
+ 13. "internalHorizontalApertures": list of internal horizontal apertures
459
+ 14. "externalInclinedApertures": list of external inclined apertures
460
+ 15. "internalInclinedApertures": list of internal inclined apertures
460
461
 
461
462
  """
462
463
  from topologicpy.Face import Face
@@ -553,7 +554,9 @@ class CellComplex(Topology):
553
554
  internalInclinedFaces.append(aFace)
554
555
  internalInclinedApertures += getApertures(aFace)
555
556
 
557
+ cells = Topology.Cells(cellComplex)
556
558
  d = {
559
+ "cells" : cells,
557
560
  "externalVerticalFaces" : externalVerticalFaces,
558
561
  "internalVerticalFaces" : internalVerticalFaces,
559
562
  "topHorizontalFaces" : topHorizontalFaces,
topologicpy/Graph.py CHANGED
@@ -1765,18 +1765,19 @@ class Graph:
1765
1765
  edges.append(tempe)
1766
1766
  if viaSharedApertures:
1767
1767
  for sharedAperture in sharedApertures:
1768
+ sharedAp = sharedAperture.Topology()
1768
1769
  if useInternalVertex == True:
1769
- vst = Topology.InternalVertex(sharedAperture.Topology(), tolerance)
1770
+ vst = Topology.InternalVertex(sharedAp, tolerance)
1770
1771
  else:
1771
- vst = sharedAperture.Topology().CenterOfMass()
1772
- d1 = sharedAperture.Topology().GetDictionary()
1772
+ vst = sharedAp.CenterOfMass()
1773
+ d1 = sharedAp.GetDictionary()
1774
+ vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
1773
1775
  if storeBRep:
1774
1776
  d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAperture), Topology.Type(sharedAperture), Topology.TypeAsString(sharedAperture)])
1775
1777
  d3 = mergeDictionaries2([d1, d2])
1776
1778
  _ = vst.SetDictionary(d3)
1777
1779
  else:
1778
1780
  _ = vst.SetDictionary(d1)
1779
- vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
1780
1781
  vertices.append(vst)
1781
1782
  tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
1782
1783
  tempd = Dictionary.ByKeysValues(["relationship"],["Via Shared Apertures"])
@@ -2608,11 +2609,12 @@ class Graph:
2608
2609
  edges.append(tempe)
2609
2610
  if viaSharedApertures:
2610
2611
  for sharedAperture in sharedApertures:
2612
+ sharedTop = sharedAperture.Topology()
2611
2613
  if useInternalVertex == True:
2612
- vst = Topology.InternalVertex(sharedAperture.Topology(), tolerance)
2614
+ vst = Topology.InternalVertex(sharedTop, tolerance)
2613
2615
  else:
2614
- vst = sharedAperture.Topology().CenterOfMass()
2615
- d1 = sharedAperture.Topology().GetDictionary()
2616
+ vst = sharedTop.CenterOfMass()
2617
+ d1 = sharedTop.GetDictionary()
2616
2618
  vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
2617
2619
  if storeBRep:
2618
2620
  d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(sharedAperture)), Topology.Type(Aperture.Topology(sharedAperture)), Topology.TypeAsString(Aperture.Topology(sharedAperture))])
@@ -2684,7 +2686,6 @@ class Graph:
2684
2686
  vst = content.CenterOfMass()
2685
2687
  vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
2686
2688
  d1 = content.GetDictionary()
2687
- vst = topologic.Vertex.ByCoordinates(vst.X(), vst.Y(), vst.Z())
2688
2689
  if storeBRep:
2689
2690
  d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
2690
2691
  d3 = mergeDictionaries2([d1, d2])
@@ -2928,6 +2929,7 @@ class Graph:
2928
2929
  if not isinstance(topology, topologic.Topology):
2929
2930
  print("Graph.ByTopology - Error: The input topology is not a valid topology. Returning None.")
2930
2931
  return None
2932
+ topology = Topology.Copy(topology)
2931
2933
  graph = None
2932
2934
  item = [topology, None, None, None, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, None, useInternalVertex, storeBRep, tolerance]
2933
2935
  vertices = []
@@ -5144,7 +5146,7 @@ class Graph:
5144
5146
  j_data = {}
5145
5147
  j_data['nodes'] = {}
5146
5148
  j_data['edges'] = {}
5147
- n = len(str(len(vertices)))
5149
+ n = max(len(str(len(vertices))),4)
5148
5150
  v_labels = []
5149
5151
  v_dicts = []
5150
5152
  for i, v in enumerate(vertices):
@@ -6346,7 +6348,7 @@ class Graph:
6346
6348
  @staticmethod
6347
6349
  def ShortestPath(graph, vertexA, vertexB, vertexKey="", edgeKey="Length", tolerance=0.0001):
6348
6350
  """
6349
- Returns the shortest path that connects the input vertices.
6351
+ Returns the shortest path that connects the input vertices. The shortest path will take into consideration both the vertexKey and the edgeKey if both are specified and will minimize the total "cost" of the path. Otherwise, it will take into consideration only whatever key is specified.
6350
6352
 
6351
6353
  Parameters
6352
6354
  ----------
topologicpy/Helper.py CHANGED
@@ -303,6 +303,40 @@ class Helper:
303
303
  normalized_list = [round((x - min_val) / (max_val - min_val), mantissa) for x in l]
304
304
  return normalized_list
305
305
 
306
+ @staticmethod
307
+ def Position(item, listA):
308
+ """
309
+ Returns the position of the item in the list or the position it would have been inserts.
310
+ item is assumed to be numeric. listA is assumed to contain only numeric values and sorted from lowest to highest value.
311
+
312
+ Parameters
313
+ ----------
314
+ item : int or float
315
+ The input number to be positioned.
316
+ listA : list
317
+ The input sorted list.
318
+
319
+ Returns
320
+ -------
321
+ int
322
+ The position of the item within the list.
323
+
324
+ """
325
+ left = 0
326
+ right = len(listA) - 1
327
+
328
+ while left <= right:
329
+ mid = (left + right) // 2
330
+ if listA[mid] == item:
331
+ return mid
332
+ elif listA[mid] < item:
333
+ left = mid + 1
334
+ else:
335
+ right = mid - 1
336
+
337
+ # If the target is not found, return the position where it would be inserted
338
+ return left
339
+
306
340
  @staticmethod
307
341
  def Repeat(listA):
308
342
  """
topologicpy/__init__.py CHANGED
@@ -18,7 +18,7 @@ import sys
18
18
  import os, re
19
19
  from sys import platform
20
20
 
21
- __version__ = '0.5.1'
21
+ __version__ = '0.5.3'
22
22
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
23
23
 
24
24
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -1,6 +1,6 @@
1
1
  topologicpy/Aperture.py,sha256=vENYlFaM6Pu-xCJB1YsW1I1_u5yDj-A70aU3bo3lpFA,2819
2
2
  topologicpy/Cell.py,sha256=m3hra2X7VoWyqa4iXy_MBzqk_M-ylfbi23mHxc-AnfQ,98985
3
- topologicpy/CellComplex.py,sha256=s6zOuamZzo4y1Eltz517GvHh3uugJtAFdjU_EQE5NT8,47409
3
+ topologicpy/CellComplex.py,sha256=_ASHRgEUTCvFYvIXA2KC6TOuOMKh2MZe1Go6MPjPvFE,47524
4
4
  topologicpy/Cluster.py,sha256=yPeFvHiRVKBxHVnz6xH8I5ZDBG-Pc0hOnrHLQEATPDU,54972
5
5
  topologicpy/Color.py,sha256=I_Sm0F-5Hr3y6tFCBaLOplslLnu-wpA8T0VQkH8x54g,17057
6
6
  topologicpy/Context.py,sha256=bgwslZSu8Ijuz3fusdhP6XcDnCdwGhtbI0-uhVjB36U,2977
@@ -9,9 +9,9 @@ topologicpy/Dictionary.py,sha256=vGhiXPu7e7GsgQyTsX6rZBncnnrDlcYfM9xRb9h-l3U,247
9
9
  topologicpy/Edge.py,sha256=C4VKk8leXTQySsGKCE4RSt3HiUhA12Ny_rGhEr71LWY,50009
10
10
  topologicpy/EnergyModel.py,sha256=VPWkMP2uhJORiVqEomb2Dlx5VgKcVUbqnZBZX1IpF_Y,51771
11
11
  topologicpy/Face.py,sha256=81sURmH5TjbvSUzzSTGWPwb4jjqle4vplPeEo4Cwuvk,82576
12
- topologicpy/Graph.py,sha256=IVJnb3JxKs_RwXwjqv2MTFhz7HVw04oqAK52JQYZizY,329199
12
+ topologicpy/Graph.py,sha256=e18vs3uEVn62pt0kHWxA638tqMlxIuyt0In7pRnK9yU,329418
13
13
  topologicpy/Grid.py,sha256=q6uAs8MGbdteYNbjqRjqlhFMquYAvSngwzxsFl9-338,17371
14
- topologicpy/Helper.py,sha256=VkOCa3-z31uQj1ZTuufOtg4Ly5WZYHJ6bCmJndDpEGc,17242
14
+ topologicpy/Helper.py,sha256=dsMU4BAt6zKsYG-YiT_OE4kX2rq3dtl3AqMMd35-6DA,18250
15
15
  topologicpy/Honeybee.py,sha256=p5OZi8tGPxUNH91_8peChEkYJdg5vpRyeqHVz8S9OS0,20356
16
16
  topologicpy/Matrix.py,sha256=1aH7QKP6eNUbUXmZbB7e_4dw1ZSVQ8bsOsKJXtQq3_4,8357
17
17
  topologicpy/Neo4j.py,sha256=4B_lYgZIDztqINkHL_J6gsfkZQ043wEsZpD_9uPYOMU,19356
@@ -23,7 +23,7 @@ topologicpy/Topology.py,sha256=7zmDexNyS9v4hQLPj7YWbrcYgKBk9DCsqzM1BHhgcJE,30526
23
23
  topologicpy/Vector.py,sha256=EZ4vJbZfxcUVtKkmiUJnOM_II2Z4l6_zEWTJyfNEtiY,30362
24
24
  topologicpy/Vertex.py,sha256=bzjLi-4XSg2Jg9hO9iH4g1CpF-_CHzjAd3kdDYi78ao,66449
25
25
  topologicpy/Wire.py,sha256=RUeD_bDfUpc5iLZtUMuK-e6lXpvSRHBHuEzxJUBrbaY,131490
26
- topologicpy/__init__.py,sha256=f8czF2FmoUshgIKYVdvf00lAuKQIcvYQRhuwHVmNJFU,1444
26
+ topologicpy/__init__.py,sha256=FDAppmvWA0gZbsNvjMV5KK1_srJsuhxTgw6jkWBvxNE,1444
27
27
  topologicpy/bin/linux/topologic/__init__.py,sha256=XlFReDf3FWlYdM9uXtanYPIafgPb6GVTQczS_xJAXD0,60
28
28
  topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0,sha256=ANok9DQKcnWcLd9T_LAt-i-X4nsYYy16q9kQlcTre1E,2996488
29
29
  topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0,sha256=OJ3XesL79du8LeBHrsleGPXub6OpJdOilxha0mwjqQo,1378768
@@ -84,8 +84,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
84
84
  topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
85
85
  topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
86
86
  topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
87
- topologicpy-0.5.1.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
88
- topologicpy-0.5.1.dist-info/METADATA,sha256=khzpXTId9tt4uLByqWsgneDO-DdCeyb38qlm2Yv0JMk,7277
89
- topologicpy-0.5.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
90
- topologicpy-0.5.1.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
91
- topologicpy-0.5.1.dist-info/RECORD,,
87
+ topologicpy-0.5.3.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
88
+ topologicpy-0.5.3.dist-info/METADATA,sha256=-OvexvtudRFYXh5FvdyUZi7fsOqOIjRedmLI2O4P2GY,7277
89
+ topologicpy-0.5.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
90
+ topologicpy-0.5.3.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
91
+ topologicpy-0.5.3.dist-info/RECORD,,