Skip to content

Mesh.face_attributes does not return all attributes #689

@Achillx

Description

@Achillx

Describe the bug
Mesh.face_attributes(fkey) only returns the default attributes that have been set using Mesh.update_default_face_attributes().

To Reproduce
Run the code bellow:

from compas.geometry import Box
from compas.datastructures import Mesh

box = Box.from_width_height_depth(2, 2, 2)
box = Mesh.from_shape(box)
box.update_default_face_attributes({"attr1":"value1", "attr2":"value2"})

random_fkey = box.get_any_face()
print(random_fkey, box.face_attributes(random_fkey))

box.face_attribute(random_fkey, "attr3", "value3")
print(random_fkey, box.face_attributes(random_fkey))
print(random_fkey, box.face_attribute(random_fkey, "attr3"))

Expected behavior
Return all attributes, including the ones that have been assigned only to that face

Desktop (please complete the following information):

  • Compas: 0.18.1
  • Python version: 3.7.6
  • Python package manager: conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions