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/Wire.py CHANGED
@@ -310,7 +310,7 @@ class Wire():
310
310
  return Wire.ByEdges(edges, tolerance=tolerance)
311
311
 
312
312
  @staticmethod
313
- def ByOffset(wire, 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, numWorkers: int = None):
313
+ def ByOffset(wire, 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):
314
314
  """
315
315
  Creates an offset wire from the input wire. A positive offset value results in an offset to the interior of an anti-clockwise wire.
316
316
 
@@ -336,6 +336,8 @@ class Wire():
336
336
  If set to True, The bisectors (seams) edges will be included in the returned wire. The default is False.
337
337
  transferDictionaries : bool , optional
338
338
  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.
339
+ epsilon : float , optional
340
+ 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)
339
341
  tolerance : float , optional
340
342
  The desired tolerance. The default is 0.0001.
341
343
  silent : bool , optional
@@ -361,34 +363,6 @@ class Wire():
361
363
  from topologicpy.Vector import Vector
362
364
  from topologicpy.Helper import Helper
363
365
 
364
- def transfer_dictionaries_by_selectors(object, selectors, tranVertices=False, tranEdges=False, tranFaces=True, tolerance=0.0001):
365
- if tranVertices == True:
366
- vertices = Topology.Vertices(object)
367
- for vertex in vertices:
368
- for selector in selectors:
369
- d = Vertex.Distance(selector, vertex)
370
- if d < tolerance:
371
- vertex = Topology.SetDictionary(vertex, Topology.Dictionary(selector), silent=True)
372
- break
373
- if tranEdges == True:
374
- edges = Topology.Edges(object)
375
- for edge in edges:
376
- for selector in selectors:
377
- d = Vertex.Distance(selector, edge)
378
- if d < tolerance:
379
- edge = Topology.SetDictionary(edge, Topology.Dictionary(selector), silent=True)
380
- break
381
-
382
- if tranFaces == True:
383
- faces = Topology.Faces(object)
384
- for face in faces:
385
- for selector in selectors:
386
- d = Vertex.Distance(selector, face)
387
- if d < tolerance:
388
- face = Topology.SetDictionary(face, Topology.Dictionary(selector), silent=True)
389
- break
390
- return object
391
-
392
366
  if not Topology.IsInstance(wire, "Wire"):
393
367
  if not silent:
394
368
  print("Wire.ByOffset - Error: The input wire parameter is not a valid wire. Returning None.")
@@ -519,19 +493,23 @@ class Wire():
519
493
  bisectors_list.append(Edge.ByVertices(v_a, v1))
520
494
 
521
495
 
522
- wire_edges = []
523
- for i in range(len(final_vertices)-1):
524
- v1 = final_vertices[i]
525
- v2 = final_vertices[i+1]
526
- wire_edges.append(Edge.ByVertices(v1,v2))
527
- if Wire.IsClosed(wire):
528
- v1 = final_vertices[-1]
529
- v2 = final_vertices[0]
530
- wire_edges.append(Edge.ByVertices(v1,v2))
496
+ # wire_edges = []
497
+ # for i in range(len(final_vertices)-1):
498
+ # v1 = final_vertices[i]
499
+ # v2 = final_vertices[i+1]
500
+ # w_e = Edge.ByVertices(v1,v2)
501
+ # #w_e = Edge.SetLength(w_e, Edge.Length(w_e)+(2*epsilon), bothSides = True)
502
+ # wire_edges.append(w_e)
503
+ # if Wire.IsClosed(wire):
504
+ # v1 = final_vertices[-1]
505
+ # v2 = final_vertices[0]
506
+ # #w_e = Edge.SetLength(w_e, Edge.Length(w_e)+(2*epsilon), bothSides = True)
507
+ # wire_edges.append(w_e)
531
508
 
532
509
  return_wire = Wire.ByVertices(final_vertices, close=Wire.IsClosed(wire))
510
+ #wire_edges = Topology.Edges(wire_edges)
511
+ wire_edges = [Edge.SetLength(w_e, Edge.Length(w_e)+(2*epsilon), bothSides=True) for w_e in Topology.Edges(return_wire)]
533
512
  return_wire_edges = Topology.Edges(return_wire)
534
- #wire_edges = Topology.Edges(return_wire)
535
513
  if transferDictionaries == True:
536
514
  if not len(wire_edges) == len(edge_dictionaries):
537
515
  if not silent:
@@ -553,7 +531,7 @@ class Wire():
553
531
  for edge in edges:
554
532
  d = Topology.Dictionary(edge)
555
533
  c = Topology.Centroid(edge)
556
- c = Topology.SetDictionary(c, d)
534
+ c = Topology.SetDictionary(c, d, silent=True)
557
535
  sel_edges.append(c)
558
536
  temp_return_wire = Topology.TransferDictionariesBySelectors(temp_return_wire, sel_vertices, tranVertices=True, numWorkers=numWorkers)
559
537
  temp_return_wire = Topology.TransferDictionariesBySelectors(temp_return_wire, sel_edges, tranEdges=True, numWorkers=numWorkers)
@@ -567,25 +545,31 @@ class Wire():
567
545
  if not Wire.IsManifold(return_wire) and bisectors == False:
568
546
  if not silent:
569
547
  print("Wire.ByOffset - Warning: The resulting wire is non-manifold, please check your offsets.")
570
- print("Pursuing a workaround, but it will take a LONG time.")
571
- cycles = Wire.Cycles(return_wire, maxVertices = len(final_vertices))
548
+ print("Wire.ByOffset - Warning: Pursuing a workaround, but it might take a longer to complete.")
549
+
550
+ #cycles = Wire.Cycles(return_wire, maxVertices = len(final_vertices))
551
+ temp_wire = Topology.SelfMerge(Cluster.ByTopologies(wire_edges))
552
+ cycles = Wire.Cycles(temp_wire, maxVertices = len(final_vertices))
572
553
  distances = []
573
554
  for cycle in cycles:
574
- #cycle_face = Face.ByWire(cycle)
575
555
  cycle_centroid = Topology.Centroid(cycle)
576
556
  distance = Vertex.Distance(origin, cycle_centroid)
577
557
  distances.append(distance)
578
558
  cycles = Helper.Sort(cycles, distances)
579
- return_cycle = Wire.Reverse(cycles[0])
559
+ # Get the top three or less
560
+ cycles = cycles[:min(3, len(cycles))]
561
+ areas = [Face.Area(Face.ByWire(cycle)) for cycle in cycles]
562
+ cycles = Helper.Sort(cycles, areas)
563
+ return_cycle = Wire.Reverse(cycles[-1])
564
+ return_cycle = Wire.Simplify(return_cycle, tolerance=epsilon)
565
+ return_cycle = Wire.RemoveCollinearEdges(return_cycle)
580
566
  sel_edges = []
581
567
  for temp_edge in wire_edges:
582
568
  x = Topology.Centroid(temp_edge)
583
569
  d = Topology.Dictionary(temp_edge)
584
- x = Topology.SetDictionary(x, d)
570
+ x = Topology.SetDictionary(x, d, silent=True)
585
571
  sel_edges.append(x)
586
- print("Transfering Vertex Dictionaries")
587
572
  return_cycle = Topology.TransferDictionariesBySelectors(return_cycle, Topology.Vertices(return_wire), tranVertices=True, tolerance=tolerance, numWorkers=numWorkers)
588
- print("Transfering Edge Dictionaries")
589
573
  return_cycle = Topology.TransferDictionariesBySelectors(return_cycle, sel_edges, tranEdges=True, tolerance=tolerance, numWorkers=numWorkers)
590
574
  return_wire = return_cycle
591
575
  return_wire = Topology.Unflatten(return_wire, direction=normal, origin=origin)
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.52'
1
+ __version__ = '0.7.55'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.52
3
+ Version: 0.7.55
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
@@ -1,35 +1,35 @@
1
1
  topologicpy/ANN.py,sha256=XAuUjNvDRK1hhXfo82S-zXmnAPZGEdHJMRdfpu0aJ8I,47901
2
2
  topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
3
- topologicpy/Cell.py,sha256=uZ1gNVlfVtpi6sNgyfazP_nqe7mPjarE7MYzf8KoEI4,107930
4
- topologicpy/CellComplex.py,sha256=x474N-lo1krpdIGrWRAFRdDup5a_1V-mLORTS6ZGZ7M,48227
3
+ topologicpy/Cell.py,sha256=_vEYx1kNc3JZJUCCS8nhLM_j8EV4SyZYt3DjNHNRoDw,107707
4
+ topologicpy/CellComplex.py,sha256=YNmNkH6IUplM9f7agZQd6IL2xnHf5ds3JkGQk4jiSXQ,48029
5
5
  topologicpy/Cluster.py,sha256=TZXuxzdaUr6OHSWnjWpjCOMlVj6YHBH8aUVbDVsncVA,54999
6
6
  topologicpy/Color.py,sha256=FrxX2yILqWvYrqD8kBaknfMfOR_phJOmhvTvFc07bY4,18065
7
7
  topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
8
8
  topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
9
9
  topologicpy/Dictionary.py,sha256=X_WARSYtWtYIsEUKdLH-plZmGZ3pHz_FBFxxeHGHdrU,27065
10
10
  topologicpy/Edge.py,sha256=vhYHkobSLGSWV-oe2oJFFDobqFToDyb7s71yQ840AAA,65166
11
- topologicpy/EnergyModel.py,sha256=XcCP55VW5WHDIIKcURijmBOZEgNUDEn_V9h5EejkntA,53876
12
- topologicpy/Face.py,sha256=7GCYo4ATkMW1skiv4gXOVARM29A7Buim9lTQu57B22Y,115489
13
- topologicpy/Graph.py,sha256=capDrtqrvNSyivrcRnHDIEGgO43ZxjqykeFiGBV3GIA,402880
11
+ topologicpy/EnergyModel.py,sha256=NM3_nAdY9_YDtbp9CaEZ0x0xVsetTqVDzm_VSjmq_mI,53746
12
+ topologicpy/Face.py,sha256=YjU6TxxW2Mf5InumMvzXUXVVRdtjxyRGauRIhGXzkao,116411
13
+ topologicpy/Graph.py,sha256=9Z9CcOKs6dEX8c_c5wNisCXz71o9SHNJjRewIJhXyYY,407337
14
14
  topologicpy/Grid.py,sha256=3-sn7CHWGcXk18XCnHjsUttNJTWwmN63g_Insj__p04,18218
15
15
  topologicpy/Helper.py,sha256=i-AfI29NMsZXBaymjilfvxQbuS3wpYbpPw4RWu1YCHs,16358
16
- topologicpy/Honeybee.py,sha256=vcBECJlgWVjNNdD9ZmjNik_pA1Y_ZNoOorsQb2CiyGA,21965
16
+ topologicpy/Honeybee.py,sha256=Oc8mfGBNSjs6wxkPzCKmEw1ZPQPbp9XtiYWaAF62oSk,21893
17
17
  topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
18
18
  topologicpy/Neo4j.py,sha256=YvtF7RYUMATEZ8iHwFwK_MOxEDyARby2DTI2CCK6-cI,19694
19
19
  topologicpy/Plotly.py,sha256=Aaq6D9D7gov5OrfoKLs_j3LJfdkCC-Gh8GaU5n2UOGQ,106199
20
20
  topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
21
- topologicpy/PyG.py,sha256=3U59QObO56EBwrvaplGeLZhbTao0gJCYhWm3oTpjFAE,109505
21
+ topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
22
22
  topologicpy/Shell.py,sha256=joahFtpRQTWJpQOmi3qU4Xe0Sx2XXeayHlXTNx8CzMk,87610
23
23
  topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
24
24
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
25
- topologicpy/Topology.py,sha256=ZhfTwA-qwgISDJftRVB1l5DdbfI4fMBJ0kNbH2WFQMs,419038
25
+ topologicpy/Topology.py,sha256=jTff8K144q4sccF93u8lrLqsH5r5ar5w40zPcmKgm0I,396181
26
26
  topologicpy/Vector.py,sha256=WQQUbwrg7VKImtxuBUi2i-FRiPT77WlrzLP05gdXKM8,33079
27
27
  topologicpy/Vertex.py,sha256=bLY60YWoMsgCgHk7F7k9F93Sq2FJ6AzUcTfJ83NZfHA,71107
28
- topologicpy/Wire.py,sha256=POd3_jjSXsLV6OiH6PvGZvA3AS5OpesDI5Fahn59daI,158034
28
+ topologicpy/Wire.py,sha256=OoPb7SJl0VpZDZpGL0-VkYJ35zPANS7gHDt9tixOSxc,157629
29
29
  topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
30
- topologicpy/version.py,sha256=ojid7jrMog3tWPPKrqrquVx5_TXLYp_7tfVq6IeQYaE,23
31
- topologicpy-0.7.52.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
32
- topologicpy-0.7.52.dist-info/METADATA,sha256=q3XykClIfWtok_A1P6zYFpjyA4yHUJGNhcStZyOjAeM,10918
33
- topologicpy-0.7.52.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
34
- topologicpy-0.7.52.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
35
- topologicpy-0.7.52.dist-info/RECORD,,
30
+ topologicpy/version.py,sha256=b_I7_IXt6uGE8ue8BEvPvKIjd7UYGeEWViFo27eHLTU,23
31
+ topologicpy-0.7.55.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
32
+ topologicpy-0.7.55.dist-info/METADATA,sha256=8ncvYbt2xWCSKgI812zK0XWYU1MSwQwh6ihMNXi3ALs,10918
33
+ topologicpy-0.7.55.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
34
+ topologicpy-0.7.55.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
35
+ topologicpy-0.7.55.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5