Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added geometry functionals in `physicsnemo.nn.functional` for
`mesh_poisson_disk_sample`, `mesh_to_voxel_fraction`, and
`signed_distance_field`.
- Added rendering functionals in `physicsnemo.nn.functional` for isosurface,
mesh, volume, LIC, point cloud, wireframe, and RGBA transfer rendering, with
Warp kernels for rendering and PyTorch fallbacks for transfer functions.
- Adds embedded OOD guardrail `OODGuard` at
`physicsnemo.experimental.guardrails.embedded`, optionally
wired into `GeoTransolver` via a new `guard_config` constructor argument.
Expand Down
81 changes: 81 additions & 0 deletions docs/api/nn/functionals/rendering.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Rendering Functionals
=====================

Rendering functionals convert tensor fields and geometric primitives into image
buffers. They follow the same stateless functional pattern as the rest of
``physicsnemo.nn.functional``: tensors in, tensors out, with implementation
dispatch handled through ``FunctionSpec``.

Isosurface Render
-----------------

.. autofunction:: physicsnemo.nn.functional.isosurface_render

.. rubric:: Visualization

This animation ray-marches a moving sphere isosurface from a scalar field and
colors the hit surface with an RGB volume.

.. figure:: /img/nn/functional/rendering/isosurface_render.gif
:alt: Isosurface render animation of a moving sphere
:width: 55%

Mesh Raycast
------------

.. autofunction:: physicsnemo.nn.functional.mesh_raycast

.. rubric:: Visualization

This animation renders a rotating cube mesh with per-vertex colors.

.. figure:: /img/nn/functional/rendering/mesh_raycast.gif
:alt: Mesh raycast animation of a rotating colored cube
:width: 55%

Scalar Field To RGBA
--------------------

.. autofunction:: physicsnemo.nn.functional.scalar_field_to_rgba

Line Integral Convolution
-------------------------

.. autofunction:: physicsnemo.nn.functional.line_integral_convolution

.. rubric:: Visualization

This animation shows a zoomed-out center slice through a 3D LIC field computed
from a rotating dipole vector field. The LIC texture modulates a jet-colored
field-magnitude image after starting from fixed random noise.

.. figure:: /img/nn/functional/rendering/line_integral_convolution.gif
:alt: Line integral convolution animation of a rotating dipole field
:width: 55%

This animation renders a steady 3D dipole LIC field as an RGBA volume with
``volume_render`` and overlays a rotating wireframe cube for spatial context.

.. figure:: /img/nn/functional/rendering/line_integral_convolution_3d.gif
:alt: Three-dimensional line integral convolution volume render with rotating cube
:width: 55%

Vector Field To RGBA
--------------------

.. autofunction:: physicsnemo.nn.functional.vector_field_to_rgba

Volume Render
-------------

.. autofunction:: physicsnemo.nn.functional.volume_render

Point Cloud Render
------------------

.. autofunction:: physicsnemo.nn.functional.point_cloud_render

Wireframe Render
----------------

.. autofunction:: physicsnemo.nn.functional.wireframe_render
1 change: 1 addition & 0 deletions docs/api/physicsnemo.nn.functionals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ in the documentation for performance comparisons.
nn/functionals/fourier_spectral
nn/functionals/regularization_parameterization
nn/functionals/interpolation
nn/functionals/rendering
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/nn/functional/rendering/mesh_raycast.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/nn/functional/rendering/mesh_raycast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions physicsnemo/nn/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
from .natten import na1d, na2d, na3d
from .neighbors import knn, radius_search
from .regularization_parameterization import drop_path, weight_fact
from .rendering import (
isosurface_render,
line_integral_convolution,
mesh_raycast,
point_cloud_render,
scalar_field_to_rgba,
vector_field_to_rgba,
volume_render,
wireframe_render,
)

__all__ = [
"irfft",
Expand All @@ -52,8 +62,11 @@
"imag",
"interpolation",
"knn",
"isosurface_render",
"legendre_polynomials",
"line_integral_convolution",
"mesh_green_gauss_gradient",
"mesh_raycast",
"meshless_fd_derivatives",
"mesh_lsq_gradient",
"mesh_poisson_disk_sample",
Expand All @@ -68,12 +81,17 @@
"rectilinear_grid_gradient",
"rfft",
"rfft2",
"point_cloud_render",
"scalar_field_to_rgba",
"signed_distance_field",
"smooth_log",
"spectral_grid_gradient",
"spherical_basis",
"uniform_grid_gradient",
"vector_field_to_rgba",
"vector_project",
"volume_render",
"view_as_complex",
"weight_fact",
"wireframe_render",
]
46 changes: 46 additions & 0 deletions physicsnemo/nn/functional/rendering/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .isosurface_render import IsosurfaceRender, isosurface_render
from .line_integral_convolution import (
LineIntegralConvolution,
line_integral_convolution,
)
from .mesh_raycast import MeshRaycast, mesh_raycast
from .point_cloud_render import PointCloudRender, point_cloud_render
from .scalar_field_to_rgba import ScalarFieldToRGBA, scalar_field_to_rgba
from .vector_field_to_rgba import VectorFieldToRGBA, vector_field_to_rgba
from .volume_render import VolumeRender, volume_render
from .wireframe_render import WireframeRender, wireframe_render

__all__ = [
"IsosurfaceRender",
"LineIntegralConvolution",
"MeshRaycast",
"PointCloudRender",
"ScalarFieldToRGBA",
"VectorFieldToRGBA",
"VolumeRender",
"WireframeRender",
"isosurface_render",
"line_integral_convolution",
"mesh_raycast",
"point_cloud_render",
"scalar_field_to_rgba",
"vector_field_to_rgba",
"volume_render",
"wireframe_render",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .isosurface_render import IsosurfaceRender, isosurface_render

__all__ = ["IsosurfaceRender", "isosurface_render"]
Loading
Loading