Skip to content

Translation not applied for JupyterViewer.display_face_colormap() #9

@meltzerpete

Description

@meltzerpete

It seems if a solid is translated, this is not applied when using viewer.display_face_colormap().

from occwl.io import load_single_compound_from_step
from occwl.jupyter_viewer import JupyterViewer
import numpy as np

solid = load_single_compound_from_step('example.step')
viewer = JupyterViewer()
viewer.display_face_colormap(solid, np.zeros(14))
viewer.show()

produces:

Screenshot 2021-12-17 at 12 20 32

And:

offset = np.array([10, 2, 6])

solid2 = load_single_compound_from_step('example.step')
viewer2 = JupyterViewer()
solid2.translate(offset)
viewer2.display_face_colormap(solid2, np.zeros(14))
viewer2.show()

produces:

Screenshot 2021-12-17 at 12 21 09

If I use viewer.display() the translation is applied. I can see that display_face_colormap displays each face separately, whereas display passes though the whole solid, but I have also tried translating each face separately and get the same result. Am I missing something, or is this a bug?

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