topologicpy 0.7.14__py3-none-any.whl → 0.7.17__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/Cell.py +16 -11
- topologicpy/CellComplex.py +2 -2
- topologicpy/DGL.py +1 -1
- topologicpy/Edge.py +46 -20
- topologicpy/Face.py +133 -25
- topologicpy/Graph.py +148 -106
- topologicpy/Neo4j.py +2 -2
- topologicpy/Shell.py +57 -11
- topologicpy/Topology.py +14 -18
- topologicpy/Vector.py +1 -3
- topologicpy/Vertex.py +2 -4
- topologicpy/Wire.py +192 -190
- topologicpy/version.py +1 -1
- {topologicpy-0.7.14.dist-info → topologicpy-0.7.17.dist-info}/METADATA +1 -1
- topologicpy-0.7.17.dist-info/RECORD +33 -0
- topologicpy-0.7.14.dist-info/RECORD +0 -33
- {topologicpy-0.7.14.dist-info → topologicpy-0.7.17.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.14.dist-info → topologicpy-0.7.17.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.14.dist-info → topologicpy-0.7.17.dist-info}/top_level.txt +0 -0
topologicpy/Topology.py
CHANGED
@@ -200,7 +200,7 @@ class Topology():
|
|
200
200
|
@staticmethod
|
201
201
|
def AddApertures(topology, apertures, exclusive=False, subTopologyType=None, tolerance=0.001):
|
202
202
|
"""
|
203
|
-
Adds the input list of apertures to the input topology or to its
|
203
|
+
Adds the input list of apertures to the input topology or to its subtopologies based on the input subTopologyType.
|
204
204
|
|
205
205
|
Parameters
|
206
206
|
----------
|
@@ -350,7 +350,7 @@ class Topology():
|
|
350
350
|
@staticmethod
|
351
351
|
def AdjacentTopologies(topology, hostTopology, topologyType=None):
|
352
352
|
"""
|
353
|
-
Returns the topologies, as specified by the input topology type, adjacent to the input topology
|
353
|
+
Returns the topologies, as specified by the input topology type, adjacent to the input topology within the input host topology.
|
354
354
|
|
355
355
|
Parameters
|
356
356
|
----------
|
@@ -1402,7 +1402,7 @@ class Topology():
|
|
1402
1402
|
faces : list , optional
|
1403
1403
|
The input list of faces in the form of [i, j, k, l, ...] where the items in the list are vertex indices. The face is assumed to be closed to the last vertex is connected to the first vertex automatically.
|
1404
1404
|
color : list , optional
|
1405
|
-
The desired color of the object in the form of [r, g, b, a] where the components are between 0 and 1 and represent red, blue, green, and alpha (transparency)
|
1405
|
+
The desired color of the object in the form of [r, g, b, a] where the components are between 0 and 1 and represent red, blue, green, and alpha (transparency) respectively. The default is [1.0, 1.0, 1.0, 1.0].
|
1406
1406
|
id : str , optional
|
1407
1407
|
The desired ID of the object. If set to None, an automatic uuid4 will be assigned to the object. The default is None.
|
1408
1408
|
name : str , optional
|
@@ -1410,7 +1410,7 @@ class Topology():
|
|
1410
1410
|
lengthUnit : str , optional
|
1411
1411
|
The length unit used for the object. The default is "METERS"
|
1412
1412
|
outputMode : str , optional
|
1413
|
-
The desired
|
1413
|
+
The desired output mode of the object. This can be "wire", "shell", "cell", "cellcomplex", or "default". It is case insensitive. The default is "default".
|
1414
1414
|
tolerance : float , optional
|
1415
1415
|
The desired tolerance. The default is 0.0001.
|
1416
1416
|
|
@@ -1571,7 +1571,7 @@ class Topology():
|
|
1571
1571
|
path : str
|
1572
1572
|
The input file path.
|
1573
1573
|
overwrite : bool , optional
|
1574
|
-
If set to True the
|
1574
|
+
If set to True the output file will overwrite any pre-existing file. Otherwise, it won't. The default is False.
|
1575
1575
|
version : str , optional
|
1576
1576
|
The desired version number for the BIM file. The default is "1.0.0".
|
1577
1577
|
guidKey : str , optional
|
@@ -1635,7 +1635,7 @@ class Topology():
|
|
1635
1635
|
path : str
|
1636
1636
|
The input file path.
|
1637
1637
|
overwrite : bool , optional
|
1638
|
-
If set to True the
|
1638
|
+
If set to True the output file will overwrite any pre-existing file. Otherwise, it won't. The default is False.
|
1639
1639
|
version : str , optional
|
1640
1640
|
The desired version number for the BIM file. The default is "1.0.0".
|
1641
1641
|
guidKey : str , optional
|
@@ -1731,7 +1731,7 @@ class Topology():
|
|
1731
1731
|
path : str
|
1732
1732
|
The input file path.
|
1733
1733
|
overwrite : bool , optional
|
1734
|
-
If set to True the
|
1734
|
+
If set to True the output file will overwrite any pre-existing file. Otherwise, it won't. The default is False.
|
1735
1735
|
version : str , optional
|
1736
1736
|
The desired version number for the BIM file. The default is "1.0.0".
|
1737
1737
|
guidKey : str , optional
|
@@ -2041,7 +2041,7 @@ class Topology():
|
|
2041
2041
|
file : file object
|
2042
2042
|
The input IFC file.
|
2043
2043
|
transferDictionaries : bool , optional
|
2044
|
-
If set to True, the dictionaries from the IFC file will be
|
2044
|
+
If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
|
2045
2045
|
includeTypes : list , optional
|
2046
2046
|
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 [].
|
2047
2047
|
excludeTypes : list , optional
|
@@ -2134,7 +2134,7 @@ class Topology():
|
|
2134
2134
|
path : str
|
2135
2135
|
The path to the IFC file.
|
2136
2136
|
transferDictionaries : bool , optional
|
2137
|
-
If set to True, the dictionaries from the IFC file will be
|
2137
|
+
If set to True, the dictionaries from the IFC file will be transferred to the topology. Otherwise, they won't. The default is False.
|
2138
2138
|
includeTypes : list , optional
|
2139
2139
|
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 [].
|
2140
2140
|
excludeTypes : list , optional
|
@@ -2708,7 +2708,7 @@ class Topology():
|
|
2708
2708
|
@staticmethod
|
2709
2709
|
def ByOBJString(string, transposeAxes = True, progressBar=False, tolerance=0.0001):
|
2710
2710
|
"""
|
2711
|
-
Creates a topology from the input
|
2711
|
+
Creates a topology from the input Wavefront OBJ string. This is a very experimental method and only works with simple planar solids. Materials and Colors are ignored.
|
2712
2712
|
|
2713
2713
|
Parameters
|
2714
2714
|
----------
|
@@ -2783,7 +2783,7 @@ class Topology():
|
|
2783
2783
|
@staticmethod
|
2784
2784
|
def ByOBJFile(file, transposeAxes=True, progressBar=False, tolerance=0.0001):
|
2785
2785
|
"""
|
2786
|
-
Imports the topology from a
|
2786
|
+
Imports the topology from a Wevefront OBJ file. This is a very experimental method and only works with simple planar solids. Materials and Colors are ignored.
|
2787
2787
|
|
2788
2788
|
Parameters
|
2789
2789
|
----------
|
@@ -2813,7 +2813,7 @@ class Topology():
|
|
2813
2813
|
@staticmethod
|
2814
2814
|
def ByOBJPath(path, transposeAxes=True, progressBar=False, tolerance=0.0001):
|
2815
2815
|
"""
|
2816
|
-
Imports the topology from a
|
2816
|
+
Imports the topology from a Wevefront OBJ file path. This is a very experimental method and only works with simple planar solids. Materials and Colors are ignored.
|
2817
2817
|
|
2818
2818
|
Parameters
|
2819
2819
|
----------
|
@@ -3759,7 +3759,7 @@ class Topology():
|
|
3759
3759
|
r = color[0]
|
3760
3760
|
g = color[1]
|
3761
3761
|
b = color[2]
|
3762
|
-
if len(color) ==
|
3762
|
+
if len(color) == 4:
|
3763
3763
|
a = color[3]
|
3764
3764
|
color = dotbimpy.Color(r=r, g=g, b=b, a=int(a*255))
|
3765
3765
|
guid = Dictionary.ValueAtKey(d, guidKey)
|
@@ -3773,7 +3773,6 @@ class Topology():
|
|
3773
3773
|
info['color'] = str([r,g,b,a])
|
3774
3774
|
info['guid'] = guid
|
3775
3775
|
info['type'] = type
|
3776
|
-
print("info", info)
|
3777
3776
|
rotation = dotbimpy.Rotation(qx=0, qy=0, qz=0, qw=1.0)
|
3778
3777
|
vector = dotbimpy.Vector(x=0, y=0, z=0)
|
3779
3778
|
|
@@ -3795,9 +3794,6 @@ class Topology():
|
|
3795
3794
|
"Author": author,
|
3796
3795
|
"Date": formatted_date
|
3797
3796
|
}
|
3798
|
-
|
3799
|
-
print("Meshes:", meshes)
|
3800
|
-
print("Elements:", elements)
|
3801
3797
|
|
3802
3798
|
# Instantiate and save File object
|
3803
3799
|
file = dotbimpy.File(version, meshes=meshes, elements=elements, info=file_info)
|
@@ -5544,7 +5540,7 @@ class Topology():
|
|
5544
5540
|
#final_faces.append(Face.RemoveCollinearEdges(t))
|
5545
5541
|
final_faces.append(t)
|
5546
5542
|
elif Topology.IsInstance(t, "Shell"):
|
5547
|
-
f = Face.ByShell(t)
|
5543
|
+
f = Face.ByShell(t, silent=True)
|
5548
5544
|
if Topology.IsInstance(f, "Face"):
|
5549
5545
|
final_faces.append(f)
|
5550
5546
|
else:
|
topologicpy/Vector.py
CHANGED
@@ -133,7 +133,7 @@ class Vector(list):
|
|
133
133
|
def AzimuthAltitude(vector, mantissa: int = 6):
|
134
134
|
"""
|
135
135
|
Returns a dictionary of azimuth and altitude angles in degrees for the input vector. North is assumed to be the positive Y axis [0, 1, 0]. Up is assumed to be the positive Z axis [0, 0, 1].
|
136
|
-
Azimuth is calculated in a counter-clockwise fashion from North where 0 is North, 90 is East, 180 is South, and 270 is West. Altitude is calculated in a counter-clockwise
|
136
|
+
Azimuth is calculated in a counter-clockwise fashion from North where 0 is North, 90 is East, 180 is South, and 270 is West. Altitude is calculated in a counter-clockwise fashion where -90 is straight down (negative Z axis), 0 is in the XY plane, and 90 is straight up (positive Z axis).
|
137
137
|
If the altitude is -90 or 90, the azimuth is assumed to be 0.
|
138
138
|
|
139
139
|
Parameters
|
@@ -196,7 +196,6 @@ class Vector(list):
|
|
196
196
|
# Normalize input vectors
|
197
197
|
vector1_norm = vector1 / np.linalg.norm(vector1)
|
198
198
|
vector2_norm = vector2 / np.linalg.norm(vector2)
|
199
|
-
|
200
199
|
# Check if the angle between vectors is either 0 or 180 degrees
|
201
200
|
dot_product = np.dot(vector1_norm, vector2_norm)
|
202
201
|
if np.isclose(dot_product, 1.0) or np.isclose(dot_product, -1.0):
|
@@ -207,7 +206,6 @@ class Vector(list):
|
|
207
206
|
else:
|
208
207
|
# Compute bisecting vector
|
209
208
|
bisecting_vector = (vector1_norm + vector2_norm) / np.linalg.norm(vector1_norm + vector2_norm)
|
210
|
-
|
211
209
|
return list(bisecting_vector)
|
212
210
|
|
213
211
|
@staticmethod
|
topologicpy/Vertex.py
CHANGED
@@ -1057,10 +1057,8 @@ class Vertex():
|
|
1057
1057
|
import inspect
|
1058
1058
|
|
1059
1059
|
if not Topology.IsInstance(vertex, "Vertex"):
|
1060
|
+
print("Called from:", inspect.stack()[1][3])
|
1060
1061
|
if not silent:
|
1061
|
-
stack = inspect.stack()
|
1062
|
-
if len(stack) > 2:
|
1063
|
-
print(stack[2].function)
|
1064
1062
|
print("Vertex.IsInternal - Error: The input vertex parameter is not a valid vertex. Returning None.", vertex, topology)
|
1065
1063
|
return None
|
1066
1064
|
if not Topology.IsInstance(topology, "Topology"):
|
@@ -1074,7 +1072,7 @@ class Vertex():
|
|
1074
1072
|
try:
|
1075
1073
|
parameter = Edge.ParameterAtVertex(topology, vertex)
|
1076
1074
|
except:
|
1077
|
-
parameter = 400 #
|
1075
|
+
parameter = 400 #arbitrary large number greater than 1
|
1078
1076
|
if parameter == None:
|
1079
1077
|
return False
|
1080
1078
|
return 0 <= parameter <= 1
|