topologicpy 0.7.60__py3-none-any.whl → 0.7.61__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/Topology.py CHANGED
@@ -2382,7 +2382,7 @@ class Topology():
2382
2382
 
2383
2383
  """
2384
2384
 
2385
- import ifcopenshell
2385
+ import ifcopenshell, ifcopenshell.geom
2386
2386
  from topologicpy.Dictionary import Dictionary
2387
2387
 
2388
2388
  def get_psets(entity):
@@ -2399,22 +2399,23 @@ class Topology():
2399
2399
  property_set = definition.RelatingPropertyDefinition
2400
2400
 
2401
2401
  # Check if it is a property set
2402
- if property_set.is_a('IfcPropertySet'):
2403
- pset_name = "IFC_"+property_set.Name
2404
-
2405
- # Dictionary to hold individual properties
2406
- properties = {}
2407
-
2408
- # Iterate over the properties in the PSET
2409
- for prop in property_set.HasProperties:
2410
- if prop.is_a('IfcPropertySingleValue'):
2411
- # Get the property name and value
2412
- prop_name = "IFC_"+prop.Name
2413
- prop_value = prop.NominalValue.wrappedValue if prop.NominalValue else None
2414
- properties[prop_name] = prop_value
2415
-
2416
- # Add this PSET to the dictionary for this entity
2417
- psets[pset_name] = properties
2402
+ if not property_set == None:
2403
+ if property_set.is_a('IfcPropertySet'):
2404
+ pset_name = "IFC_"+property_set.Name
2405
+
2406
+ # Dictionary to hold individual properties
2407
+ properties = {}
2408
+
2409
+ # Iterate over the properties in the PSET
2410
+ for prop in property_set.HasProperties:
2411
+ if prop.is_a('IfcPropertySingleValue'):
2412
+ # Get the property name and value
2413
+ prop_name = "IFC_"+prop.Name
2414
+ prop_value = prop.NominalValue.wrappedValue if prop.NominalValue else None
2415
+ properties[prop_name] = prop_value
2416
+
2417
+ # Add this PSET to the dictionary for this entity
2418
+ psets[pset_name] = properties
2418
2419
  return psets
2419
2420
 
2420
2421
  def get_color_transparency_material(entity):
@@ -2549,7 +2550,7 @@ class Topology():
2549
2550
  # Main Code
2550
2551
  topologies = []
2551
2552
  settings = ifcopenshell.geom.settings()
2552
- settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.SOLID)
2553
+ #settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.SOLID)
2553
2554
  settings.set(settings.USE_WORLD_COORDS, True)
2554
2555
  products = file.by_type("IfcProduct")
2555
2556
  entities = []
@@ -3110,7 +3111,8 @@ class Topology():
3110
3111
  edge_apertures = []
3111
3112
  face_apertures = []
3112
3113
  # Step 2: Create Entities and handle apertures
3113
- for entity in string:
3114
+ json_dictionary = json.loads(string)
3115
+ for entity in json_dictionary:
3114
3116
  entity_type = entity['type']
3115
3117
  entity_dict = Dictionary.ByKeysValues(keys=list(entity['dictionary'].keys()),
3116
3118
  values=list(entity['dictionary'].values()))
@@ -4281,7 +4283,7 @@ class Topology():
4281
4283
  return topologyA
4282
4284
 
4283
4285
  @staticmethod
4284
- def Explode(topology, origin=None, scale: float = 1.25, typeFilter: str = None, axes: str = "xyz", mantissa: int = 6, tolerance: float = 0.0001):
4286
+ def Explode(topology, origin=None, scale: float = 1.25, typeFilter: str = None, axes: str = "xyz", transferDictionaries: bool = False, mantissa: int = 6, tolerance: float = 0.0001):
4285
4287
  """
4286
4288
  Explodes the input topology. See https://en.wikipedia.org/wiki/Exploded-view_drawing.
4287
4289
 
@@ -4297,6 +4299,8 @@ class Topology():
4297
4299
  The type of the subtopologies to explode. This can be any of "vertex", "edge", "face", or "cell". If set to None, a subtopology one level below the type of the input topology will be used. The default is None.
4298
4300
  axes : str , optional
4299
4301
  Sets what axes are to be used for exploding the topology. This can be any permutation or substring of "xyz". It is not case sensitive. The default is "xyz".
