Skip to content

Commit

Permalink
add ascent transform filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Oct 18, 2024
1 parent c6d5e2e commit bd75d6e
Show file tree
Hide file tree
Showing 15 changed files with 489 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added a `topologies` option to the relay extract. This allows you to select which topologies are saved. This option can be used with the existing `fields` option, the result is the union of the selected topologies and fields.
- Added `near_plane` and `far_plane` to the camera details provided in Ascent::info()
- Added `add_mpi_ranks` and `add_domain_ids` filters for adding rank and domain fields to a mesh
- Added `transform` filter, which allows you to rotate, scale, translate, mesh coordinates

### Changed
- Changed the replay utility's binary names such that `replay_ser` is now `ascent_replay` and `raplay_mpi` is now `ascent_replay_mpi`. This will help prevent potential name collisions with other tools that also have replay utilities.
Expand Down
94 changes: 73 additions & 21 deletions src/docs/sphinx/Actions/Pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,8 @@ filter to extract the intersection of what remains from the threshold with a sph
ascent.execute(actions);
ascent.close();

Ascent and VTK-h are under heavy development and features are being added rapidly.
As we stand up the infrastructure necessary to support a wide variety filter we created the following filters for the alpha release:

- Contour
- Threshold
- Slice
- Three Slice
- Automatic Slice
- Clip
- Clip by field
- Isovolume
- Vector magnitude

Ascent is under active development and features are being added rapidly.
In the following section we provide brief descriptions and code examples of the supported filters.
For complete code examples, please consult the unit tests located in ``src/tests/ascent``..

Expand All @@ -103,16 +92,12 @@ Filters
-------
Our filter API consists of the type of filter and the parameters associated with the filter in the general form:

.. code-block:: json
.. code-block:: yaml
{
"type" : "filter_name",
"params":
{
"string_param" : "string",
"double_param" : 2.0
}
}
type: "filter_name"
params:
string_param: "string"
double_param: 2.0
In c++, the equivalent declarations would be as follows:

Expand Down Expand Up @@ -607,6 +592,73 @@ values are removed from the data set.

An example of creating a iso-volume of values between 5.0 and 10.0.

Transform
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The transform filter allows you to scale, translate, and rotate your mesh.
It also accepts a general 4x4 transformation matrix.

Translate Example:

.. code-block:: yaml
-
action: "add_pipelines"
pipelines:
pl1:
f1:
type: "transform"
params:
translate:
x: 23.0
y: 15.0
Scale Example:

.. code-block:: yaml
-
action: "add_pipelines"
pipelines:
pl1:
f1:
type: "transform"
params:
scale:
x: 2.0
y: 0.5
z: 2.0
Rotate Example:

.. code-block:: yaml
-
action: "add_pipelines"
pipelines:
pl1:
f1:
type: "transform"
params:
rotate:
angle: 45.0
axis:
y: 1.0
Matrix Example:

.. code-block:: yaml
-
action: "add_pipelines"
pipelines:
pl1:
f1:
type: "transform"
params:
matrix: [2.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 50.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 1.0]
Particle Advection
~~~~~~~~~~~~~~~~~~~~
The particle advection filter distributes some number of weightless particles over a user-specified vector field (``field``) and, given some advection distance (``step_size``), advects them for some number of advection steps (``num_steps``).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ register_builtin()
AscentRuntime::register_filter_type<VTKHGradient>("transforms","gradient");
AscentRuntime::register_filter_type<VTKHDivergence>("transforms","divergence");
AscentRuntime::register_filter_type<VTKHVorticity>("transforms","vorticity");
AscentRuntime::register_filter_type<VTKHTransform>("transforms","transform");
AscentRuntime::register_filter_type<VTKHScale>("transforms","scale");
AscentRuntime::register_filter_type<VTKHProject2d>("transforms","project_2d");
AscentRuntime::register_filter_type<VTKHTriangulate>("transforms","triangulate");
Expand Down
Loading

0 comments on commit bd75d6e

Please sign in to comment.