openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Transformations Refactor

Open pshriwise opened this issue 7 months ago • 3 comments

Description

We have a few places where transformations are applied. These are currently serialized into XML and read into vectors on the C++ side. It would be nice at some point to create a class on the Python side for transformations that can be exported to an XML element (<transformation>) and a corresponding struct in C++ that holds the transformation values.

Alternatives

Leave it as-is. This isn't a huge priority, just an opportunity for improvement :)

Compatibility

This may cause compatibility issues, particularly on the Python side where these transformations are defined.

pshriwise avatar May 29 '25 16:05 pshriwise

@connoramoreno - we sort of discussed this today...

gonuke avatar May 29 '25 18:05 gonuke

Noting here that it would probably be good to include a rotate_first option on these transformations to indicate the order of rotation/translation.

pshriwise avatar Jun 01 '25 04:06 pshriwise

Recently scipy added RigidTransform class. It has exactly what you need except the xml serialization.

GuySten avatar Jul 04 '25 14:07 GuySten