Unexpected extra faces with update_boundaries in compas_tna Form Diagram (Blender)

Hi all,

I’m experiencing an issue when using compas_blender and compas_tna, and I would like some advice or clarification.

  • I generate a Form Diagram as a meshgrid and define supports at the vertices.
  • I use relax_boundary_openings to relax the mesh.
  • When I run update_boundaries, extra faces are generated between supports in the Form Diagram.
  • These extra faces are required for constructing the Force Diagram and ensuring both horizontal and vertical equilibrium, I guess

On compas_notebook viewer these faces are not displayed, but in Blender, they remain visible as part of the mesh.

Is this the expected behavior?
Is there any way to automatically remove or hide these faces in Blender, or to make Blender’s visualization consistent with the notebook viewer?

Thank you for any guidance or recommendations!


I am adding below the code and some reference images.

In Blender:

#Import dependencies

from compas_tna.diagrams import FormDiagram
from compas_tna.diagrams import ForceDiagram
from compas_tna.equilibrium import relax_boundary_openings
from compas_tna.equilibrium import horizontal_nodal
from compas_tna.equilibrium import vertical_from_zmax
from compas.scene import Scene

#Create Form Diagram
form: FormDiagram = FormDiagram.from_meshgrid(dx=10, nx=10)

#Add supports
corners: list[int] = list(form.vertices_where(vertex_degree=2))
form.vertices_attribute("is_support", True, keys=corners)

#Relax Form Diagram at boundary openings
form.edges_attribute("q", 10.0, keys=form.edges_on_boundary())
relax_boundary_openings(form, corners)

#Update boundaries
form.update_boundaries()

#Create Force Diagram
force = ForceDiagram.from_formdiagram(form)

#Find horizontal equilibrium
horizontal_nodal(form, force, kmax=100)

#Find vertical equilibrium
scale = vertical_from_zmax(form, 3.0)

#Create scene and add form diagram

scene = Scene()
scene.add(form)
scene.draw()

In Jupyter:

#Import dependencies

from compas_tna.diagrams import FormDiagram
from compas_tna.diagrams import ForceDiagram
from compas_tna.equilibrium import relax_boundary_openings
from compas_tna.equilibrium import horizontal_nodal
from compas_tna.equilibrium import vertical_from_zmax
from compas_notebook import Viewer

#Create Form Diagram
form: FormDiagram = FormDiagram.from_meshgrid(dx=10, nx=10)

#Add supports
corners: list[int] = list(form.vertices_where(vertex_degree=2))
form.vertices_attribute("is_support", True, keys=corners)

#Relax Form Diagram at boundary openings
form.edges_attribute("q", 10.0, keys=form.edges_on_boundary())
relax_boundary_openings(form, corners)

#Update boundaries
form.update_boundaries()

#Create Force Diagram
force = ForceDiagram.from_formdiagram(form)

#Find horizontal equilibrium
horizontal_nodal(form, force, kmax=100)

#Find vertical equilibrium
scale = vertical_from_zmax(form, 3.0)

#Create scene and add form diagram

viewer = Viewer()

viewer.scene.add(form)

viewer.show()

Here’s the result within Jupyter (new users are not allowed to add more than one media per post)

this is not a bug. these “extra” faces are part of the form diagram. they represent the open boundaries and have corresponding dual vertices in the force diagram.

compas_tna registers a form diagram scene object for the notebook scene that automatically removes these faces during visualisation.

if a similar scene object would be registered for Blender scenes, the extra faces would be removed automatically there as well.

in the meantime, in Blender, you can just do:

faces = list(form.faces_where(_is_loaded=True))
edges = list(form.edges_where(_is_edge=True))

scene.add(form, show_faces=faces, show_edges=edges)

Thank you very much for your clear explanation.
That clarifies perfectly why the extra faces appear and how the notebook viewer handles them differently.
I appreciate the tip about the scene object registration for Blender scenes — I’ll look into implementing that to improve visualization consistency.

Thanks again for your help!