update_form_from_force
-
compas_ags.ags.
update_form_from_force
(xy, _xy, free, fixed_x, fixed_y, leaves, i_nbrs, ij_e, _C, kmax=100)[source] Update the coordinates of a form diagram using the coordinates of the corresponding force diagram.
- Parameters
xy (array-like) – XY coordinates of the vertices of the form diagram.
_xy (array-like) – XY coordinates of the vertices of the force diagram.
fixed_x (list) – Vertices of the form diagram fixed to move in
x
.fixed_y (list) – Vertices of the form diagram fixed to move in
y
.leaves (list) – The leaves of the form diagram.
i_nbrs (list of list of int) – Vertex neighbours per vertex.
ij_e (dict) – Edge index for every vertex pair.
_C (sparse matrix in csr format) – The connectivity matrix of the force diagram.
kmax (int, optional) – Maximum number of iterations. Default is
100
.
- Returns
None – The vertex coordinates are modified in-place.
Notes
This function should be used to update the form diagram after modifying the geometry of the force diagram. The objective is to compute new locations for the vertices of the form diagram such that the corrsponding lines of the form and force diagram are parallel while any geometric constraints imposed on the form diagram are satisfied.
The location of each vertex of the form diagram is computed as the intersection of the lines connected to it. Each of the connected lines is based at the connected neighbouring vertex and taken parallel to the corresponding line in the force diagram.
For a point p, which is the least-squares intersection of K lines, with every line j defined by a point aj on the line and a direction vector nj, we can write
Rp=qwith
R=K∑j=1(I−njnTj),q=K∑j=1(I−njnTj)ajThis system of linear equations can be solved using the normal equations
p=(RTR)−1RTqExamples
>>>