Skip to content

Commit 2c21f2e

Browse files
docs: Add migration guide and update documentation for v0.4.2 (#49)
* docs: Add comprehensive migration guide - Create docs/src/guides/migration.md with version-specific migration instructions - Document v0.4.2 performance features and how to use them - Include v0.4.1 breaking changes (apply_eclipse_shadowing! API) - Add v0.4.0 unified illumination API migration - List future deprecations planned for v0.5.0 - Add migration guide to documentation navigation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Update README for v0.4.2 release - Reorganize Key Features section for better clarity - Separate Geometric Properties into face and shape properties - Clarify illumination analysis shadowing models - Add What's New in v0.4.2 section highlighting performance improvements - Move face properties access example earlier in Quick Start - Replace API Migration Guide section with link to comprehensive guide - General cleanup and improved organization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Update ROADMAP with v0.4.2 status - Mark v0.4.2 milestone as released - Update PR references for completed tasks - Clean up formatting and structure - Reflect current development status 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Update release dates to YYYY-MM-DD format - v0.4.0: July 2025 → 2025-07-08 - v0.4.1: July 2025 → 2025-07-10 - v0.4.2: July 21, 2025 → 2025-07-21 * docs: Reorganize ROADMAP.md for v0.5.0 - Move breaking changes into API Improvements section - Reorder sections: Major Features → API Improvements → Performance - Simplify performance enhancement items - Remove redundant details for cleaner structure --------- Co-authored-by: Claude <[email protected]>
1 parent 6a378ae commit 2c21f2e

File tree

4 files changed

+141
-69
lines changed

4 files changed

+141
-69
lines changed

README.md

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,26 @@ For future development plans, see our [Development Roadmap](ROADMAP.md).
2121
## Key Features
2222

2323
- **Shape Model Loading**: Load 3D models in OBJ file format
24-
- **Face Geometric Properties**: Calculate face centers, normal vectors, and areas
24+
- **Geometric Properties**:
25+
- Face properties: Calculate face centers, normal vectors, and areas
26+
- Shape properties: Compute volume, equivalent radius, and maximum/minimum radii
2527
- **Ray Intersection Detection**: High-precision ray-triangle intersection using the Möller–Trumbore algorithm with BVH (Bounding Volume Hierarchy) acceleration for efficient computation
2628
- **Batch Ray Processing**: Process multiple rays efficiently in vectors or matrices while preserving input structure
2729
- **Visibility Analysis**: Calculate visibility and view factors between faces
2830
- Optimized non-BVH algorithm with candidate filtering for face-to-face visibility
2931
- Distance-based sorting provides ~2x speedup over naive approaches
3032
- **Illumination Analysis**: Determine face illumination states with flexible shadowing models
31-
- **Unified API**: Single interface with configurable self-shadowing effects
32-
- **Batch Updates**: Efficient illumination state updates for all faces
33-
- **Binary Asteroid Support**: Mutual shadowing and eclipse detection for binary systems
34-
- **Shape Characteristics**: Calculate volume, equivalent radius, maximum and minimum radii
33+
- Pseudo-convex model for fast computation (only face orientation check)
34+
- Self-shadowing model for accurate shading (considers occlusions from other faces)
35+
- Mutual shadowing (eclipse) detection for a binary asteroid
36+
37+
## What's New in v0.4.2
38+
39+
- **Performance Optimization**: Face maximum elevation pre-computation provides ~2.5x speedup for illumination calculations with self-shadowing
40+
- **Enhanced Eclipse Detection**: More accurate total eclipse detection for non-spherical shapes
41+
- **Ray-Sphere Utilities**: New geometric utilities for cleaner eclipse calculations
42+
43+
For detailed migration instructions between versions, see the [Migration Guide](https://astroshaper.github.io/AsteroidShapeModels.jl/dev/guides/migration/).
3544

3645
## Requirements
3746

@@ -70,6 +79,11 @@ shape = load_shape_obj("path/to/shape.obj"; scale=1000, with_face_visibility=tru
7079
# build_face_visibility_graph!(shape)
7180
# build_bvh!(shape)
7281

82+
# Access to face properties
83+
shape.face_centers # Center position of each face
84+
shape.face_normals # Normal vector of each face
85+
shape.face_areas # Area of of each face
86+
7387
# Single ray intersection (requires BVH to be built)
7488
ray = Ray(SA[1000.0, 0.0, 0.0], SA[-1.0, 0.0, 0.0])
7589
result = intersect_ray_shape(ray, shape)
@@ -102,38 +116,6 @@ P2S = SA[1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 1.0] # Rotation matrix
102116
# Check for eclipse shadowing
103117
status = apply_eclipse_shadowing!(illuminated_faces, shape1, shape2, sun_pos1, secondary_pos, P2S)
104118
# Returns: NO_ECLIPSE, PARTIAL_ECLIPSE, or TOTAL_ECLIPSE
105-
106-
# Access to face properties
107-
shape.face_centers # Center position of each face
108-
shape.face_normals # Normal vector of each face
109-
shape.face_areas # Area of of each face
110-
```
111-
112-
## API Migration Guide (v0.4.1)
113-
114-
### New `apply_eclipse_shadowing!` API
115-
116-
The new API provides more intuitive parameter ordering for SPICE integration:
117-
118-
```julia
119-
# Old API (deprecated, will be removed in v0.5.0)
120-
apply_eclipse_shadowing!(illuminated_faces, shape1, r☉₁, R₁₂, t₁₂, shape2)
121-
122-
# New API (recommended)
123-
apply_eclipse_shadowing!(illuminated_faces, shape1, shape2, r☉₁, r₁₂, R₁₂)
124-
# where r₁₂ is shape2's position in shape1's frame (directly from SPICE)
125-
```
126-
127-
### Parameter Naming Changes
128-
129-
All batch illumination functions now use `illuminated_faces` instead of `illuminated`:
130-
131-
```julia
132-
# Old
133-
update_illumination!(illuminated, shape, sun_pos; with_self_shadowing=true)
134-
135-
# New
136-
update_illumination!(illuminated_faces, shape, sun_pos; with_self_shadowing=true)
137119
```
138120

139121
## License

ROADMAP.md

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
This document outlines the development plans and milestones for `AsteroidShapeModels.jl`. We use [Semantic Versioning](https://semver.org/) for version numbering.
44

5-
## Version 0.4.0 - BVH Integration and Optimization (Released: July 2025)
5+
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on how to get involved.
6+
7+
Please check our [GitHub Issues](https://github.com/Astroshaper/AsteroidShapeModels.jl/issues) for current tasks and discussions.
8+
9+
## Version 0.4.0 - BVH Integration and Optimization (Released: 2025-07-08)
610

711
### Major Changes (Breaking Changes)
812
- **Full Integration of `ImplicitBVH.jl`**
@@ -26,7 +30,7 @@ This document outlines the development plans and milestones for `AsteroidShapeMo
2630
- [x] Add comprehensive BVH usage documentation
2731
- [x] Update examples for new APIs
2832

29-
## Version 0.4.1 - API Improvements (Released: July 2025)
33+
## Version 0.4.1 - API Improvements (Released: 2025-07-10)
3034

3135
### Completed
3236
- **Improved `apply_eclipse_shadowing!` API**
@@ -41,7 +45,7 @@ This document outlines the development plans and milestones for `AsteroidShapeMo
4145
- Now correctly recovers shape2's position using `r₁₂ = -R₁₂' * t₁₂`
4246
- [x] Fixed sun position transformation in eclipse shadowing (include rotation + translation)
4347

44-
## Version 0.4.2 - Performance Optimizations (Target: August 2025)
48+
## Version 0.4.2 - Performance Optimizations (Released: 2025-07-21)
4549

4650
### Performance Features
4751
- **Face Maximum Elevation Precomputation**
@@ -61,9 +65,6 @@ This document outlines the development plans and milestones for `AsteroidShapeMo
6165
## Version 0.5.0 - Advanced Surface Modeling (Target: September 2025)
6266

6367
### Major Features
64-
- **Breaking Changes**
65-
- [ ] Remove `use_elevation_optimization` parameter from illumination APIs
66-
- [ ] Make face maximum elevation optimization the default implementation
6768
- **Hierarchical Surface Roughness Model**
6869
- [ ] Support nested shape models for multi-scale surface representation
6970
- [ ] Implement efficient traversal algorithms for nested structures
@@ -74,27 +75,25 @@ This document outlines the development plans and milestones for `AsteroidShapeMo
7475
- [ ] Implement Fractal surface generation
7576
- [ ] Add comprehensive test coverage for roughness features
7677

77-
- **Performance Enhancements**
78-
- [ ] Add basic multi-threading support using `Threads.jl`
79-
- [ ] Optimize critical paths for better single-threaded performance
80-
- [ ] **Optimize `apply_eclipse_shadowing!` memory allocations**
81-
- Current implementation calls `intersect_ray_shape` per face, causing ~200 allocations per call
82-
- Implement true batch ray tracing with pre-allocated buffers for mutual shadowing
83-
- Design `EclipseShadowingBuffer` struct to hold reusable arrays
84-
- Implement filtering that preserves early-out optimizations
85-
- Ensure zero allocations during runtime after initial buffer creation
86-
- [ ] Add multi-threading support to `apply_eclipse_shadowing!` using `@threads`
87-
- [ ] Implement spatial data structures (e.g., octree) to pre-filter potentially shadowed faces
88-
- [ ] Add caching for temporal coherence in simulations with small time steps
89-
9078
### API Improvements
9179
- [ ] Remove deprecated `apply_eclipse_shadowing!` signature that uses `t₁₂` parameter
9280
- Old signature: `apply_eclipse_shadowing!(illuminated_faces, shape1, r☉₁, R₁₂, t₁₂, shape2)`
9381
- Keep only the new signature with `r₁₂` parameter introduced in v0.4.1
82+
- [ ] Remove `use_elevation_optimization` parameter from illumination APIs
83+
- Make face maximum elevation optimization the default implementation
9484
- [ ] Unify parameter naming conventions across the package
9585
- [ ] Create configuration structs for complex operations
9686
- [ ] Improve error messages and validation
9787

88+
### Performance Enhancements
89+
- [ ] **Optimize `apply_eclipse_shadowing!` memory allocations**
90+
- Current implementation calls `intersect_ray_shape` per face, causing ~200 allocations per call
91+
- Implement true batch ray tracing with pre-allocated buffers for mutual shadowing
92+
- Design `EclipseShadowingBuffer` struct to hold reusable arrays
93+
- Implement filtering that preserves early-out optimizations
94+
- Ensure zero allocations during runtime after initial buffer creation
95+
- [ ] Add basic multi-threading support using `Threads.jl`
96+
9897
## Version 0.6.0 - High-Performance Computing Support (Target: October 2025)
9998

10099
### Major Features
@@ -121,16 +120,3 @@ This document outlines the development plans and milestones for `AsteroidShapeMo
121120

122121
- **Extended File Format Support**
123122
- PLY/STL/VTK/DSK format support
124-
125-
## Contributing
126-
127-
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on how to get involved.
128-
129-
## Tracking Progress
130-
131-
Development progress is tracked through:
132-
- GitHub Milestones for each version
133-
- GitHub Issues for specific features and bugs
134-
- Pull Requests for implementation
135-
136-
Please check our [GitHub Issues](https://github.com/Astroshaper/AsteroidShapeModels.jl/issues) for current tasks and discussions.

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ makedocs(;
1717
"Tutorial" => "tutorial.md",
1818
"Guides" => [
1919
"BVH Usage" => "guides/bvh_usage.md",
20+
"Migration Guide" => "guides/migration.md",
2021
],
2122
"API Reference" => [
2223
"Types" => "api/types.md",

docs/src/guides/migration.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Migration Guide
2+
3+
This guide helps you migrate your code when upgrading between major versions of `AsteroidShapeModels.jl`.
4+
5+
## Migrating to v0.4.2
6+
7+
### New Performance Features
8+
9+
#### Face Maximum Elevation Optimization
10+
11+
The v0.4.2 release includes automatic performance optimizations for illumination calculations. No code changes are required to benefit from these improvements.
12+
13+
```julia
14+
# Your existing code works as before, but ~2.5x faster!
15+
illuminated = isilluminated(shape, sun_position, face_idx; with_self_shadowing=true)
16+
```
17+
18+
To disable the optimization (not recommended):
19+
```julia
20+
# Explicitly disable optimization
21+
illuminated = isilluminated(
22+
shape, sun_position, face_idx;
23+
with_self_shadowing=true,
24+
use_elevation_optimization=false,
25+
)
26+
```
27+
28+
## Migrating to v0.4.1
29+
30+
### Breaking Changes
31+
32+
#### New `apply_eclipse_shadowing!` API
33+
34+
The parameter order has been changed for better SPICE integration:
35+
36+
```julia
37+
# Old API (deprecated)
38+
apply_eclipse_shadowing!(illuminated_faces, shape1, r☉₁, R₁₂, t₁₂, shape2)
39+
40+
# New API (recommended)
41+
apply_eclipse_shadowing!(illuminated_faces, shape1, shape2, r☉₁, r₁₂, R₁₂)
42+
```
43+
44+
Key differences:
45+
- `shape1` and `shape2` are now grouped together
46+
- `r₁₂` (shape2's position in shape1's frame) replaces `t₁₂`
47+
- More intuitive parameter ordering
48+
49+
Migration example:
50+
```julia
51+
# If you have t₁₂, convert it to r₁₂:
52+
r₁₂ = -R₁₂' * t₁₂
53+
54+
# Then use the new API:
55+
apply_eclipse_shadowing!(illuminated, shape1, shape2, sun_position, r₁₂, R₁₂)
56+
```
57+
58+
## Migrating to v0.4.0
59+
60+
### New Unified Illumination API
61+
62+
The illumination functions have been unified into a single API:
63+
64+
```julia
65+
# Old APIs (removed)
66+
isilluminated_pseudoconvex(shape, sun_position, face_idx)
67+
isilluminated_with_self_shadowing(shape, sun_position, face_idx)
68+
69+
# New unified API
70+
isilluminated(shape, sun_position, face_idx; with_self_shadowing=false) # pseudo-convex
71+
isilluminated(shape, sun_position, face_idx; with_self_shadowing=true) # with shadowing
72+
```
73+
74+
### Batch Processing
75+
76+
New batch processing functions for better performance:
77+
78+
```julia
79+
# Process all faces at once
80+
illuminated = Vector{Bool}(undef, length(shape.faces))
81+
update_illumination!(illuminated, shape, sun_position; with_self_shadowing=true)
82+
```
83+
84+
## Future Deprecations (v0.5.0)
85+
86+
### Planned Removals
87+
88+
1. **`use_elevation_optimization` parameter**
89+
- Will be removed in v0.5.0
90+
- Optimization will become the default behavior
91+
- Start removing explicit `use_elevation_optimization=true` from your code
92+
93+
2. **Old `apply_eclipse_shadowing!` signature**
94+
- The deprecated signature with `t₁₂` will be removed
95+
- Migrate to the new API with `r₁₂` parameter
96+
97+
## Getting Help
98+
99+
If you encounter issues during migration:
100+
101+
1. Check the [CHANGELOG](https://github.com/Astroshaper/AsteroidShapeModels.jl/blob/main/CHANGELOG.md) for detailed changes
102+
2. Review the [API documentation](https://astroshaper.github.io/AsteroidShapeModels.jl/stable)
103+
3. Open an [issue](https://github.com/Astroshaper/AsteroidShapeModels.jl/issues) on GitHub

0 commit comments

Comments
 (0)