4302
+ transferDictionaries : bool , optional
4303
+ If set to True, the dictionaries of the original subTopologies are transferred to the exploded topologies. Otherwise, they are not. The default is False.
4300
4304
  mantissa : int , optional
4301
4305
  The desired length of the mantissa. The default is 6.
4302
4306
  tolerance : float , optional
@@ -4311,6 +4315,7 @@ class Topology():
4311
4315
  from topologicpy.Vertex import Vertex
4312
4316
  from topologicpy.Cluster import Cluster
4313
4317
  from topologicpy.Graph import Graph
4318
+ from topologicpy.Dictionary import Dictionary
4314
4319
 
4315
4320
  def processClusterTypeFilter(cluster):
4316
4321
  if len(Cluster.CellComplexes(cluster)) > 0:
@@ -4365,7 +4370,7 @@ class Topology():
4365
4370
  return None
4366
4371
  if Topology.IsInstance(topology, "Topology"):
4367
4372
  # Hack to fix a weird bug that seems to be a problem with OCCT memory handling.
4368
- topology = Topology.ByBREPString(Topology.BREPString(topology))
4373
+ topology = Topology.ByJSONString(Topology.JSONString([topology]))[0]
4369
4374
  axes = axes.lower()
4370
4375
  x_flag = "x" in axes
4371
4376
  y_flag = "y" in axes
@@ -4403,7 +4408,10 @@ class Topology():
4403
4408
  xT = newX - oldX
4404
4409
  yT = newY - oldY
4405
4410
  zT = newZ - oldZ
4406
- newTopology = Topology.Translate(aTopology, xT, yT, zT)
4411
+ newTopology = Topology.Copy(aTopology)
4412
+ newTopology = Topology.Translate(newTopology, xT, yT, zT)
4413
+ if transferDictionaries == True:
4414
+ newTopology = Topology.SetDictionary(newTopology, Topology.Dictionary(aTopology))
4407
4415
  newTopologies.append(newTopology)
4408
4416
  return Cluster.ByTopologies(newTopologies)
4409
4417
 
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.60'
1
+ __version__ = '0.7.61'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.60
3
+ Version: 0.7.61
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
  License: MIT License
@@ -23,14 +23,14 @@ topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
23
23
  topologicpy/Shell.py,sha256=joahFtpRQTWJpQOmi3qU4Xe0Sx2XXeayHlXTNx8CzMk,87610
24
24
  topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
25
25
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
26
- topologicpy/Topology.py,sha256=cFYSb93kxqcsdGLdeVcdE9td-KZ9X967sEn98NQAYfM,397243
26
+ topologicpy/Topology.py,sha256=5Vnn9oMEQ__ta_ew9XhnZExMPbHsj9QN91v-6pxdrJg,397934
27
27
  topologicpy/Vector.py,sha256=A1g83zDHep58iVPY8WQ8iHNrSOfGWFEzvVeDuMnjDNY,33078
28
28
  topologicpy/Vertex.py,sha256=bLY60YWoMsgCgHk7F7k9F93Sq2FJ6AzUcTfJ83NZfHA,71107
29
29
  topologicpy/Wire.py,sha256=rGLAwjd5p80rxvkOkcrE1MPXkU9oZ1iRK7n_wOTLbd0,162382
30
30
  topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
31
- topologicpy/version.py,sha256=OPMe-rPXSkz9Cu9DTdHOcBcmqfzAZp01-uadL4eOXFY,23
32
- topologicpy-0.7.60.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
33
- topologicpy-0.7.60.dist-info/METADATA,sha256=zVoxaGqEvSXMGH8W2SJlq4eqAF7XCCZDWEDTjPSSNhw,10918
34
- topologicpy-0.7.60.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
35
- topologicpy-0.7.60.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
- topologicpy-0.7.60.dist-info/RECORD,,
31
+ topologicpy/version.py,sha256=tiB10UwHe_W_etMVnPuXlVWgr8S2BBgwOuFocOXK4Nk,23
32
+ topologicpy-0.7.61.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
33
+ topologicpy-0.7.61.dist-info/METADATA,sha256=Dcv499yRgltilHs2CTCeo3Ktv7lA4HOZWL8wsVT5Tpg,10918
34
+ topologicpy-0.7.61.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
35
+ topologicpy-0.7.61.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
+ topologicpy-0.7.61.dist-info/RECORD,,