Skip to content

Commit 31d86ae

Browse files
committed
Merge branch 'master' of https://github.com/compas-dev/compas
2 parents 2c07eda + 7786c2d commit 31d86ae

File tree

4 files changed

+277
-111
lines changed

4 files changed

+277
-111
lines changed

src/compas/geometry/average.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def center_of_mass_polyhedron(polyhedron):
326326
# ==============================================================================
327327

328328
if __name__ == "__main__":
329-
329+
330330
from compas.geometry import Polyhedron
331331

332332
p = Polyhedron.generate(6)

src/compas/hpc/algorithms/drx_numba.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,16 @@ def drx_numba(network, factor=1.0, tol=0.1, steps=10000, summary=0, update=False
104104
# Update
105105

106106
if update:
107-
k_i = network.key_index()
108-
for key in network.vertices():
109-
i = k_i[key]
107+
108+
i_k = network.index_key()
109+
for i in sorted(list(network.vertices()), key=int):
110110
x, y, z = X[i, :]
111-
network.set_vertex_attributes(i, {'x': x, 'y': y, 'z': z})
111+
network.set_vertex_attributes(i_k[i], {'x': x, 'y': y, 'z': z})
112+
113+
uv_i = network.uv_index()
114+
for edge in network.edges():
115+
i = uv_i[edge]
116+
network.set_edge_attribute(edge, 'f', float(f[i]))
112117

113118
return X, f, l
114119

0 commit comments

Comments
 (0)