topologicpy 0.7.21__py3-none-any.whl → 0.7.22__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/ANN.py +3 -6
- topologicpy/Cell.py +5 -3
- topologicpy/Cluster.py +0 -4
- topologicpy/DGL.py +1 -9
- topologicpy/Dictionary.py +24 -13
- topologicpy/Edge.py +0 -6
- topologicpy/Face.py +35 -26
- topologicpy/Graph.py +2 -19
- topologicpy/Grid.py +0 -1
- topologicpy/Helper.py +0 -2
- topologicpy/Honeybee.py +27 -2
- topologicpy/Plotly.py +0 -1
- topologicpy/Polyskel.py +0 -21
- topologicpy/Shell.py +2 -4
- topologicpy/Sun.py +14 -5
- topologicpy/Topology.py +372 -179
- topologicpy/Vector.py +21 -13
- topologicpy/Vertex.py +8 -5
- topologicpy/Wire.py +53 -35
- topologicpy/version.py +1 -1
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.22.dist-info}/METADATA +1 -1
- topologicpy-0.7.22.dist-info/RECORD +34 -0
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.22.dist-info}/WHEEL +1 -1
- topologicpy-0.7.21.dist-info/RECORD +0 -34
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.22.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.22.dist-info}/top_level.txt +0 -0
topologicpy/Vector.py
CHANGED
@@ -104,6 +104,7 @@ class Vector(list):
|
|
104
104
|
-------
|
105
105
|
list
|
106
106
|
The average vector of the input list of vectors.
|
107
|
+
|
107
108
|
"""
|
108
109
|
if not isinstance(vectors, list):
|
109
110
|
print("Vector.Average - Error: The input vectors parameter is not a valid list. Returning None.")
|
@@ -188,7 +189,6 @@ class Vector(list):
|
|
188
189
|
"""
|
189
190
|
import numpy as np
|
190
191
|
|
191
|
-
|
192
192
|
# Ensure vectors are numpy arrays
|
193
193
|
vector1 = np.array(vectorA)
|
194
194
|
vector2 = np.array(vectorB)
|
@@ -288,7 +288,6 @@ class Vector(list):
|
|
288
288
|
The created vector.
|
289
289
|
|
290
290
|
"""
|
291
|
-
|
292
291
|
from topologicpy.Vertex import Vertex
|
293
292
|
from topologicpy.Topology import Topology
|
294
293
|
|
@@ -448,6 +447,7 @@ class Vector(list):
|
|
448
447
|
-------
|
449
448
|
list
|
450
449
|
The vector representing the *down* direction.
|
450
|
+
|
451
451
|
"""
|
452
452
|
return [0, 0, -1]
|
453
453
|
|
@@ -460,6 +460,7 @@ class Vector(list):
|
|
460
460
|
-------
|
461
461
|
list
|
462
462
|
The vector representing the *east* direction.
|
463
|
+
|
463
464
|
"""
|
464
465
|
return [1, 0, 0]
|
465
466
|
|
@@ -483,7 +484,6 @@ class Vector(list):
|
|
483
484
|
"""
|
484
485
|
import numpy as np
|
485
486
|
|
486
|
-
|
487
487
|
# Ensure vectors are numpy arrays
|
488
488
|
vector1 = np.array(vectorA)
|
489
489
|
vector2 = np.array(vectorB)
|
@@ -520,7 +520,6 @@ class Vector(list):
|
|
520
520
|
"""
|
521
521
|
import numpy as np
|
522
522
|
|
523
|
-
|
524
523
|
# Ensure vectors are numpy arrays
|
525
524
|
vector1 = np.array(vectorA)
|
526
525
|
vector2 = np.array(vectorB)
|
@@ -557,7 +556,6 @@ class Vector(list):
|
|
557
556
|
"""
|
558
557
|
import numpy as np
|
559
558
|
|
560
|
-
|
561
559
|
# Ensure vectors are numpy arrays
|
562
560
|
vector1 = np.array(vectorA)
|
563
561
|
vector2 = np.array(vectorB)
|
@@ -593,7 +591,6 @@ class Vector(list):
|
|
593
591
|
"""
|
594
592
|
import numpy as np
|
595
593
|
|
596
|
-
|
597
594
|
# Ensure vectors are numpy arrays
|
598
595
|
vector1 = np.array(vectorA)
|
599
596
|
vector2 = np.array(vectorB)
|
@@ -648,8 +645,8 @@ class Vector(list):
|
|
648
645
|
-------
|
649
646
|
float
|
650
647
|
The length of the input vector.
|
648
|
+
|
651
649
|
"""
|
652
|
-
|
653
650
|
return Vector.Magnitude(vector, mantissa = mantissa)
|
654
651
|
|
655
652
|
@staticmethod
|
@@ -668,8 +665,8 @@ class Vector(list):
|
|
668
665
|
-------
|
669
666
|
float
|
670
667
|
The magnitude of the input vector.
|
668
|
+
|
671
669
|
"""
|
672
|
-
|
673
670
|
return round(np.linalg.norm(np.array(vector)), mantissa)
|
674
671
|
|
675
672
|
@staticmethod
|
@@ -697,7 +694,6 @@ class Vector(list):
|
|
697
694
|
scaled_vector = [component * (magnitude) for component in vector]
|
698
695
|
return scaled_vector
|
699
696
|
|
700
|
-
|
701
697
|
@staticmethod
|
702
698
|
def Normalize(vector):
|
703
699
|
"""
|
@@ -712,8 +708,8 @@ class Vector(list):
|
|
712
708
|
-------
|
713
709
|
list
|
714
710
|
The normalized vector.
|
711
|
+
|
715
712
|
"""
|
716
|
-
|
717
713
|
return list(vector / np.linalg.norm(vector))
|
718
714
|
|
719
715
|
@staticmethod
|
@@ -725,6 +721,7 @@ class Vector(list):
|
|
725
721
|
-------
|
726
722
|
list
|
727
723
|
The vector representing the *north* direction.
|
724
|
+
|
728
725
|
"""
|
729
726
|
return [0, 1, 0]
|
730
727
|
|
@@ -737,6 +734,7 @@ class Vector(list):
|
|
737
734
|
-------
|
738
735
|
list
|
739
736
|
The vector representing the *northeast* direction.
|
737
|
+
|
740
738
|
"""
|
741
739
|
return [1, 1, 0]
|
742
740
|
|
@@ -749,6 +747,7 @@ class Vector(list):
|
|
749
747
|
-------
|
750
748
|
list
|
751
749
|
The vector representing the *northwest* direction.
|
750
|
+
|
752
751
|
"""
|
753
752
|
return [-1, 1, 0]
|
754
753
|
|
@@ -766,6 +765,7 @@ class Vector(list):
|
|
766
765
|
-------
|
767
766
|
list
|
768
767
|
The normalized vector.
|
768
|
+
|
769
769
|
"""
|
770
770
|
if not isinstance(vector, list):
|
771
771
|
return None
|
@@ -787,6 +787,7 @@ class Vector(list):
|
|
787
787
|
-------
|
788
788
|
list
|
789
789
|
The created vector.
|
790
|
+
|
790
791
|
"""
|
791
792
|
return (Vector.Multiply(vector=Vector.Normalize(vector), magnitude=magnitude))
|
792
793
|
|
@@ -799,6 +800,7 @@ class Vector(list):
|
|
799
800
|
-------
|
800
801
|
list
|
801
802
|
The vector representing the *south* direction.
|
803
|
+
|
802
804
|
"""
|
803
805
|
return [0, -1, 0]
|
804
806
|
|
@@ -811,6 +813,7 @@ class Vector(list):
|
|
811
813
|
-------
|
812
814
|
list
|
813
815
|
The vector representing the *southeast* direction.
|
816
|
+
|
814
817
|
"""
|
815
818
|
return [1, -1, 0]
|
816
819
|
|
@@ -823,6 +826,7 @@ class Vector(list):
|
|
823
826
|
-------
|
824
827
|
list
|
825
828
|
The vector representing the *southwest* direction.
|
829
|
+
|
826
830
|
"""
|
827
831
|
return [-1, -1, 0]
|
828
832
|
|
@@ -860,6 +864,7 @@ class Vector(list):
|
|
860
864
|
-------
|
861
865
|
list
|
862
866
|
The sum vector of the input list of vectors.
|
867
|
+
|
863
868
|
"""
|
864
869
|
if not isinstance(vectors, list):
|
865
870
|
print("Vector.Average - Error: The input vectors parameter is not a valid list. Returning None.")
|
@@ -898,12 +903,11 @@ class Vector(list):
|
|
898
903
|
-------
|
899
904
|
list
|
900
905
|
Transformation matrix that follows the Blender software convention (nested list)
|
906
|
+
|
901
907
|
"""
|
902
908
|
import numpy as np
|
903
909
|
from topologicpy.Matrix import Matrix
|
904
910
|
|
905
|
-
import numpy as np
|
906
|
-
|
907
911
|
def transformation_matrix(vec1, vec2, translation_vector=None):
|
908
912
|
"""
|
909
913
|
Compute a 4x4 transformation matrix that aligns vec1 to vec2.
|
@@ -946,7 +950,6 @@ class Vector(list):
|
|
946
950
|
|
947
951
|
return transformation_matrix
|
948
952
|
|
949
|
-
|
950
953
|
tran_mat = transformation_matrix(vectorA, vectorB)
|
951
954
|
|
952
955
|
return [list(tran_mat[0]), list(tran_mat[1]), list(tran_mat[2]), list(tran_mat[3])]
|
@@ -960,6 +963,7 @@ class Vector(list):
|
|
960
963
|
-------
|
961
964
|
list
|
962
965
|
The vector representing the "up" direction.
|
966
|
+
|
963
967
|
"""
|
964
968
|
return [0, 0, 1]
|
965
969
|
|
@@ -972,6 +976,7 @@ class Vector(list):
|
|
972
976
|
-------
|
973
977
|
list
|
974
978
|
The vector representing the *west* direction.
|
979
|
+
|
975
980
|
"""
|
976
981
|
return [-1, 0, 0]
|
977
982
|
|
@@ -984,6 +989,7 @@ class Vector(list):
|
|
984
989
|
-------
|
985
990
|
list
|
986
991
|
The vector representing the XAxis.
|
992
|
+
|
987
993
|
"""
|
988
994
|
return [1, 0, 0]
|
989
995
|
|
@@ -996,6 +1002,7 @@ class Vector(list):
|
|
996
1002
|
-------
|
997
1003
|
list
|
998
1004
|
The vector representing the YAxis.
|
1005
|
+
|
999
1006
|
"""
|
1000
1007
|
return [0, 1, 0]
|
1001
1008
|
|
@@ -1008,5 +1015,6 @@ class Vector(list):
|
|
1008
1015
|
-------
|
1009
1016
|
list
|
1010
1017
|
The vector representing the ZAxis.
|
1018
|
+
|
1011
1019
|
"""
|
1012
1020
|
return [0, 0, 1]
|
topologicpy/Vertex.py
CHANGED
@@ -57,7 +57,7 @@ class Vertex():
|
|
57
57
|
from topologicpy.Cluster import Cluster
|
58
58
|
from topologicpy.Topology import Topology
|
59
59
|
from topologicpy.Vector import Vector
|
60
|
-
|
60
|
+
|
61
61
|
def areCollinear(vertices, tolerance=0.0001):
|
62
62
|
point1 = Vertex.Coordinates(vertices[0], mantissa=mantissa)
|
63
63
|
point2 = Vertex.Coordinates(vertices[1], mantissa=mantissa)
|
@@ -164,6 +164,7 @@ class Vertex():
|
|
164
164
|
|
165
165
|
"""
|
166
166
|
from topologicpy.Topology import Topology
|
167
|
+
|
167
168
|
if not Topology.IsInstance(cluster, "Topology"):
|
168
169
|
return None
|
169
170
|
vertices = Topology.SubTopologies(cluster, subTopologyType="vertex")
|
@@ -208,6 +209,7 @@ class Vertex():
|
|
208
209
|
|
209
210
|
"""
|
210
211
|
from topologicpy.Topology import Topology
|
212
|
+
|
211
213
|
if not Topology.IsInstance(cluster, "Topology"):
|
212
214
|
return None
|
213
215
|
vertices = Topology.SubTopologies(cluster, subTopologyType="vertex")
|
@@ -238,6 +240,7 @@ class Vertex():
|
|
238
240
|
|
239
241
|
"""
|
240
242
|
import numbers
|
243
|
+
|
241
244
|
x = None
|
242
245
|
y = None
|
243
246
|
z = None
|
@@ -473,7 +476,6 @@ class Vertex():
|
|
473
476
|
superTopologies = Topology.SuperTopologies(topology=vertex, hostTopology=hostTopology, topologyType=topologyType)
|
474
477
|
return len(superTopologies)
|
475
478
|
|
476
|
-
|
477
479
|
@staticmethod
|
478
480
|
def Distance(vertex, topology, includeCentroid: bool =True, mantissa: int = 6) -> float:
|
479
481
|
"""
|
@@ -638,7 +640,6 @@ class Vertex():
|
|
638
640
|
The list of enclosing cells.
|
639
641
|
|
640
642
|
"""
|
641
|
-
from topologicpy.Cell import Cell
|
642
643
|
from topologicpy.Topology import Topology
|
643
644
|
|
644
645
|
def boundingBox(cell):
|
@@ -709,11 +710,12 @@ class Vertex():
|
|
709
710
|
tolerance : float , optional
|
710
711
|
The desired tolerance for computing if vertices need to be fused. Any vertices that are closer to each other than this tolerance will be fused. The default is 0.0001.
|
711
712
|
|
712
|
-
|
713
|
+
Returns
|
713
714
|
-------
|
714
715
|
list
|
715
716
|
The list of fused vertices. This list contains the same number of vertices and in the same order as the input list of vertices. However, the coordinates
|
716
717
|
of these vertices have now been modified so that they are exactly the same with other vertices that are within the tolerance distance.
|
718
|
+
|
717
719
|
"""
|
718
720
|
from topologicpy.Topology import Topology
|
719
721
|
import numpy as np
|
@@ -756,7 +758,6 @@ class Vertex():
|
|
756
758
|
decimals_list.append(int(coord_str.split('e')[1].replace('-','')))
|
757
759
|
return max(decimals_list)
|
758
760
|
|
759
|
-
|
760
761
|
if not isinstance(vertices, list):
|
761
762
|
print("Vertex.Fuse - Error: The input vertices parameter is not a valid list. Returning None.")
|
762
763
|
return None
|
@@ -832,6 +833,7 @@ class Vertex():
|
|
832
833
|
|
833
834
|
"""
|
834
835
|
from topologicpy.Topology import Topology
|
836
|
+
|
835
837
|
if not Topology.IsInstance(vertex, "Vertex"):
|
836
838
|
return None
|
837
839
|
if not isinstance(vertices, list):
|
@@ -1698,6 +1700,7 @@ class Vertex():
|
|
1698
1700
|
|
1699
1701
|
"""
|
1700
1702
|
from topologicpy.Topology import Topology
|
1703
|
+
|
1701
1704
|
if not Topology.IsInstance(vertex, "Vertex"):
|
1702
1705
|
return None
|
1703
1706
|
return round(vertex.Y(), mantissa)
|
topologicpy/Wire.py
CHANGED
@@ -48,7 +48,6 @@ class Wire(Topology):
|
|
48
48
|
The created arc.
|
49
49
|
|
50
50
|
"""
|
51
|
-
|
52
51
|
from topologicpy.Vertex import Vertex
|
53
52
|
from topologicpy.Face import Face
|
54
53
|
from topologicpy.Topology import Topology
|
@@ -174,7 +173,6 @@ class Wire(Topology):
|
|
174
173
|
from random import sample
|
175
174
|
import time
|
176
175
|
|
177
|
-
|
178
176
|
def br(topology):
|
179
177
|
vertices = []
|
180
178
|
_ = topology.Vertices(None, vertices)
|
@@ -192,7 +190,6 @@ class Wire(Topology):
|
|
192
190
|
if not Topology.IsInstance(topology, "Topology"):
|
193
191
|
return None
|
194
192
|
|
195
|
-
|
196
193
|
vertices = Topology.SubTopologies(topology=topology, subTopologyType="vertex")
|
197
194
|
if Vertex.AreCollinear(vertices, mantissa=mantissa, tolerance=tolerance):
|
198
195
|
print("Wire.BoundingRectangle - Error: All vertices of the input topology parameter are collinear and thus no bounding rectangle can be created. Returning None.")
|
@@ -375,7 +372,6 @@ class Wire(Topology):
|
|
375
372
|
from topologicpy.Face import Face
|
376
373
|
from topologicpy.Cluster import Cluster
|
377
374
|
from topologicpy.Topology import Topology
|
378
|
-
from topologicpy.Dictionary import Dictionary
|
379
375
|
from topologicpy.Vector import Vector
|
380
376
|
import math
|
381
377
|
|
@@ -619,8 +615,6 @@ class Wire(Topology):
|
|
619
615
|
|
620
616
|
"""
|
621
617
|
from topologicpy.Vertex import Vertex
|
622
|
-
from topologicpy.Edge import Edge
|
623
|
-
from topologicpy.Cluster import Cluster
|
624
618
|
from topologicpy.Topology import Topology
|
625
619
|
from topologicpy.Helper import Helper
|
626
620
|
|
@@ -687,10 +681,8 @@ class Wire(Topology):
|
|
687
681
|
from topologicpy.Vertex import Vertex
|
688
682
|
from topologicpy.Face import Face
|
689
683
|
from topologicpy.Topology import Topology
|
690
|
-
from topologicpy.Dictionary import Dictionary
|
691
684
|
from random import sample
|
692
685
|
|
693
|
-
|
694
686
|
def Left_index(points):
|
695
687
|
|
696
688
|
'''
|
@@ -987,7 +979,11 @@ class Wire(Topology):
|
|
987
979
|
v11 = Vertex.ByCoordinates(0, d)
|
988
980
|
v12 = Vertex.ByCoordinates(-radius*0.5, d)
|
989
981
|
v13 = Vertex.ByCoordinates(-cos(30)*d, sin(30)*d, 0)
|
990
|
-
|
982
|
+
vertices = [v1, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2]
|
983
|
+
# [v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13]
|
984
|
+
einstein = Wire.ByVertices(vertices, close=True)
|
985
|
+
|
986
|
+
einstein = Topology.Rotate(einstein, origin=origin, axis=[1,0,0], angle=180)
|
991
987
|
|
992
988
|
if placement.lower() == "lowerleft":
|
993
989
|
einstein = Topology.Translate(einstein, radius, d, 0)
|
@@ -1236,8 +1232,8 @@ class Wire(Topology):
|
|
1236
1232
|
-------
|
1237
1233
|
list
|
1238
1234
|
The list of exterior angles.
|
1239
|
-
|
1240
|
-
|
1235
|
+
|
1236
|
+
"""
|
1241
1237
|
if not Topology.IsInstance(wire, "Wire"):
|
1242
1238
|
print("Wire.InteriorAngles - Error: The input wire parameter is not a valid wire. Returning None")
|
1243
1239
|
return None
|
@@ -1429,6 +1425,7 @@ class Wire(Topology):
|
|
1429
1425
|
-------
|
1430
1426
|
list
|
1431
1427
|
The list of interior angles.
|
1428
|
+
|
1432
1429
|
"""
|
1433
1430
|
from topologicpy.Vertex import Vertex
|
1434
1431
|
from topologicpy.Edge import Edge
|
@@ -1495,7 +1492,7 @@ class Wire(Topology):
|
|
1495
1492
|
|
1496
1493
|
Returns
|
1497
1494
|
-------
|
1498
|
-
|
1495
|
+
topologic_core.Topology
|
1499
1496
|
The created interpolated wires as well as the input wires. The return type can be a topologic_core.Cluster or a topologic_core.Wire based on options.
|
1500
1497
|
|
1501
1498
|
"""
|
@@ -1647,9 +1644,10 @@ class Wire(Topology):
|
|
1647
1644
|
-------
|
1648
1645
|
bool
|
1649
1646
|
True if the input wire is manifold. False otherwise.
|
1647
|
+
|
1650
1648
|
"""
|
1651
|
-
|
1652
1649
|
from topologicpy.Vertex import Vertex
|
1650
|
+
|
1653
1651
|
if not Topology.IsInstance(wire, "Wire"):
|
1654
1652
|
print("Wire.IsManifold - Error: The input wire parameter is not a valid topologic wire. Returning None.")
|
1655
1653
|
return None
|
@@ -1780,6 +1778,7 @@ class Wire(Topology):
|
|
1780
1778
|
|
1781
1779
|
"""
|
1782
1780
|
from topologicpy.Edge import Edge
|
1781
|
+
|
1783
1782
|
if not wire:
|
1784
1783
|
return None
|
1785
1784
|
if not Topology.IsInstance(wire, "Wire"):
|
@@ -1822,8 +1821,8 @@ class Wire(Topology):
|
|
1822
1821
|
-------
|
1823
1822
|
topologic_core.Edge
|
1824
1823
|
The created edge
|
1824
|
+
|
1825
1825
|
"""
|
1826
|
-
|
1827
1826
|
from topologicpy.Vertex import Vertex
|
1828
1827
|
from topologicpy.Edge import Edge
|
1829
1828
|
from topologicpy.Vector import Vector
|
@@ -1984,8 +1983,11 @@ class Wire(Topology):
|
|
1984
1983
|
"""
|
1985
1984
|
from topologicpy.Topology import Topology
|
1986
1985
|
from topologicpy.Vertex import Vertex
|
1986
|
+
from random import sample
|
1987
|
+
import time
|
1987
1988
|
import os
|
1988
1989
|
import warnings
|
1990
|
+
|
1989
1991
|
try:
|
1990
1992
|
import numpy as np
|
1991
1993
|
except:
|
@@ -2006,7 +2008,18 @@ class Wire(Topology):
|
|
2006
2008
|
return None
|
2007
2009
|
|
2008
2010
|
vertices = Topology.Vertices(wire)
|
2009
|
-
|
2011
|
+
result = True
|
2012
|
+
start = time.time()
|
2013
|
+
period = 0
|
2014
|
+
while result and period < 30:
|
2015
|
+
vList = sample(vertices, 3)
|
2016
|
+
result = Vertex.AreCollinear(vList)
|
2017
|
+
end = time.time()
|
2018
|
+
period = end - start
|
2019
|
+
if result == True:
|
2020
|
+
print("Wire.BoundingRectangle - Error: Could not find three vertices that are not colinear within 30 seconds. Returning None.")
|
2021
|
+
return None
|
2022
|
+
vertices = [Vertex.Coordinates(v, mantissa=mantissa) for v in vList]
|
2010
2023
|
|
2011
2024
|
if len(vertices) < 3:
|
2012
2025
|
print("Wire.Normal - Error: At least three vertices are required to define a plane. Returning None.")
|
@@ -2201,6 +2214,7 @@ class Wire(Topology):
|
|
2201
2214
|
from topologicpy.Edge import Edge
|
2202
2215
|
from topologicpy.Face import Face
|
2203
2216
|
from topologicpy.Topology import Topology
|
2217
|
+
|
2204
2218
|
if not wire:
|
2205
2219
|
return None
|
2206
2220
|
if not Topology.IsInstance(wire, "Wire"):
|
@@ -2265,6 +2279,7 @@ class Wire(Topology):
|
|
2265
2279
|
"""
|
2266
2280
|
from topologicpy.Vertex import Vertex
|
2267
2281
|
from topologicpy.Topology import Topology
|
2282
|
+
|
2268
2283
|
if not Topology.IsInstance(origin, "Vertex"):
|
2269
2284
|
origin = Vertex.ByCoordinates(0, 0, 0)
|
2270
2285
|
if not Topology.IsInstance(origin, "Vertex"):
|
@@ -2525,6 +2540,9 @@ class Wire(Topology):
|
|
2525
2540
|
ib_polygonsxy.append(ib_polygonxy)
|
2526
2541
|
zero_coordinates += ib_polygon_coordinates
|
2527
2542
|
skeleton = Polyskel.skeletonize(eb_polygonxy, ib_polygonsxy)
|
2543
|
+
if len(skeleton) == 0:
|
2544
|
+
print("Wire.Roof - Error: The Polyskel.skeletonize 3rd party software failed to create a skeleton. Returning None.")
|
2545
|
+
return None
|
2528
2546
|
slope = math.tan(math.radians(angle))
|
2529
2547
|
roofEdges = subtrees_to_edges(skeleton, zero_coordinates, slope)
|
2530
2548
|
roofEdges = Helper.Flatten(roofEdges)+Topology.Edges(face)
|
@@ -2549,22 +2567,22 @@ class Wire(Topology):
|
|
2549
2567
|
@staticmethod
|
2550
2568
|
def Simplify(wire, tolerance=0.0001):
|
2551
2569
|
"""
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2570
|
+
Simplifies the input wire edges based on the Douglas Peucker algorthim. See https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
|
2571
|
+
Part of this code was contributed by gaoxipeng. See https://github.com/wassimj/topologicpy/issues/35
|
2572
|
+
|
2573
|
+
Parameters
|
2574
|
+
----------
|
2575
|
+
wire : topologic_core.Wire
|
2576
|
+
The input wire.
|
2577
|
+
tolerance : float , optional
|
2578
|
+
The desired tolerance. The default is 0.0001. Edges shorter than this length will be removed.
|
2561
2579
|
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
"""
|
2580
|
+
Returns
|
2581
|
+
-------
|
2582
|
+
topologic_core.Wire
|
2583
|
+
The simplified wire.
|
2567
2584
|
|
2585
|
+
"""
|
2568
2586
|
from topologicpy.Vertex import Vertex
|
2569
2587
|
from topologicpy.Edge import Edge
|
2570
2588
|
from topologicpy.Cluster import Cluster
|
@@ -2640,15 +2658,13 @@ class Wire(Topology):
|
|
2640
2658
|
@staticmethod
|
2641
2659
|
def Skeleton(face, tolerance=0.001):
|
2642
2660
|
"""
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2661
|
+
Creates a straight skeleton. This method is contributed by 高熙鹏 xipeng gao <gaoxipeng1998@gmail.com>
|
2662
|
+
This algorithm depends on the polyskel code which is included in the library. Polyskel code is found at: https://github.com/Botffy/polyskel
|
2646
2663
|
|
2647
2664
|
Parameters
|
2648
2665
|
----------
|
2649
2666
|
face : topologic_core.Face
|
2650
2667
|
The input face.
|
2651
|
-
|
2652
2668
|
tolerance : float , optional
|
2653
2669
|
The desired tolerance. The default is 0.001. (This is set to a larger number as it was found to work better)
|
2654
2670
|
|
@@ -2924,8 +2940,8 @@ class Wire(Topology):
|
|
2924
2940
|
-------
|
2925
2941
|
topologic_core.Wire
|
2926
2942
|
The created squircle.
|
2943
|
+
|
2927
2944
|
"""
|
2928
|
-
|
2929
2945
|
def get_squircle(a=1, b=1, radius=0.5, sides=100):
|
2930
2946
|
import numpy as np
|
2931
2947
|
t = np.linspace(0, 2*np.pi, sides)
|
@@ -3066,7 +3082,8 @@ class Wire(Topology):
|
|
3066
3082
|
for coord in baseV:
|
3067
3083
|
tranBase.append(Vertex.ByCoordinates(coord[0]+xOffset, coord[1]+yOffset, origin.Z()))
|
3068
3084
|
|
3069
|
-
baseWire = Wire.ByVertices(tranBase
|
3085
|
+
baseWire = Wire.ByVertices(tranBase, True)
|
3086
|
+
baseWire = Wire.Reverse(baseWire)
|
3070
3087
|
if direction != [0, 0, 1]:
|
3071
3088
|
baseWire = Topology.Orient(baseWire, origin=origin, dirA=[0, 0, 1], dirB=direction)
|
3072
3089
|
return baseWire
|
@@ -3278,6 +3295,7 @@ class Wire(Topology):
|
|
3278
3295
|
|
3279
3296
|
"""
|
3280
3297
|
from topologicpy.Vertex import Vertex
|
3298
|
+
|
3281
3299
|
def compute_u(u):
|
3282
3300
|
def count_decimal_places(number):
|
3283
3301
|
try:
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.7.
|
1
|
+
__version__ = '0.7.22'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.22
|
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
|
@@ -0,0 +1,34 @@
|
|
1
|
+
topologicpy/ANN.py,sha256=CLK6kPV28ag-hc60pyqoXt4GPiYQDUL8N48tjAbZ9Do,48981
|
2
|
+
topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
|
3
|
+
topologicpy/Cell.py,sha256=NjcKAqZywkr7DouYP4MGLhG6grWrXYfEpzDgUN-qAC0,99802
|
4
|
+
topologicpy/CellComplex.py,sha256=-f-O5lcz0nSNcjw89XYi3IYhZRrbzojG11dItpISI_U,47401
|
5
|
+
topologicpy/Cluster.py,sha256=6ZKtS82E2gCkX3oQKbx_aYL1GDiLYkleQbWWK5wYP7U,54815
|
6
|
+
topologicpy/Color.py,sha256=UlmRcCSOhqcM_OyMWz4t3Kr75KcgXDhz3uctAJ2n7Ic,18031
|
7
|
+
topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
|
8
|
+
topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
|
9
|
+
topologicpy/Dictionary.py,sha256=R6dqA2hqJX5t8faZmXCen8Cn3ukJ8VCHkyk-bune7-E,26770
|
10
|
+
topologicpy/Edge.py,sha256=QHXb0R9bdPHfHhi64rXrCeeFoLv8iaMeBxqvocBm1XI,58327
|
11
|
+
topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
|
12
|
+
topologicpy/Face.py,sha256=XS2ODccQRQvIdeuKAydjyAJmNqkwm8-RJJ5M1l4gt68,109523
|
13
|
+
topologicpy/Graph.py,sha256=eKGKgfXFeTHOuKUTVfCjuRcHZLElE-nNNWhaJ2eZ4LM,391684
|
14
|
+
topologicpy/Grid.py,sha256=Q-2WNBkvIsJks7pbGkzzkRWVB4fTMYgWipG3lcDXbpE,18496
|
15
|
+
topologicpy/Helper.py,sha256=mLwJmhyc-d-JqW82MBf7JwM91zWHVx8RzOmndPWHm-k,17717
|
16
|
+
topologicpy/Honeybee.py,sha256=vcBECJlgWVjNNdD9ZmjNik_pA1Y_ZNoOorsQb2CiyGA,21965
|
17
|
+
topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
|
18
|
+
topologicpy/Neo4j.py,sha256=Gy2PS4Ky8BNhohKreoV4zgzW9OXCjhSwiZF_Aq21_wU,19589
|
19
|
+
topologicpy/Plotly.py,sha256=iJ7zCoe2V1PqGH7GzTTvSfCXY5aRCG0fdYf4Sh6igZ8,98844
|
20
|
+
topologicpy/Polyskel.py,sha256=4R5_DEdfrmi-4gR6axHNoHTCSAE2TCekOyN8jvb7bHQ,19722
|
21
|
+
topologicpy/Shell.py,sha256=szuwRbQeHH9jd2X-DA9UhYAL_mzgfr_ctGrrQL2reWg,79917
|
22
|
+
topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
|
23
|
+
topologicpy/Sun.py,sha256=_gZfVyH0SDLQmmt775UeeAJ_BtwXO1STQnUMV1qkU0s,37161
|
24
|
+
topologicpy/Topology.py,sha256=-O3ihiNWpiKumjUtC9kSOIYgGAL83OujOkOffzAfBSE,348460
|
25
|
+
topologicpy/Vector.py,sha256=JAIeOZplh7sQD46K4eP3gMgvK6iB1wwpZ0sC9-FFGq8,32803
|
26
|
+
topologicpy/Vertex.py,sha256=deOrCOvvGJYAludUE4Tm_L4Bx0ykQzO_ddnYSrUzsBs,71157
|
27
|
+
topologicpy/Wire.py,sha256=_-0s6lFCStTGEjK5M-_w79UCQoPVFH1Ou8PdH_urvT0,145180
|
28
|
+
topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
|
29
|
+
topologicpy/version.py,sha256=rvVZXIo30C3vubfc0L25AOAnvNkX5AMbkxnXuVDaxXI,23
|
30
|
+
topologicpy-0.7.22.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
|
31
|
+
topologicpy-0.7.22.dist-info/METADATA,sha256=8fFSddgOlwxjntbT6943sxFgXVrC1RxxogTaaq71l8g,10916
|
32
|
+
topologicpy-0.7.22.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
33
|
+
topologicpy-0.7.22.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
34
|
+
topologicpy-0.7.22.dist-info/RECORD,,
|
@@ -1,34 +0,0 @@
|
|
1
|
-
topologicpy/ANN.py,sha256=H_L81-RLdmzL0wehqcZz9IUgRENFxIH7mYxS3aKL7oE,48982
|
2
|
-
topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
|
3
|
-
topologicpy/Cell.py,sha256=2ePfxb8umij3A3wzOZRSF6fAKhc2bHhSnrXRlUo1Kts,99599
|
4
|
-
topologicpy/CellComplex.py,sha256=-f-O5lcz0nSNcjw89XYi3IYhZRrbzojG11dItpISI_U,47401
|
5
|
-
topologicpy/Cluster.py,sha256=HvomWm_V4bx76YMxqOEhAUrsvcU6z5e_zry6WxMuV2M,54819
|
6
|
-
topologicpy/Color.py,sha256=UlmRcCSOhqcM_OyMWz4t3Kr75KcgXDhz3uctAJ2n7Ic,18031
|
7
|
-
topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
|
8
|
-
topologicpy/DGL.py,sha256=5jNn1L8F8REx1-oAh9sr_cfil0R5kUuueCNDKwNU_GM,138991
|
9
|
-
topologicpy/Dictionary.py,sha256=pMbfE2RYGCNpVr2x58qiHRc-aBWnp1jLlyzwS9nz6-w,25891
|
10
|
-
topologicpy/Edge.py,sha256=f7LjP662_yoqopAXBh1Gqv8DvdzvfM_heJTP2XnFskY,58447
|
11
|
-
topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
|
12
|
-
topologicpy/Face.py,sha256=DpV4ZOurOmqV3H3cDZG8FIt9NSm1DspYQjSIwfyzJjE,109083
|
13
|
-
topologicpy/Graph.py,sha256=tafjhTMr4cixcQnyj6FaIeDucc0SGTwn7kNFtnU4Q0U,391685
|
14
|
-
topologicpy/Grid.py,sha256=Cpzs9l5-SptMQbUR8AvbbIOHrGMGlK0Qx8FWmQBgvX0,18497
|
15
|
-
topologicpy/Helper.py,sha256=07V9IFu5ilMpvAdZVhIbdBOjBJSRTtJ0BfR1IoRaRXU,17743
|
16
|
-
topologicpy/Honeybee.py,sha256=dlr5OEH93q51ZmEgvi8PXGfCHBDAjIZ1cm38Rft1Bz4,20235
|
17
|
-
topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
|
18
|
-
topologicpy/Neo4j.py,sha256=Gy2PS4Ky8BNhohKreoV4zgzW9OXCjhSwiZF_Aq21_wU,19589
|
19
|
-
topologicpy/Plotly.py,sha256=6ZYVAvSSDtoHZ7OsofIDwOKRDF_CTE_UOEzEtcxHAuU,98845
|
20
|
-
topologicpy/Polyskel.py,sha256=pNawz5lnvy4oTzCL91fGY2PblW2hmcYBdT5268m2RZs,19743
|
21
|
-
topologicpy/Shell.py,sha256=gQZb0LEdzHjvQbjEOX5wT9fOYB71E6WkPLz9Kr1i4_s,79903
|
22
|
-
topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
|
23
|
-
topologicpy/Sun.py,sha256=mN3RzlslcZT3APUtwmWIXVbPkJ6OcKTaTf6338gbMJE,37152
|
24
|
-
topologicpy/Topology.py,sha256=arsO_TXFLt_M0ulUIKIOgI-xn-gjrtwKlT6Je2_R-ZU,338696
|
25
|
-
topologicpy/Vector.py,sha256=G4mIIcE5Y-EHfiNV_rxiOz8pJeV3NMEwLu5EOgM0gKA,32653
|
26
|
-
topologicpy/Vertex.py,sha256=bD3JnNhizbp6HFhHRve2LK_y5w27jytCbsagOLxKjZQ,71198
|
27
|
-
topologicpy/Wire.py,sha256=ujU77xbwsmZqMmlIhfAlmJsM32ZXWoxCSM7Pc7Yj4T0,144545
|
28
|
-
topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
|
29
|
-
topologicpy/version.py,sha256=NtJ4aAFnc8NGqEqKfgzjO8aauC5wP3QyLOgRcSVICcQ,23
|
30
|
-
topologicpy-0.7.21.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
|
31
|
-
topologicpy-0.7.21.dist-info/METADATA,sha256=161Kl1mK0XdOw4dxCmk1UmiBxctwWgcLI0d_-UE56IU,10916
|
32
|
-
topologicpy-0.7.21.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
33
|
-
topologicpy-0.7.21.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
34
|
-
topologicpy-0.7.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|