add 3D details methods#5
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds detailed path information methods (getDetailedPaths()) for both 2D and 3D beam tracing implementations. These methods return comprehensive reflection data including incidence/reflection angles, surface normals, segment lengths, cumulative distances, and grazing incidence detection. This enhancement enables acoustic analysis applications to access detailed geometric information about each reflection point in a path.
Key Changes
- Added new TypeScript interfaces for detailed path representations (
DetailedReflectionPath,DetailedReflectionPath3D,ReflectionDetail,ReflectionDetail3D,SegmentDetail,SegmentDetail3D) - Implemented
getDetailedPaths()methods in both 2D (Solverclass) and 3D (OptimizedSolver3DandSolver3Dclasses) that convert simple paths to detailed paths with full reflection information - Added comprehensive test coverage (340+ test cases) covering functionality, edge cases, and numerical correctness
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/types.ts |
Added detailed reflection type definitions for 3D with proper type imports |
src/solver/solver3d.ts |
Implemented getDetailedPaths() method and helper functions (calculateIncidenceAngle3D, getOrientedNormal3D, convertToDetailedPath3D) for 3D reflection analysis |
src/beamtrace2d.ts |
Implemented getDetailedPaths() method and helper functions for 2D reflection analysis, including wall position calculation |
src/beamtrace3d.ts |
Exported new types and functions, added getDetailedPaths() wrapper method to Solver3D class |
src/__tests__/solver3d.test.ts |
Added 370+ lines of comprehensive tests for 3D detailed paths functionality |
src/__tests__/beamtrace2d.test.ts |
Added 540+ lines of comprehensive tests for 2D detailed paths functionality |
README.md |
Updated documentation with API reference for new types, methods, and usage examples |
.gitignore |
Added entries for dist files (with one duplicate entry) |
.eslintrc.json |
Added *.js pattern to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.