BlockResearchGroup / compas_tna

Form finding of funicular networks in compression with vertical loads using Thrust Network Analysis
https://blockresearchgroup.github.io/compas_tna
MIT License
13 stars 9 forks source link

Vertex_area() method updated after setting face adjacent to 'is_loaded':False #15

Open ricardoavelino opened 4 years ago

ricardoavelino commented 4 years ago

Feature Request

The faces of the Mesh have a useful attribute 'is_loaded' that can be used to set up openings in a form-diagram. However when this attribute is modified, the tributary area of the adjacent vertices obtained with the method Mesh.vertex_area() are not updated.

Details

In the code below, I check the vertices of a given mesh.face and I verify that it is set with 'is_loaded' attribute = True. However by changing this attribute to 'is_loaded' = False the vertex_area of all nodes that should be affected is not updated.

>>> form.face_vertices(1)
[0, 1, 3]
>>> form.get_face_attribute(1, 'is_loaded')
True
>>> form.vertex_area(0)
0.4589925871968803
>>> form.vertex_area(1)
0.6083146245381257
>>> form.vertex_area(3)
1.3466022185558575
>>> form.set_face_attribute(1, 'is_loaded', False)
>>> form.get_face_attribute(1, 'is_loaded')
False
>>> form.vertex_area(0)
0.4589925871968803
>>> form.vertex_area(1)
0.6083146245381257
>>> form.vertex_area(3)
1.3466022185558575

Describe the solution you'd like What is the best way to update these tributary loads easily?

Which feature can be added? I think it make sense that when .vertex_area() is called it consider only the adjacent faces that have the parameter 'is_loaded': True. Other alternative would be introducing a method .tributary_area() possibly considering this options. What do you think?

Thanks!

tomvanmele commented 4 years ago

that makes sense. will have a look. however, note that when using the LoadUpdater class this is already properly taken into account...