Draft
Conversation
Add VDBExporter class to export 3D volumetric field data to OpenVDB format (.vdb files) for visualization and animation in Blender and other VFX software. Features: - Export any combination of field components (Ex, Ey, Ez, Hx, Hy, Hz) - Configurable export interval (every N simulation steps) - Optional normalization to [-1, 1] range for Blender shader compatibility - Preserves voxel spacing from simulation resolution - Stores metadata (time, step, field name) in VDB files - Integrated into Simulation.run() with save_vdb parameter Usage: sim.run(save_vdb='vdb_output', vdb_fields=['Ez', 'Hy'], vdb_interval=10)
This commit introduces a new example script demonstrating a compact 3D MMI waveguide splitter. The example includes detailed documentation on the physical principles, geometry, and parameters of the design, as well as instructions for exporting simulation results to VDB format for visualization in Blender. The simulation setup and execution are integrated, allowing users to visualize wave propagation and power splitting in the MMI structure.
This commit modifies the VDBExporter class to check for the availability of both pyopenvdb and openvdb libraries, allowing for greater compatibility across platforms. The pyproject.toml file is updated to include installation notes for openvdb via conda for users on unsupported platforms. Additionally, voxel size handling is improved for better visualization in Blender.
This commit updates the VDBExporter and Simulation classes to support exporting electric field magnitude |E| with optional logarithmic scaling for better dynamic range visualization in Blender. The default export behavior now includes magnitude fields, which reveal wave structures more effectively than individual components. Additionally, new parameters for log scaling and epsilon handling are introduced, along with comprehensive updates to the example script to reflect these changes. Documentation is enhanced to clarify the benefits of using magnitude fields over component fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add VDBExporter class to export 3D volumetric field data to OpenVDB format (.vdb files) for visualization and animation in Blender and other VFX software.
Features:
Usage:
sim.run(save_vdb='vdb_output', vdb_fields=['Ez', 'Hy'], vdb_interval=10)