Update app.py
Browse files
app.py
CHANGED
@@ -1053,9 +1053,7 @@ class torus:
|
|
1053 |
coin[2, iC, iF] = self.Z[self.P[iF, iC] - 1]
|
1054 |
return coin
|
1055 |
|
1056 |
-
|
1057 |
-
|
1058 |
-
def make_voxels(shape, length, height, width, diameter):
|
1059 |
pos = [0, 0, 0]
|
1060 |
if shape == "box":
|
1061 |
mesh = box(length, width, height, pos)
|
@@ -1081,7 +1079,11 @@ def make_voxels(shape, length, height, width, diameter):
|
|
1081 |
hull = scipy.spatial.Delaunay(hull_points)
|
1082 |
within = hull.find_simplex(test_points) >= 0
|
1083 |
|
1084 |
-
return
|
|
|
|
|
|
|
|
|
1085 |
|
1086 |
# This function loads a fuckton of data
|
1087 |
def load_data():
|
@@ -1267,7 +1269,7 @@ def geometry(index):
|
|
1267 |
def simple_analysis(index, choice, shape, length, width, height, diameter):
|
1268 |
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
1269 |
if choice == "Construct Shape from Parameters":
|
1270 |
-
return forward_net.analysis_from_geometry(
|
1271 |
elif choice == "Pick Shape from Dataset":
|
1272 |
return forward_net.analysis(index)
|
1273 |
|
|
|
1053 |
coin[2, iC, iF] = self.Z[self.P[iF, iC] - 1]
|
1054 |
return coin
|
1055 |
|
1056 |
+
def make_voxels_without_figure(shape, length, height, width, diameter):
|
|
|
|
|
1057 |
pos = [0, 0, 0]
|
1058 |
if shape == "box":
|
1059 |
mesh = box(length, width, height, pos)
|
|
|
1079 |
hull = scipy.spatial.Delaunay(hull_points)
|
1080 |
within = hull.find_simplex(test_points) >= 0
|
1081 |
|
1082 |
+
return within*1.0
|
1083 |
+
|
1084 |
+
|
1085 |
+
def make_voxels(shape, length, height, width, diameter):
|
1086 |
+
return plotly_fig(make_voxels_without_figure(shape, length, height, width, diameter))
|
1087 |
|
1088 |
# This function loads a fuckton of data
|
1089 |
def load_data():
|
|
|
1269 |
def simple_analysis(index, choice, shape, length, width, height, diameter):
|
1270 |
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
1271 |
if choice == "Construct Shape from Parameters":
|
1272 |
+
return forward_net.analysis_from_geometry(make_voxels_without_figure(shape, length, height, width, diameter))
|
1273 |
elif choice == "Pick Shape from Dataset":
|
1274 |
return forward_net.analysis(index)
|
1275 |
|