-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: enable rendering of walls defined in LAMMPS #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add WallInfo struct and getDimension()/getWalls() methods to LAMMPSWeb - Extract wall data from FixWall instances (EDGE and CONSTANT styles) - Add embind bindings for wall data access from JavaScript - Include compiled WASM and JS bindings
- Add Wall interface to types.ts - Add dimension and walls state to simulationStatus store - Sync walls from LAMMPS each frame in processing pipeline - Add setDimension() and setWalls() actions
- Add createWallMesh() to create individual wall meshes - Add createWallGroup() to create group of all walls - Add isTriclinicBox() to detect triclinic boxes (skip wall rendering) - Use infinitely thin planes for 3D (quaternion-based rotation) - Use thin planes with min thickness for 2D visibility - Walls positioned at exact boundary, facing inward
- Add wall group rendering with createWallGroup() - Add disposeWallGroup() with proper cleanup checks - Update disposeBoxGroup() to check scene membership before removal - Add useEffect to sync wall rendering with state changes - Respect showWalls setting from render settings
- Add showWalls boolean to RenderSettings interface - Add Show walls checkbox to Settings UI - Default value is true (walls visible by default) - Setting persists to localStorage
- Add 2D LJ walls example (2d-lj-walls.in) - Add 3D LJ walls example (3d-lj-walls.in) with 5 non-interacting particles - Update examples.json with wall example entries - Examples demonstrate transparent wall rendering in 3D and thick slabs in 2D
The box boundary already provides visual feedback for 2D systems. Wall rendering as thin planes doesn't work well visually in 2D.
Set WALL_OPACITY to 0.1 for a more subtle glass effect.
Set WALL_OPACITY to 0.04 for an even more subtle effect.
Summary of ChangesHello @andeplane, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the visualization capabilities by introducing the rendering of walls defined in LAMMPS simulations. It provides the necessary backend infrastructure to extract wall data, implements a robust Three.js-based frontend rendering system for these walls, and integrates user controls and embedded URL support for seamless interaction. This allows users to better understand simulations involving confined particles or boundaries. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces the capability to visualize walls defined in LAMMPS simulations, supporting both fix wall/reflect and fix wall/lj*. The changes include new C++ methods in LAMMPSWeb to extract wall data, integration into the frontend to render these walls using Three.js, and new settings to control their visibility. Additionally, the PR adds new example simulations demonstrating wall interactions and improves geometry utilities with comprehensive unit tests. Resource management for Three.js objects is correctly handled to prevent memory leaks. The implementation is robust and well-tested.
Summary
This PR enables the visualization of walls defined in LAMMPS using
fix wall/reflectandfix wall/lj*.Key Features:
LAMMPSWebto retrieve simulation dimension and wall data (type, position, style).Technical Details:
THREE.PlaneGeometrywith quaternions for accurate 3D plane orientation.fix wall).Test Plan
npm test -- src/utils/wallGeometry.test.ts src/utils/boxGeometry.test.tsto verify geometry logic.