flow360.component.simulation.draft_context.mirror.MirrorManager

flow360.component.simulation.draft_context.mirror.MirrorManager#

class MirrorManager[source]#

Bases: object

Manage mirror planes and mirrored draft entities inside a DraftContext.

This manager provides:

  • Storage/registration of MirrorPlane entities.

  • Creation/removal of mirror actions for GeometryBodyGroup entities.

  • Derivation and registration of draft-only entities: MirroredGeometryBodyGroup and (when possible) MirroredSurface.

Notes

Surface mirroring requires a surface-to-body-group mapping derived from GeometryEntityInfo. If that mapping cannot be derived (e.g. face grouping spans multiple body groups), mirroring is disabled and mirror operations will raise.

property mirror_planes: EntityRegistryView#

Return all the available mirror planes.

Returns:

A registry view of MirrorPlane entities available in this draft.

Return type:

EntityRegistryView

create_mirror_of(*, entities, mirror_plane)[source]#

Create mirrored entities for one or more geometry body groups.

This registers mirror actions for the requested body groups and then derives/creates draft-only entities:

  • MirroredGeometryBodyGroup for each body group

  • MirroredSurface for each surface belonging to those body groups (when surface ownership mapping is available)

Newly created mirrored entities use MIRROR_SUFFIX ("_<mirror>") as a name suffix.

Parameters:
  • entities (Union[List[GeometryBodyGroup], GeometryBodyGroup]) – One or more geometry body groups to mirror.

  • mirror_plane (MirrorPlane) – The mirror plane to use for mirroring.

Returns:

Mirrored geometry body groups and surfaces.

Return type:

tuple[List[MirroredGeometryBodyGroup], List[MirroredSurface]]

Raises:

Flow360RuntimeError – If inputs are of incorrect types, if the mirror plane name conflicts with an existing plane in the draft, or if mirroring is unavailable due to missing surface ownership mapping.

Notes

If a body group was previously mirrored, its existing derived mirrored entities are removed and replaced with the latest mirror plane request (a warning is logged).

remove_mirror_of(*, entities)[source]#

Remove the mirror of the given entities.

Parameters:

entities (Union[List[GeometryBodyGroup], GeometryBodyGroup]) – One or more geometry body groups to remove mirroring from.

Raises:

Flow360RuntimeError – If entities is not a GeometryBodyGroup or a list of GeometryBodyGroup instances.

Return type:

None