Skip to content

Commit 9139d2d

Browse files
committed
add residuals
1 parent 9dd2de9 commit 9139d2d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

plugin/FF_solve_fd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! python3
22
import rhinoscriptsyntax as rs # type: ignore # noqa: F401
33

4+
from compas.geometry import Vector
45
from compas.scene import Scene
56
from compas_fd.solvers import fd_constrained_numpy
67
from compas_fofin.datastructures import CableMesh
@@ -51,7 +52,7 @@ def RunCommand(is_interactive):
5152
attr["x"] = result.vertices[index, 0]
5253
attr["y"] = result.vertices[index, 1]
5354
attr["z"] = result.vertices[index, 2]
54-
attr["residual"] = result.residuals[index]
55+
attr["residual"] = Vector(*result.residuals[index])
5556

5657
for index, (edge, attr) in enumerate(mesh.edges(data=True)):
5758
attr["_f"] = result.forces[index]

plugin/FoFin.rhproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "5df3b821-822e-49e0-b24e-aebbe671c3d1",
33
"identity": {
44
"name": "COMPAS-FormFinder",
5-
"version": "0.1.34-beta",
5+
"version": "0.1.36-beta",
66
"publisher": {
77
"email": "tom.v.mele@gmail.com",
88
"name": "Tom Van Mele",

src/compas_fofin/datastructures/cablemesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ def __init__(self, constraints=None, **kwargs):
4343

4444
def vertex_residual(self, vertex):
4545
residual = self.vertex_attribute(vertex, "residual")
46-
if not residual:
46+
if residual is None:
4747
residual = Vector(0, 0, 0)
4848
return residual
4949

5050
def vertex_load(self, vertex):
5151
load = self.vertex_attribute(vertex, "load")
52-
if not load:
52+
if load is None:
5353
load = Vector(0, 0, 0)
5454
return load
5555

0 commit comments

Comments
 (0)