topologicpy 0.7.40__py3-none-any.whl → 0.7.42__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/Face.py CHANGED
@@ -323,7 +323,10 @@ class Face():
323
323
  print("Face.ByOffset - Warning: The input face parameter is not a valid face. Returning None.")
324
324
  return None
325
325
 
326
+ if abs(Face.Normal(face)[2] + 1) < tolerance:
327
+ reverse = not(reverse)
326
328
  eb = Face.Wire(face)
329
+
327
330
  internal_boundaries = Face.InternalBoundaries(face)
328
331
  offset_external_boundary = Wire.ByOffset(eb,
329
332
  offset=offset,
topologicpy/Topology.py CHANGED
@@ -2138,7 +2138,7 @@ class Topology():
2138
2138
  return Topology.ByDXFFile(file, sides=sides)
2139
2139
 
2140
2140
  @staticmethod
2141
- def ByIFCFile(file, transferDictionaries=False, includeTypes=[], excludeTypes=[]):
2141
+ def ByIFCFile(file, includeTypes=[], excludeTypes=[], transferDictionaries=False, removeCoplanarFaces=False):
2142
2142
  """
2143
2143
  Create a topology by importing it from an IFC file.
2144
2144
 
@@ -2146,13 +2146,14 @@ class Topology():
2146
2146
  ----------
2147
2147
  file : file object
2148
2148
  The input IFC file.
2149
- transferDictionaries : bool , optional
2150
- If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
2151
2149
  includeTypes : list , optional
2152
2150
  The list of IFC object types to include. It is case insensitive. If set to an empty list, all types are included. The default is [].
2153
2151
  excludeTypes : list , optional
2154
2152
  The list of IFC object types to exclude. It is case insensitive. If set to an empty list, no types are excluded. The default is [].
2155
-
2153
+ transferDictionaries : bool , optional
2154
+ If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
2155
+ removeCoplanarFaces : bool , optional
2156
+ If set to True, coplanar faces are removed. Otherwise they are not. The default is False.
2156
2157
  Returns
2157
2158
  -------
2158
2159
  list
@@ -2187,19 +2188,25 @@ class Topology():
2187
2188
  excludeTypes = [s.lower() for s in excludeTypes]
2188
2189
  topologies = []
2189
2190
  settings = ifcopenshell.geom.settings()
2190
- settings.set(settings.DISABLE_TRIANGULATION, True)
2191
- settings.set(settings.USE_BREP_DATA, True)
2191
+ settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
2192
2192
  settings.set(settings.USE_WORLD_COORDS, True)
2193
- settings.set(settings.SEW_SHELLS, True)
2194
2193
  iterator = ifcopenshell.geom.iterator(settings, file, multiprocessing.cpu_count())
2195
2194
  if iterator.initialize():
2196
2195
  while True:
2197
2196
  shape = iterator.get()
2198
2197
  is_a = shape.type.lower()
2199
- if (is_a in includeTypes or len(includeTypes) == 0) and (not is_a in excludeTypes):
2198
+ if (is_a in includeTypes or len(includeTypes) == 0) and (not is_a in excludeTypes):
2200
2199
  try:
2201
- brep = shape.geometry.brep_data
2202
- topology = Topology.SelfMerge(Topology.ByBREPString(brep))
2200
+ verts = shape.geometry.verts
2201
+ edges = shape.geometry.edges
2202
+ faces = shape.geometry.faces
2203
+ grouped_verts = [ [verts[i], verts[i + 1], verts[i + 2]] for i in range(0, len(verts), 3)]
2204
+ grouped_edges = [[edges[i], edges[i + 1]] for i in range(0, len(edges), 2)]
2205
+ grouped_faces = [ [faces[i], faces[i + 1], faces[i + 2]] for i in range(0, len(faces), 3)]
2206
+ topology = Topology.ByGeometry(grouped_verts, grouped_edges, grouped_faces)
2207
+ if removeCoplanarFaces:
2208
+ topology = Topology.RemoveCoplanarFaces(topology)
2209
+ topologies.append(topology)
2203
2210
  if transferDictionaries:
2204
2211
  keys = []
2205
2212
  values = []
@@ -2231,7 +2238,7 @@ class Topology():
2231
2238
  return topologies
2232
2239
 
2233
2240
  @staticmethod
2234
- def ByIFCPath(path, transferDictionaries=False, includeTypes=[], excludeTypes=[]):
2241
+ def ByIFCPath(path, includeTypes=[], excludeTypes=[], transferDictionaries=False, removeCoplanarFaces=False):
2235
2242
  """
2236
2243
  Create a topology by importing it from an IFC file path.
2237
2244
 
@@ -2239,12 +2246,14 @@ class Topology():
2239
2246
  ----------
2240
2247
  path : str
2241
2248
  The path to the IFC file.
2242
- transferDictionaries : bool , optional
2243
- If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
2244
2249
  includeTypes : list , optional
2245
2250
  The list of IFC object types to include. It is case insensitive. If set to an empty list, all types are included. The default is [].
2246
2251
  excludeTypes : list , optional
2247
2252
  The list of IFC object types to exclude. It is case insensitive. If set to an empty list, no types are excluded. The default is [].
2253
+ transferDictionaries : bool , optional
2254
+ If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
2255
+ removeCoplanarFaces : bool , optional
2256
+ If set to True, coplanar faces are removed. Otherwise they are not. The default is False.
2248
2257
 
2249
2258
  Returns
2250
2259
  -------
@@ -2264,7 +2273,7 @@ class Topology():
2264
2273
  if not file:
2265
2274
  print("Topology.ByIFCPath - Error: the input file parameter is not a valid file. Returning None.")
2266
2275
  return None
2267
- return Topology.ByIFCFile(file, transferDictionaries=transferDictionaries, includeTypes=includeTypes, excludeTypes=excludeTypes)
2276
+ return Topology.ByIFCFile(file, includeTypes=includeTypes, excludeTypes=excludeTypes, transferDictionaries=transferDictionaries, removeCoplanarFaces=removeCoplanarFaces)
2268
2277
 
2269
2278
  '''
2270
2279
  @staticmethod
topologicpy/Wire.py CHANGED
@@ -365,7 +365,7 @@ class Wire():
365
365
  fac = -1
366
366
  else:
367
367
  fac = 1
368
- origin = Vertex.Origin()
368
+ origin = Topology.Centroid(wire)
369
369
  temp_vertices = [Topology.Vertices(wire)[0], Topology.Vertices(wire)[1], Topology.Centroid(wire)]
370
370
  temp_face = Face.ByWire(Wire.ByVertices(temp_vertices, close=True))
371
371
  temp_normal = Face.Normal(temp_face)
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.40'
1
+ __version__ = '0.7.42'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.40
3
+ Version: 0.7.42
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
@@ -9,7 +9,7 @@ topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
9
9
  topologicpy/Dictionary.py,sha256=KqJ29YyE23Y3Xc6XmKLSCZXRfBvm-OEOxlMZ4dt-rfM,27094
10
10
  topologicpy/Edge.py,sha256=vhYHkobSLGSWV-oe2oJFFDobqFToDyb7s71yQ840AAA,65166
11
11
  topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
12
- topologicpy/Face.py,sha256=tY7H4OJDJeW1Lz2xk8-Jb67IUunPN7M0Y70-2DEOKFc,115278
12
+ topologicpy/Face.py,sha256=d1Im4ogxuaVmZyb6hgv5muwQwahLtGzOar_a3og1a_I,115376
13
13
  topologicpy/Graph.py,sha256=p3VoVH6yygNV2wwzpsi4tm6yOfwRbtmsbnsAu2opLjQ,393517
14
14
  topologicpy/Grid.py,sha256=3-sn7CHWGcXk18XCnHjsUttNJTWwmN63g_Insj__p04,18218
15
15
  topologicpy/Helper.py,sha256=i-AfI29NMsZXBaymjilfvxQbuS3wpYbpPw4RWu1YCHs,16358
@@ -22,14 +22,14 @@ topologicpy/PyG.py,sha256=mDEYYGKv-q1B7GI_J7b3pAbJhF0hqMnITZNMzhHycg4,96097
22
22
  topologicpy/Shell.py,sha256=etLWt2VsKOYE-2N0InKdQxLDHEZWsp59DeToSggrjF0,79914
23
23
  topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
24
24
  topologicpy/Sun.py,sha256=InnKtX8eKwtAgcScuABH6yp0ljmWh5m_fDR4-n3jJMY,36869
25
- topologicpy/Topology.py,sha256=vmRjJDN-d0DzYK4IS0XaVeJh_nRs0BJQ6O7FzFjsoFk,365074
25
+ topologicpy/Topology.py,sha256=5KGQ8jSiURMk9syoMLc3mrIONCfj_pfvCfHTKgPcLOM,366047
26
26
  topologicpy/Vector.py,sha256=WQQUbwrg7VKImtxuBUi2i-FRiPT77WlrzLP05gdXKM8,33079
27
27
  topologicpy/Vertex.py,sha256=EQdVYHmW85_pZdHZB3N8pEi0GiadCCkF3z_oqohA7B0,71161
28
- topologicpy/Wire.py,sha256=bYH4BhGkJMqqTokkNO_cbywHZXWU01002Yc_fp_VUD4,153524
28
+ topologicpy/Wire.py,sha256=9EJE0Iq3nGz5X7Suy6xxjmuOpfV49By6WH98UAL_7m4,153532
29
29
  topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
30
- topologicpy/version.py,sha256=JoIlIhbYajAnUZCjcOyYnv07ExEn_Cn1mAgJwjG2uuI,23
31
- topologicpy-0.7.40.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
32
- topologicpy-0.7.40.dist-info/METADATA,sha256=n097KO8cPKlOVLFXQNaM4a78smH3ciTgouacxirO9qI,10916
33
- topologicpy-0.7.40.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
34
- topologicpy-0.7.40.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
35
- topologicpy-0.7.40.dist-info/RECORD,,
30
+ topologicpy/version.py,sha256=UWZPE9jgOKgWiu1NjdF3GjtgYjFTqvDvq_t-y5kjb-s,23
31
+ topologicpy-0.7.42.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
32
+ topologicpy-0.7.42.dist-info/METADATA,sha256=NSPc5BzWU_sOnE--u-EnHbDLze91ki3OV6LRtAyEc1k,10916
33
+ topologicpy-0.7.42.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
34
+ topologicpy-0.7.42.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
35
+ topologicpy-0.7.42.dist-info/RECORD,,