Skip to content

Conversation

@jafranc
Copy link
Collaborator

@jafranc jafranc commented Sep 5, 2025

This PR introduces a new clipToMainFrame.py modifiers that derive the translation and rotation a hexahedral domain has undergone and revert it so the mesh has one extermal vertices set to (0,0,0) and is aligned with (X,Y,Z)

This PR includes:

  • clipToMainFrame.py that introduces:

    • a VTK Object ClipToMainFrame that inherits from vtkLandMarkTransform setting its SourcePts and TargetPts from mesh. It leverages to its best Object Bounding Box Tree struct to get is local frame.
    • a VTK Filter ClipToMainFrame that inherits from vtkTransformFilter and is handling vtkMultiBlockDataSet by fetching the block whose cell is selected as origin and computing rotation, translation from it to be applied globally
  • test_clipToMainFrame.py that includes such :

    • hexahedral mesh randomly rotated and translated and test the above utlis. For now it is only checking that the mesh:

      • did not change in number of cells and points
      • that the lowest bound is indeed (0,0,0)
      • that the domaine is not scaled by checking diagonal meas persistence
      • that it is align with (X,Y,Z)
    • a multiBlock mesh imported from reader to check integration (but nothing else)

@jafranc jafranc self-assigned this Sep 5, 2025
@jafranc jafranc changed the title Jafranc/feat/translate and rotate feat: translate and rotate domains to clip the main frame Sep 5, 2025
Copy link
Contributor

@RomainBaville RomainBaville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests failed for me, may be an issue with the origin.

from geos.mesh.utils.genericHelpers import getMultiBlockBounds

import numpy as np
import logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An internal logger have been inplemented in geos.utils.Logger. You may give the chose to the user to use a personal handler (usefull for paraview) an use the internal logger by defaults.

Copy link
Contributor

@RomainBaville RomainBaville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good for me, you just may add typing for all your variable.

@paloma-martinez paloma-martinez merged commit 9f54db6 into main Sep 18, 2025
43 of 44 checks passed
@paloma-martinez paloma-martinez deleted the jafranc/feat/translateAndRotate branch September 18, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants