ansys / pyansys-geometry

A Python wrapper for Ansys Geometry Services
https://geometry.docs.pyansys.com/
MIT License
39 stars 11 forks source link

PLOTTING: color alignment with service(Discovery,SpaceClaim) #433

Open RobPasMue opened 1 year ago

RobPasMue commented 1 year ago

As part of the JSON information, whenever it is send back, we also get information on the color of each body/component. We should make use of it when plotting.

jonahrb commented 1 year ago

Not sure this is possible with out current pyvista setup... Colors are usually assigned to actors, and pygeom only ever has 1 actor - the top level design component. Either have to iterate through multiblocks in that one actor, or use multiple actors if we want to implement this color-syncing. Lmk if you see something different.

jonahrb commented 1 year ago

We made a soft decision to implement this by having multiple actors - either at the component level or body level. Color can be passed from SC API using DesignBody.GetColor(). Probably best to pass this color in the Tessellation message.

jonahrb commented 1 year ago

Having multiple actors also allows us to have cheaper transform operations. You could now do something like actor.user_matrix = self.get_world_transform() instead of transforming the PolyData tessellation. Hopefully speeds up plotting significantly.

jonahrb commented 1 year ago

DesignBody.GetColor() is not exposed on linux yet, so this would be a windows-only feature.

RobPasMue commented 2 weeks ago

Partially possible via #1357 - now we have to implement the plotter logic to use this color value.