topologicpy 0.4.97__tar.gz → 0.4.99__tar.gz
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-0.4.97/src/topologicpy.egg-info → topologicpy-0.4.99}/PKG-INFO +1 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/pyproject.toml +1 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Cell.py +93 -5
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/CellComplex.py +3 -2
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Cluster.py +8 -4
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/DGL.py +5 -4
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/EnergyModel.py +3 -2
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Face.py +2 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Graph.py +9 -17
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Helper.py +2 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Honeybee.py +6 -5
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Neo4j.py +2 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Plotly.py +4 -3
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Polyskel.py +2 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Shell.py +3 -3
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Topology.py +112 -12
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Vector.py +2 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Vertex.py +10 -3
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Wire.py +0 -13
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/__init__.py +1 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99/src/topologicpy.egg-info}/PKG-INFO +1 -1
- {topologicpy-0.4.97 → topologicpy-0.4.99}/LICENSE +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/MANIFEST.in +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/README.md +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/setup.cfg +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Aperture.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Color.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Context.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Dictionary.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Edge.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Grid.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Matrix.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/Speckle.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKBool-c44b74bd.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKFillet-9a670ba0.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKG2d-8f31849e.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKG3d-4c6bce57.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKMath-72572fa8.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKMesh-2a060427.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKOffset-6cab68ff.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKPrim-eb1262b3.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libstdc++-672d7b41.so.6.0.30 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy.egg-info/SOURCES.txt +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy.egg-info/dependency_links.txt +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy.egg-info/requires.txt +0 -0
- {topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.99
|
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
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
@@ -19,6 +19,7 @@ from topologicpy.Wire import Wire
|
|
19
19
|
from topologicpy.Topology import Topology
|
20
20
|
import math
|
21
21
|
import os
|
22
|
+
import warnings
|
22
23
|
|
23
24
|
try:
|
24
25
|
import numpy as np
|
@@ -32,7 +33,7 @@ except:
|
|
32
33
|
import numpy as np
|
33
34
|
print("Cell - numpy library installed correctly.")
|
34
35
|
except:
|
35
|
-
|
36
|
+
warnings.warn("Cell - Error: Could not import numpy.")
|
36
37
|
|
37
38
|
class Cell(Topology):
|
38
39
|
@staticmethod
|
@@ -1045,13 +1046,16 @@ class Cell(Topology):
|
|
1045
1046
|
pentagons.append(Topology.Rotate(pen, origin=o, x=e_dir[0], y=e_dir[1], z=e_dir[2], degree=116.565))
|
1046
1047
|
|
1047
1048
|
cluster = Cluster.ByTopologies(pentagons)
|
1048
|
-
|
1049
|
+
|
1050
|
+
cluster2 = Topology.Rotate(cluster, origin=Vertex.Origin(), x=1,y=0,z=0,degree=180)
|
1051
|
+
cluster2 = Topology.Rotate(cluster2, origin=Vertex.Origin(), x=0,y=0,z=1,degree=36)
|
1052
|
+
vertices = Topology.Vertices(cluster2)
|
1049
1053
|
zList = [Vertex.Z(v) for v in vertices]
|
1050
1054
|
zList = list(set(zList))
|
1051
1055
|
zList.sort()
|
1052
|
-
|
1053
|
-
|
1054
|
-
cluster2 = Topology.Translate(cluster2, 0, 0,
|
1056
|
+
zoffset1 = zList[-1] - zList[0]
|
1057
|
+
zoffset2 = zList[1] - zList[0]
|
1058
|
+
cluster2 = Topology.Translate(cluster2, 0, 0, -zoffset1-zoffset2)
|
1055
1059
|
pentagons += Topology.Faces(cluster2)
|
1056
1060
|
dodecahedron = Cell.ByFaces(pentagons, tolerance=tolerance)
|
1057
1061
|
centroid = Topology.Centroid(dodecahedron)
|
@@ -1091,6 +1095,90 @@ class Cell(Topology):
|
|
1091
1095
|
_ = cell.Edges(None, edges)
|
1092
1096
|
return edges
|
1093
1097
|
|
1098
|
+
@staticmethod
|
1099
|
+
def Egg(origin: topologic.Vertex = None, height: float = 1.0, uSides: int = 16, vSides: int = 8, direction: list = [0,0,1],
|
1100
|
+
placement: str = "center", tolerance: float = 0.0001) -> topologic.Cell:
|
1101
|
+
"""
|
1102
|
+
Creates a sphere.
|
1103
|
+
|
1104
|
+
Parameters
|
1105
|
+
----------
|
1106
|
+
origin : topologic.Vertex , optional
|
1107
|
+
The origin location of the sphere. The default is None which results in the sphere being placed at (0,0,0).
|
1108
|
+
radius : float , optional
|
1109
|
+
The radius of the sphere. The default is 0.5.
|
1110
|
+
uSides : int , optional
|
1111
|
+
The number of sides along the longitude of the sphere. The default is 16.
|
1112
|
+
vSides : int , optional
|
1113
|
+
The number of sides along the latitude of the sphere. The default is 8.
|
1114
|
+
direction : list , optional
|
1115
|
+
The vector representing the up direction of the sphere. The default is [0,0,1].
|
1116
|
+
placement : str , optional
|
1117
|
+
The description of the placement of the origin of the sphere. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
|
1118
|
+
tolerance : float , optional
|
1119
|
+
The desired tolerance. The default is 0.0001.
|
1120
|
+
|
1121
|
+
Returns
|
1122
|
+
-------
|
1123
|
+
topologic.Cell
|
1124
|
+
The created sphere.
|
1125
|
+
|
1126
|
+
"""
|
1127
|
+
|
1128
|
+
from topologicpy.Vertex import Vertex
|
1129
|
+
from topologicpy.Topology import Topology
|
1130
|
+
from topologicpy.Dictionary import Dictionary
|
1131
|
+
|
1132
|
+
if not origin:
|
1133
|
+
origin = Vertex.ByCoordinates(0,0,0)
|
1134
|
+
if not isinstance(origin, topologic.Vertex):
|
1135
|
+
print("Cell.Sphere - Error: The input origin parameter is not a valid topologic vertex. Returning None.")
|
1136
|
+
return None
|
1137
|
+
|
1138
|
+
coords = [[0.0, 0.0, -0.5],
|
1139
|
+
[0.074748, 0.0, -0.494015],
|
1140
|
+
[0.140819, 0.0, -0.473222],
|
1141
|
+
[0.204118, 0.0, -0.438358],
|
1142
|
+
[0.259512, 0.0, -0.391913],
|
1143
|
+
[0.304837, 0.0, -0.335519],
|
1144
|
+
[0.338649, 0.0, -0.271416],
|
1145
|
+
[0.361307, 0.0, -0.202039],
|
1146
|
+
[0.375678, 0.0, -0.129109],
|
1147
|
+
[0.381294, 0.0, -0.053696],
|
1148
|
+
[0.377694, 0.0, 0.019874],
|
1149
|
+
[0.365135, 0.0, 0.091978],
|
1150
|
+
[0.341482, 0.0, 0.173973],
|
1151
|
+
[0.300154, 0.0, 0.276001],
|
1152
|
+
[0.252928, 0.0, 0.355989],
|
1153
|
+
[0.206605, 0.0, 0.405813],
|
1154
|
+
[0.157529, 0.0, 0.442299],
|
1155
|
+
[0.10604, 0.0, 0.472092],
|
1156
|
+
[0.05547, 0.0, 0.491784],
|
1157
|
+
[0.0, 0.0, 0.5]]
|
1158
|
+
verts = [Vertex.ByCoordinates(coord) for coord in coords]
|
1159
|
+
c = Wire.ByVertices(verts, close=False)
|
1160
|
+
new_verts = []
|
1161
|
+
for i in range(vSides+1):
|
1162
|
+
new_verts.append(Wire.VertexByParameter(c, i/vSides))
|
1163
|
+
c = Wire.ByVertices(new_verts, close=False)
|
1164
|
+
egg = Topology.Spin(c, origin=Vertex.Origin(), triangulate=False, direction=[0,0,1], degree=360, sides=uSides, tolerance=tolerance)
|
1165
|
+
if egg.Type() == topologic.CellComplex.Type():
|
1166
|
+
egg = egg.ExternalBoundary()
|
1167
|
+
if egg.Type() == topologic.Shell.Type():
|
1168
|
+
egg = topologic.Cell.ByShell(egg)
|
1169
|
+
egg = Topology.Scale(egg, origin=Vertex.Origin(), x=height, y=height, z=height)
|
1170
|
+
if placement.lower() == "bottom":
|
1171
|
+
egg = Topology.Translate(egg, 0, 0, height/2)
|
1172
|
+
elif placement.lower() == "lowerleft":
|
1173
|
+
bb = Cell.BoundingBox(egg)
|
1174
|
+
d = Topology.Dictionary(bb)
|
1175
|
+
width = Dictionary.ValueAtKey(d, 'width')
|
1176
|
+
length = Dictionary.ValueAtKey(d, 'length')
|
1177
|
+
egg = Topology.Translate(egg, width*0.5, length*0.5, height*0.5)
|
1178
|
+
egg = Topology.Orient(egg, origin=Vertex.Origin(), dirA=[0,0,1], dirB=direction)
|
1179
|
+
egg = Topology.Place(egg, originA=Vertex.Origin(), originB=origin)
|
1180
|
+
return egg
|
1181
|
+
|
1094
1182
|
@staticmethod
|
1095
1183
|
def ExternalBoundary(cell: topologic.Cell) -> topologic.Shell:
|
1096
1184
|
"""
|
@@ -18,6 +18,7 @@ import topologic
|
|
18
18
|
import math
|
19
19
|
import os
|
20
20
|
from topologicpy.Topology import Topology
|
21
|
+
import warnings
|
21
22
|
|
22
23
|
try:
|
23
24
|
import numpy as np
|
@@ -31,7 +32,7 @@ except:
|
|
31
32
|
import numpy as np
|
32
33
|
print("CellComplex - numpy library installed correctly.")
|
33
34
|
except:
|
34
|
-
|
35
|
+
warnings.warn("CellComplex - Error: Could not import numpy.")
|
35
36
|
try:
|
36
37
|
from scipy.spatial import Delaunay
|
37
38
|
from scipy.spatial import Voronoi
|
@@ -45,7 +46,7 @@ except:
|
|
45
46
|
from scipy.spatial import Delaunay
|
46
47
|
from scipy.spatial import Voronoi
|
47
48
|
except:
|
48
|
-
|
49
|
+
warnings.warn("CellComplex - Error: Could not import scipy.")
|
49
50
|
|
50
51
|
class CellComplex(Topology):
|
51
52
|
@staticmethod
|
@@ -17,6 +17,7 @@
|
|
17
17
|
from topologicpy.Topology import Topology
|
18
18
|
import topologic
|
19
19
|
import os
|
20
|
+
import warnings
|
20
21
|
|
21
22
|
try:
|
22
23
|
import numpy as np
|
@@ -30,7 +31,7 @@ except:
|
|
30
31
|
import numpy as np
|
31
32
|
print("Cluster - numpy library installed correctly.")
|
32
33
|
except:
|
33
|
-
|
34
|
+
warnings.warn("Cluster - Error: Could not import numpy.")
|
34
35
|
|
35
36
|
try:
|
36
37
|
from scipy.spatial.distance import pdist, squareform
|
@@ -44,7 +45,7 @@ except:
|
|
44
45
|
from scipy.spatial.distance import pdist, squareform
|
45
46
|
print("Cluster - scipy library installed correctly.")
|
46
47
|
except:
|
47
|
-
|
48
|
+
warnings.warn("Cluster - Error: Could not import scipy.")
|
48
49
|
|
49
50
|
class Cluster(Topology):
|
50
51
|
@staticmethod
|
@@ -188,8 +189,11 @@ class Cluster(Topology):
|
|
188
189
|
if len(keys) > 0:
|
189
190
|
dictionaries.append(d)
|
190
191
|
if len(dictionaries) > 0:
|
191
|
-
|
192
|
-
|
192
|
+
if len(dictionaries) > 1:
|
193
|
+
d = Dictionary.ByMergedDictionaries(dictionaries)
|
194
|
+
else:
|
195
|
+
d = dictionaries[0]
|
196
|
+
cluster = Topology.SetDictionary(cluster, d)
|
193
197
|
return cluster
|
194
198
|
|
195
199
|
@staticmethod
|
@@ -17,6 +17,7 @@
|
|
17
17
|
import os
|
18
18
|
import random
|
19
19
|
import copy
|
20
|
+
import warnings
|
20
21
|
os.environ["DGLBACKEND"] = "pytorch"
|
21
22
|
|
22
23
|
try:
|
@@ -31,7 +32,7 @@ except:
|
|
31
32
|
import numpy as np
|
32
33
|
print("DGL - numpy library installed correctly.")
|
33
34
|
except:
|
34
|
-
|
35
|
+
warnings.warn("DGL - Error: Could not import numpy.")
|
35
36
|
|
36
37
|
try:
|
37
38
|
import pandas as pd
|
@@ -45,7 +46,7 @@ except:
|
|
45
46
|
import pandas as pd
|
46
47
|
print("DGL - pandas library installed correctly.")
|
47
48
|
except:
|
48
|
-
|
49
|
+
warnings.warn("DGL - Error: Could not import pandas.")
|
49
50
|
|
50
51
|
try:
|
51
52
|
import torch
|
@@ -67,7 +68,7 @@ except:
|
|
67
68
|
from torch.utils.data import DataLoader, ConcatDataset
|
68
69
|
print("DGL - torch library installed correctly.")
|
69
70
|
except:
|
70
|
-
|
71
|
+
warnings.warn("DGL - Error: Could not import torch.")
|
71
72
|
|
72
73
|
try:
|
73
74
|
import dgl
|
@@ -91,7 +92,7 @@ except:
|
|
91
92
|
from dgl import save_graphs, load_graphs
|
92
93
|
print("DGL - dgl library installed correctly.")
|
93
94
|
except:
|
94
|
-
|
95
|
+
warnings.warn("DGL - Error: Could not import dgl. The installation of the correct version of the dgl library is not trivial and is highly dependent on your hardward and software configuration. Please consult the dgl installation instructions.")
|
95
96
|
|
96
97
|
try:
|
97
98
|
from sklearn import metrics
|
@@ -21,6 +21,7 @@ from collections import OrderedDict
|
|
21
21
|
import os
|
22
22
|
from os.path import exists
|
23
23
|
from datetime import datetime
|
24
|
+
import warnings
|
24
25
|
|
25
26
|
try:
|
26
27
|
from tqdm.auto import tqdm
|
@@ -34,7 +35,7 @@ except:
|
|
34
35
|
from tqdm.auto import tqdm
|
35
36
|
print("EnergyModel - tqdm library installed correctly.")
|
36
37
|
except:
|
37
|
-
|
38
|
+
warnings.warn("EnergyModel - Error: Could not import tqdm.")
|
38
39
|
|
39
40
|
try:
|
40
41
|
import openstudio
|
@@ -50,7 +51,7 @@ except:
|
|
50
51
|
openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
|
51
52
|
print("EnergyModel - openstudio library installed correctly.")
|
52
53
|
except:
|
53
|
-
|
54
|
+
warnings.warn("EnergyModel - Error: Could not import openstudio.")
|
54
55
|
|
55
56
|
class EnergyModel:
|
56
57
|
'''
|
@@ -20,6 +20,7 @@ from topologicpy.Wire import Wire
|
|
20
20
|
from topologicpy.Topology import Topology
|
21
21
|
import math
|
22
22
|
import os
|
23
|
+
import warnings
|
23
24
|
|
24
25
|
try:
|
25
26
|
import numpy as np
|
@@ -33,7 +34,7 @@ except:
|
|
33
34
|
import numpy as np
|
34
35
|
print("Face - numpy library installed correctly.")
|
35
36
|
except:
|
36
|
-
|
37
|
+
warnings.warn("Face - Error: Could not import numpy.")
|
37
38
|
|
38
39
|
class Face(Topology):
|
39
40
|
@staticmethod
|
@@ -22,6 +22,7 @@ from topologicpy.Vertex import Vertex
|
|
22
22
|
import random
|
23
23
|
import time
|
24
24
|
import os
|
25
|
+
import warnings
|
25
26
|
|
26
27
|
try:
|
27
28
|
import numpy as np
|
@@ -35,7 +36,7 @@ except:
|
|
35
36
|
import numpy as np
|
36
37
|
print("Graph - numpy library installed correctly.")
|
37
38
|
except:
|
38
|
-
|
39
|
+
warnings.warn("Graph - Error: Could not import numpy.")
|
39
40
|
|
40
41
|
try:
|
41
42
|
import pandas as pd
|
@@ -49,7 +50,7 @@ except:
|
|
49
50
|
import pandas as pd
|
50
51
|
print("Graph - pandas library installed correctly.")
|
51
52
|
except:
|
52
|
-
|
53
|
+
warnings.warn("Graph - Error: Could not import pandas.")
|
53
54
|
|
54
55
|
try:
|
55
56
|
from tqdm.auto import tqdm
|
@@ -63,7 +64,7 @@ except:
|
|
63
64
|
from tqdm.auto import tqdm
|
64
65
|
print("Graph - tqdm library installed correctly.")
|
65
66
|
except:
|
66
|
-
|
67
|
+
warnings.warn("Graph - Error: Could not import tqdm.")
|
67
68
|
|
68
69
|
try:
|
69
70
|
from pyvis.network import Network
|
@@ -77,7 +78,7 @@ except:
|
|
77
78
|
from pyvis.network import Network
|
78
79
|
print("Graph - pyvis library installed correctly.")
|
79
80
|
except:
|
80
|
-
|
81
|
+
rwarnings.warn("Graph - Error: Could not import pyvis")
|
81
82
|
|
82
83
|
try:
|
83
84
|
import networkx as nx
|
@@ -91,7 +92,7 @@ except:
|
|
91
92
|
import networkx as nx
|
92
93
|
print("Graph - networkx library installed correctly.")
|
93
94
|
except:
|
94
|
-
|
95
|
+
warnings.warn("Graph - Error: Could not import networkx.")
|
95
96
|
|
96
97
|
class _Tree:
|
97
98
|
def __init__(self, node="", *children):
|
@@ -675,7 +676,7 @@ class Graph:
|
|
675
676
|
import random
|
676
677
|
|
677
678
|
if not isinstance(adjacencyMatrix, list):
|
678
|
-
print("Graph.
|
679
|
+
print("Graph.ByAdjacencyMatrix - Error: The input adjacencyMatrix parameter is not a valid list. Returning None.")
|
679
680
|
return None
|
680
681
|
# Add vertices with random coordinates
|
681
682
|
vertices = []
|
@@ -692,7 +693,7 @@ class Graph:
|
|
692
693
|
|
693
694
|
# Create the graph using vertices and edges
|
694
695
|
if len(vertices) == 0:
|
695
|
-
print("Graph.
|
696
|
+
print("Graph.ByAdjacencyMatrix - Error: The graph does not contain any vertices. Returning None.")
|
696
697
|
return None
|
697
698
|
|
698
699
|
return Graph.ByVerticesEdges(vertices, edges)
|
@@ -960,13 +961,9 @@ class Graph:
|
|
960
961
|
graphs = []
|
961
962
|
for i, vertices, in enumerate(vertices_ds):
|
962
963
|
edges = edges_ds[i]
|
963
|
-
print("2. Length of Vertices:", len(vertices))
|
964
|
-
print("2. Length of Edges:", len(edges))
|
965
964
|
g = Graph.ByVerticesEdges(vertices, edges)
|
966
965
|
temp_v = Graph.Vertices(g)
|
967
966
|
temp_e = Graph.Edges(g)
|
968
|
-
print("3. Length of Vertices:", len(temp_v))
|
969
|
-
print("3. Length of Edges:", len(temp_e))
|
970
967
|
if isinstance(g, topologic.Graph):
|
971
968
|
if len(graphFeaturesKeys) == 0:
|
972
969
|
values = [graph_ids[i], graph_labels[i], graph_features[i]]
|
@@ -3154,10 +3151,8 @@ class Graph:
|
|
3154
3151
|
# If the maximum number of colors are not provided, compute it using the graph's chromatic number.
|
3155
3152
|
if maxColors == None:
|
3156
3153
|
maxColors = Graph.ChromaticNumber(temp_graph)
|
3157
|
-
print("MaxColors:", maxColors)
|
3158
3154
|
colors = [0] * len(vertices)
|
3159
3155
|
colors = graph_coloring(adj_mat, maxColors, colors)
|
3160
|
-
print("Colors:", colors)
|
3161
3156
|
for i, v in enumerate(vertices):
|
3162
3157
|
d = Topology.Dictionary(v)
|
3163
3158
|
d = Dictionary.SetValueAtKey(d, newKey, colors[i])
|
@@ -3314,7 +3309,7 @@ class Graph:
|
|
3314
3309
|
else:
|
3315
3310
|
returnList.append((n-1)/top_dist)
|
3316
3311
|
except:
|
3317
|
-
print("Could not use tqdm")
|
3312
|
+
print("Graph.ClosenessCentrality - Warning: Could not use tqdm.")
|
3318
3313
|
for va in vertices:
|
3319
3314
|
top_dist = 0
|
3320
3315
|
for vb in graphVertices:
|
@@ -3889,7 +3884,6 @@ class Graph:
|
|
3889
3884
|
if not nodeMaskKey == None:
|
3890
3885
|
if not nd == None:
|
3891
3886
|
keys = Dictionary.Keys(nd)
|
3892
|
-
print("keys", keys)
|
3893
3887
|
else:
|
3894
3888
|
keys = []
|
3895
3889
|
flag = True
|
@@ -4791,8 +4785,6 @@ class Graph:
|
|
4791
4785
|
|
4792
4786
|
|
4793
4787
|
# Calculate the global clustering coefficient
|
4794
|
-
print("Total Triangles:", total_triangles )
|
4795
|
-
print("Total Possible Triangles:", total_possible_triangles )
|
4796
4788
|
global_clustering_coeff = 3.0 * total_triangles / total_possible_triangles if total_possible_triangles > 0 else 0.0
|
4797
4789
|
|
4798
4790
|
return global_clustering_coeff
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
import topologicpy
|
18
18
|
import os
|
19
|
+
import warnings
|
19
20
|
|
20
21
|
try:
|
21
22
|
import numpy as np
|
@@ -31,7 +32,7 @@ except:
|
|
31
32
|
import numpy.linalg as la
|
32
33
|
print("Helper - numpy library installed correctly.")
|
33
34
|
except:
|
34
|
-
|
35
|
+
warnings.warn("Helper - Error: Could not import numpy.")
|
35
36
|
|
36
37
|
class Helper:
|
37
38
|
@staticmethod
|
@@ -15,6 +15,7 @@
|
|
15
15
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
import os
|
18
|
+
import warnings
|
18
19
|
|
19
20
|
try:
|
20
21
|
import honeybee.facetype
|
@@ -39,7 +40,7 @@ except:
|
|
39
40
|
from honeybee.aperture import Aperture as HBAperture
|
40
41
|
from honeybee.door import Door as HBDoor
|
41
42
|
except:
|
42
|
-
|
43
|
+
warnings.warn("Honeybee - ERROR: Could not import honeybee")
|
43
44
|
|
44
45
|
try:
|
45
46
|
import honeybee_energy.lib.constructionsets as constr_set_lib
|
@@ -64,7 +65,7 @@ except:
|
|
64
65
|
from honeybee_energy.load.setpoint import Setpoint
|
65
66
|
from honeybee_energy.load.hotwater import ServiceHotWater
|
66
67
|
except:
|
67
|
-
|
68
|
+
warnings.warn("Honeybee - Error: Could not import honeybee-energy")
|
68
69
|
|
69
70
|
try:
|
70
71
|
from honeybee_radiance.sensorgrid import SensorGrid
|
@@ -77,7 +78,7 @@ except:
|
|
77
78
|
try:
|
78
79
|
from honeybee_radiance.sensorgrid import SensorGrid
|
79
80
|
except:
|
80
|
-
|
81
|
+
warnings.warn("Honeybee - Error: Could not import honeybee-radiance")
|
81
82
|
|
82
83
|
try:
|
83
84
|
from ladybug.dt import Time
|
@@ -90,7 +91,7 @@ except:
|
|
90
91
|
try:
|
91
92
|
from ladybug.dt import Time
|
92
93
|
except:
|
93
|
-
|
94
|
+
warnings.warn("Honeybee - Error: Could not import ladybug")
|
94
95
|
|
95
96
|
try:
|
96
97
|
from ladybug_geometry.geometry3d.face import Face3D
|
@@ -105,7 +106,7 @@ except:
|
|
105
106
|
from ladybug_geometry.geometry3d.face import Face3D
|
106
107
|
from ladybug_geometry.geometry3d.pointvector import Point3D, Vector3D
|
107
108
|
except:
|
108
|
-
|
109
|
+
warnings.warn("Honeybee - Error: Could not import ladybug-geometry")
|
109
110
|
|
110
111
|
import json
|
111
112
|
import topologic
|
@@ -17,6 +17,7 @@
|
|
17
17
|
import time
|
18
18
|
import random
|
19
19
|
import os
|
20
|
+
import warnings
|
20
21
|
|
21
22
|
try:
|
22
23
|
import py2neo
|
@@ -33,7 +34,7 @@ except:
|
|
33
34
|
from py2neo import NodeMatcher,RelationshipMatcher
|
34
35
|
from py2neo.data import spatial as sp
|
35
36
|
except:
|
36
|
-
|
37
|
+
warnings.warn("Neo4j - Error: Could not import py2neo")
|
37
38
|
|
38
39
|
class Neo4j:
|
39
40
|
|
@@ -20,6 +20,7 @@ import topologic
|
|
20
20
|
from topologicpy.Wire import Wire
|
21
21
|
from topologicpy.Face import Face
|
22
22
|
import os
|
23
|
+
import warnings
|
23
24
|
|
24
25
|
try:
|
25
26
|
import numpy as np
|
@@ -32,7 +33,7 @@ except:
|
|
32
33
|
try:
|
33
34
|
import numpy as np
|
34
35
|
except:
|
35
|
-
|
36
|
+
warnings.warn("Plotly - Error: Could not import numpy.")
|
36
37
|
|
37
38
|
try:
|
38
39
|
import pandas as pd
|
@@ -45,7 +46,7 @@ except:
|
|
45
46
|
try:
|
46
47
|
import pandas as pd
|
47
48
|
except:
|
48
|
-
|
49
|
+
warnings.warn("Plotly - Error: Could not import pandas.")
|
49
50
|
|
50
51
|
try:
|
51
52
|
import plotly
|
@@ -62,7 +63,7 @@ except:
|
|
62
63
|
import plotly.graph_objects as go
|
63
64
|
import plotly.offline as ofl
|
64
65
|
except:
|
65
|
-
|
66
|
+
warnings.warn("Plotly - Error: Could not import plotly.")
|
66
67
|
|
67
68
|
class Plotly:
|
68
69
|
@staticmethod
|
@@ -20,6 +20,7 @@ import heapq
|
|
20
20
|
from itertools import *
|
21
21
|
from collections import namedtuple
|
22
22
|
import os
|
23
|
+
import warnings
|
23
24
|
|
24
25
|
try:
|
25
26
|
from euclid3 import *
|
@@ -32,7 +33,7 @@ except:
|
|
32
33
|
try:
|
33
34
|
from euclid3 import *
|
34
35
|
except:
|
35
|
-
|
36
|
+
warnings.warn("Polyskel - ERROR: Could not import euclid3.")
|
36
37
|
|
37
38
|
log = logging.getLogger("__name__")
|
38
39
|
|
@@ -18,6 +18,7 @@ import topologic
|
|
18
18
|
from topologicpy.Topology import Topology
|
19
19
|
import math
|
20
20
|
import os
|
21
|
+
import warnings
|
21
22
|
|
22
23
|
try:
|
23
24
|
from tqdm.auto import tqdm
|
@@ -31,7 +32,7 @@ except:
|
|
31
32
|
from tqdm.auto import tqdm
|
32
33
|
print("Shell - tqdm library installed correctly.")
|
33
34
|
except:
|
34
|
-
|
35
|
+
warnings.warn("Shell - Error: Could not import tqdm.")
|
35
36
|
|
36
37
|
try:
|
37
38
|
from scipy.spatial import Delaunay
|
@@ -46,7 +47,7 @@ except:
|
|
46
47
|
from scipy.spatial import Delaunay
|
47
48
|
from scipy.spatial import Voronoi
|
48
49
|
except:
|
49
|
-
|
50
|
+
warnings.warn("Shell - Error: Could not import scipy.")
|
50
51
|
|
51
52
|
class Shell(Topology):
|
52
53
|
@staticmethod
|
@@ -1295,7 +1296,6 @@ class Shell(Topology):
|
|
1295
1296
|
if not roof:
|
1296
1297
|
return None
|
1297
1298
|
shell = Shell.Skeleton(flat_face, tolerance=tolerance)
|
1298
|
-
print(shell)
|
1299
1299
|
faces = Shell.Faces(shell)
|
1300
1300
|
Topology.Show(shell)
|
1301
1301
|
if not faces:
|
@@ -17,7 +17,7 @@
|
|
17
17
|
import topologic
|
18
18
|
from topologicpy.Aperture import Aperture
|
19
19
|
from topologicpy.Dictionary import Dictionary
|
20
|
-
|
20
|
+
import warnings
|
21
21
|
import uuid
|
22
22
|
import json
|
23
23
|
import os
|
@@ -42,7 +42,7 @@ except:
|
|
42
42
|
from numpy.linalg import norm
|
43
43
|
print("Topology - numpy library installed successfully.")
|
44
44
|
except:
|
45
|
-
|
45
|
+
warnings.warn("Topology - Error: Could not import numpy.")
|
46
46
|
|
47
47
|
try:
|
48
48
|
import ifcopenshell
|
@@ -58,7 +58,7 @@ except:
|
|
58
58
|
import ifcopenshell.geom
|
59
59
|
print("Topology - ifcopenshell library installed successfully.")
|
60
60
|
except:
|
61
|
-
|
61
|
+
warnings.warn("Topology - Error: Could not import ifcopenshell.")
|
62
62
|
|
63
63
|
try:
|
64
64
|
from scipy.spatial import ConvexHull
|
@@ -72,7 +72,7 @@ except:
|
|
72
72
|
from scipy.spatial import ConvexHull
|
73
73
|
print("Topology - scipy library installed successfully.")
|
74
74
|
except:
|
75
|
-
|
75
|
+
warnings.warn("Topology - Error: Could not import scipy.")
|
76
76
|
|
77
77
|
QueueItem = namedtuple('QueueItem', ['ID', 'sinkKeys', 'sinkValues'])
|
78
78
|
SinkItem = namedtuple('SinkItem', ['ID', 'sink_str'])
|
@@ -278,8 +278,8 @@ class Topology():
|
|
278
278
|
----------
|
279
279
|
topology : topologic.Topology
|
280
280
|
The input topology.
|
281
|
-
conntents : list
|
282
|
-
The input list of contents.
|
281
|
+
conntents : list or topologic.Topology
|
282
|
+
The input list of contents (of type topologic.Topology). A single topology is also accepted as input.
|
283
283
|
subTopologyType : string , optional
|
284
284
|
The subtopology type to which to add the contents. This can be "cellcomplex", "cell", "shell", "face", "wire", "edge", or "vertex". It is case insensitive. If set to None, the contents will be added to the input topology. The default is None.
|
285
285
|
tolerance : float , optional
|
@@ -296,6 +296,8 @@ class Topology():
|
|
296
296
|
return None
|
297
297
|
if not contents:
|
298
298
|
return topology
|
299
|
+
if not isinstance(contents, list):
|
300
|
+
contents = [contents]
|
299
301
|
if not isinstance(contents, list):
|
300
302
|
print("Topology.AddContent - Error: the input contents parameter is not a list. Returning None.")
|
301
303
|
return None
|
@@ -3607,7 +3609,6 @@ class Topology():
|
|
3607
3609
|
return_topology = Cell.ByFaces(faces, tolerance=tolerance)
|
3608
3610
|
if return_topology == None:
|
3609
3611
|
return_topology = CellComplex.ByFaces(faces, tolerance=tolerance)
|
3610
|
-
#print("Return Topology:", return_topology)
|
3611
3612
|
if return_topology == None:
|
3612
3613
|
print("Topology.Fix - Error: Desired topologyType cannot be achieved. Returning original topology.")
|
3613
3614
|
return topology
|
@@ -4397,7 +4398,6 @@ class Topology():
|
|
4397
4398
|
return [a,b,c,d]
|
4398
4399
|
|
4399
4400
|
if not isinstance(topology, topologic.Topology):
|
4400
|
-
print("Topology.IsPlanar", topology)
|
4401
4401
|
print("Topology.IsPlanar - Error: the input topology parameter is not a valid topology. Returning None.")
|
4402
4402
|
return None
|
4403
4403
|
vertices = Topology.Vertices(topology)
|
@@ -5146,7 +5146,7 @@ class Topology():
|
|
5146
5146
|
|
5147
5147
|
"""
|
5148
5148
|
if not len(verticesA) == len(verticesB):
|
5149
|
-
print("
|
5149
|
+
print("Topology.ReplaceVertices - Error: The input parameters verticesA and verticesB must be the same length")
|
5150
5150
|
return None
|
5151
5151
|
from topologicpy.Vertex import Vertex
|
5152
5152
|
geom = Topology.Geometry(topology, mantissa=mantissa)
|
@@ -5194,6 +5194,7 @@ class Topology():
|
|
5194
5194
|
|
5195
5195
|
"""
|
5196
5196
|
from topologicpy.Vertex import Vertex
|
5197
|
+
from topologicpy.Dictionary import Dictionary
|
5197
5198
|
|
5198
5199
|
def rotate_vertex_3d(vertex, axis, angle_degrees, origin):
|
5199
5200
|
vertex = np.array(vertex) # Vertex to be rotated
|
@@ -5216,12 +5217,11 @@ class Topology():
|
|
5216
5217
|
translated_vertex = vertex - origin
|
5217
5218
|
rotated_vertex = np.dot(rotation_matrix, translated_vertex) + origin
|
5218
5219
|
|
5219
|
-
rotated_vertex = [v for v in rotated_vertex]
|
5220
|
+
rotated_vertex = [v for v in rotated_vertex]
|
5220
5221
|
return rotated_vertex
|
5221
5222
|
|
5222
5223
|
if not isinstance(topology, topologic.Topology):
|
5223
5224
|
print("Topology.Rotate - Error: The input topology parameter is not a valid topologic topology. Returning None.")
|
5224
|
-
print("The topology is", topology)
|
5225
5225
|
return None
|
5226
5226
|
if not origin:
|
5227
5227
|
origin = Vertex.ByCoordinates(0,0,0)
|
@@ -5456,6 +5456,56 @@ class Topology():
|
|
5456
5456
|
_ = topology.SetDictionary(dictionary)
|
5457
5457
|
return topology
|
5458
5458
|
|
5459
|
+
@staticmethod
|
5460
|
+
def SetSnapshot(topology, snapshot=None, timestamp=None, key="timestamp", silent=False):
|
5461
|
+
from datetime import datetime
|
5462
|
+
def is_valid_timestamp(timestamp):
|
5463
|
+
if isinstance(timestamp, datetime):
|
5464
|
+
return True
|
5465
|
+
elif isinstance(timestamp, str):
|
5466
|
+
try:
|
5467
|
+
# Split the timestamp string into date and time parts
|
5468
|
+
date_part, time_part = timestamp.split(' ')
|
5469
|
+
# Parse the date part
|
5470
|
+
date_obj = datetime.strptime(date_part, '%Y-%m-%d')
|
5471
|
+
# Split the time part into hours, minutes, and seconds
|
5472
|
+
hours, minutes, seconds = map(float, time_part.split(':'))
|
5473
|
+
# Check if seconds are within valid range
|
5474
|
+
if seconds < 0 or seconds >= 60:
|
5475
|
+
return False
|
5476
|
+
# Create a datetime object with the parsed date and time parts
|
5477
|
+
datetime_obj = datetime(date_obj.year, date_obj.month, date_obj.day, int(hours), int(minutes), int(seconds))
|
5478
|
+
return True
|
5479
|
+
except ValueError:
|
5480
|
+
return False
|
5481
|
+
else:
|
5482
|
+
return False
|
5483
|
+
|
5484
|
+
if not isinstance(topology, topologic.Topology):
|
5485
|
+
if not silent:
|
5486
|
+
print("Topology.SetSnapshot - Error: The input topology parameter is not a valid topology. Returning None.")
|
5487
|
+
return None
|
5488
|
+
if not isinstance(snapshot, topologic.Topology):
|
5489
|
+
snapshot = Topology.Copy(topology)
|
5490
|
+
d = Topology.Dictionary(topology)
|
5491
|
+
snapshot = Topology.SetDictionary(snapshot, d)
|
5492
|
+
if not isinstance(snapshot, topologic.Topology):
|
5493
|
+
if not silent:
|
5494
|
+
print("Topology.SetSnapshot - Error: The input snapshot parameter is not a valid topology. Returning None.")
|
5495
|
+
return None
|
5496
|
+
if timestamp == None:
|
5497
|
+
timestamp = datetime.now()
|
5498
|
+
if not is_valid_timestamp(timestamp):
|
5499
|
+
if not silent:
|
5500
|
+
print("Topology.SetSnapshot - Error: The input timestamp parameter is not a valid timestamp. Returning None.")
|
5501
|
+
return None
|
5502
|
+
|
5503
|
+
d = Topology.Dictionary(snapshot)
|
5504
|
+
d = Dictionary.SetValueAtKey(d, key, str(timestamp))
|
5505
|
+
snapshot = Topology.SetDictionary(snapshot, d)
|
5506
|
+
topology = Topology.AddContent(topology, snapshot)
|
5507
|
+
return topology
|
5508
|
+
|
5459
5509
|
@staticmethod
|
5460
5510
|
def SharedTopologies(topologyA, topologyB):
|
5461
5511
|
"""
|
@@ -5897,6 +5947,57 @@ class Topology():
|
|
5897
5947
|
unsortedTopologies.append(topologies[i])
|
5898
5948
|
return {"sorted":sortedTopologies, "unsorted":unsortedTopologies}
|
5899
5949
|
|
5950
|
+
@staticmethod
|
5951
|
+
def Snapshots(topology, key="timestamp", start=None, end=None, silent=False):
|
5952
|
+
from datetime import datetime
|
5953
|
+
def is_valid_timestamp(timestamp):
|
5954
|
+
if isinstance(timestamp, datetime):
|
5955
|
+
return True
|
5956
|
+
elif isinstance(timestamp, str):
|
5957
|
+
try:
|
5958
|
+
# Split the timestamp string into date and time parts
|
5959
|
+
date_part, time_part = timestamp.split(' ')
|
5960
|
+
# Parse the date part
|
5961
|
+
date_obj = datetime.strptime(date_part, '%Y-%m-%d')
|
5962
|
+
# Split the time part into hours, minutes, and seconds
|
5963
|
+
hours, minutes, seconds = map(float, time_part.split(':'))
|
5964
|
+
# Check if seconds are within valid range
|
5965
|
+
if seconds < 0 or seconds >= 60:
|
5966
|
+
return False
|
5967
|
+
# Create a datetime object with the parsed date and time parts
|
5968
|
+
return datetime(date_obj.year, date_obj.month, date_obj.day, int(hours), int(minutes), int(seconds))
|
5969
|
+
except ValueError:
|
5970
|
+
return False
|
5971
|
+
else:
|
5972
|
+
return False
|
5973
|
+
|
5974
|
+
if not isinstance(topology, topologic.Topology):
|
5975
|
+
if not silent:
|
5976
|
+
print("Topology.Snapshots - Error: The input topology parameter is not a valid topology. Returning None.")
|
5977
|
+
return None
|
5978
|
+
if start == None:
|
5979
|
+
start = datetime.datetime(year=1900, month=1, day=1) # Set the start date to a date in the distant past
|
5980
|
+
if end == None:
|
5981
|
+
end = datetime.now() # Set the end date to the present.
|
5982
|
+
if not is_valid_timestamp(start):
|
5983
|
+
if not silent:
|
5984
|
+
print("Topology.Snapshots - Error: The input start parameter is not a valid timestamp. Returning None.")
|
5985
|
+
return None
|
5986
|
+
if not is_valid_timestamp(end):
|
5987
|
+
if not silent:
|
5988
|
+
print("Topology.Snapshots - Error: The input end parameter is not a valid timestamp. Returning None.")
|
5989
|
+
return None
|
5990
|
+
contents = Topology.Contents(topology)
|
5991
|
+
snapshots = []
|
5992
|
+
for content in contents:
|
5993
|
+
d = Topology.Dictionary(content)
|
5994
|
+
timestamp = Dictionary.ValueAtKey(d, key)
|
5995
|
+
timestamp = is_valid_timestamp(timestamp)
|
5996
|
+
if not timestamp == False:
|
5997
|
+
if start <= timestamp <= end:
|
5998
|
+
snapshots.append(content)
|
5999
|
+
return snapshots
|
6000
|
+
|
5900
6001
|
@staticmethod
|
5901
6002
|
def Spin(topology, origin=None, triangulate=True, direction=[0,0,1], degree=360, sides=16,
|
5902
6003
|
tolerance=0.0001, silent=False):
|
@@ -6476,7 +6577,6 @@ class Topology():
|
|
6476
6577
|
for i, sink in enumerate(sink_items):
|
6477
6578
|
mapItem = sinkMap[sink.ID]
|
6478
6579
|
newDict = Dictionary.ByKeysValues(mapItem.sinkKeys, mapItem.sinkValues)
|
6479
|
-
# print("newDict", Dictionary.Keys(newDict), Dictionary.Values(newDict))
|
6480
6580
|
_ = sinks[i].SetDictionary(newDict)
|
6481
6581
|
return {"sources": sources, "sinks": sinks}
|
6482
6582
|
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
import math
|
18
18
|
import os
|
19
|
+
import warnings
|
19
20
|
|
20
21
|
try:
|
21
22
|
import numpy as np
|
@@ -33,7 +34,7 @@ except:
|
|
33
34
|
from numpy import pi, arctan2, rad2deg
|
34
35
|
print("Vector - numpy library installed successfully.")
|
35
36
|
except:
|
36
|
-
|
37
|
+
warnings.warn("Vector - Error: Could not import numpy.")
|
37
38
|
|
38
39
|
class Vector(list):
|
39
40
|
@staticmethod
|
@@ -20,6 +20,7 @@ from topologicpy.Face import Face
|
|
20
20
|
from topologicpy.Topology import Topology
|
21
21
|
import collections
|
22
22
|
import os
|
23
|
+
import warnings
|
23
24
|
|
24
25
|
try:
|
25
26
|
import numpy as np
|
@@ -33,7 +34,7 @@ except:
|
|
33
34
|
import numpy as np
|
34
35
|
print("Vertex - numpy library installed successfully.")
|
35
36
|
except:
|
36
|
-
|
37
|
+
warnings.warn("Vertex - Error: Could not import numpy.")
|
37
38
|
|
38
39
|
class Vertex(Topology):
|
39
40
|
@staticmethod
|
@@ -698,10 +699,16 @@ class Vertex(Topology):
|
|
698
699
|
fused_vertices.append(fused_vertex)
|
699
700
|
|
700
701
|
return fused_vertices
|
701
|
-
|
702
702
|
def count_decimal_points(vertex):
|
703
703
|
# Count the number of decimal points in the coordinates
|
704
|
-
|
704
|
+
decimals_list = []
|
705
|
+
for coord in vertex:
|
706
|
+
coord_str = str(coord)
|
707
|
+
if '.' in coord_str:
|
708
|
+
decimals_list.append(len(coord_str.split('.')[1]))
|
709
|
+
elif 'e' in coord_str:
|
710
|
+
decimals_list.append(int(coord_str.split('e')[1].replace('-','')))
|
711
|
+
return max(decimals_list)
|
705
712
|
|
706
713
|
|
707
714
|
if not isinstance(vertices, list):
|
@@ -2933,9 +2933,6 @@ class Wire(Topology):
|
|
2933
2933
|
return Wire.StartVertex(wire)
|
2934
2934
|
if abs(distance - wire_length) < tolerance:
|
2935
2935
|
return Wire.EndVertex(wire)
|
2936
|
-
# if abs(distance) > wire_length:
|
2937
|
-
# print("Wire.VertexByDistance - Error: The input distance parameter is larger than the wire's length. Returning None.")
|
2938
|
-
# return None
|
2939
2936
|
if not Wire.IsManifold(wire):
|
2940
2937
|
print("Wire.VertexAtParameter - Error: The input wire parameter is non-manifold. Returning None.")
|
2941
2938
|
return None
|
@@ -2947,16 +2944,6 @@ class Wire(Topology):
|
|
2947
2944
|
if not Vertex.IsInternal(origin, wire, tolerance=tolerance):
|
2948
2945
|
print("Wire.VertexByDistance - Error: The input origin parameter is not internal to the input wire parameter. Returning None.")
|
2949
2946
|
return None
|
2950
|
-
# if distance < 0:
|
2951
|
-
# if Wire.VertexDistance(wire, Wire.StartVertex(wire), origin) < abs(distance):
|
2952
|
-
# print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
|
2953
|
-
# return None
|
2954
|
-
# else:
|
2955
|
-
# if Wire.VertexDistance(wire, Wire.EndVertex(wire), origin) < distance:
|
2956
|
-
# print("Wire.VertexDistance:", Wire.VertexDistance(wire, Wire.EndVertex(wire), origin))
|
2957
|
-
# print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
|
2958
|
-
# return None
|
2959
|
-
|
2960
2947
|
if Vertex.Distance(Wire.StartVertex(wire), origin) < tolerance:
|
2961
2948
|
u = distance/wire_length
|
2962
2949
|
elif Vertex.Distance(Wire.EndVertex(wire), origin) < tolerance:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.99
|
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
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll
RENAMED
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll
RENAMED
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll
RENAMED
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll
RENAMED
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll
RENAMED
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll
RENAMED
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.97 → topologicpy-0.4.99}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|