Skip to content
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

feat(geospatial): Add makeOBBFromRegion() #43

Merged
merged 13 commits into from
Jan 4, 2025
Merged

Conversation

ibgreen
Copy link
Contributor

@ibgreen ibgreen commented Jan 4, 2025

This is a restructuring of @sraimund 's work in PR #40 to resolve some intermodule dependencies and naming choices.


Here the ported code from Cesium to fix the calculation of the bounding box from a region on the WGS84 ellipsoid (see issue visgl/loaders.gl#3144). The function signature fromRegion() in oriented-bounding-box.ts (math.gl/culling) is similar to the previous createObbFromRegion function in bounding-volume.ts (loaders.gl/tiles). The other functions are nearly a 1:1 mapping from Cesium, except that these are now class methods.

Test:
https://stackblitz.com/edit/stackblitz-starters-pode72re (takes ~2mins to build and load)

Notes:

I could only build the culling module when adding // @ts-ignore // eslint-disable-next-line import/no-unresolved above import {Ellipsoid} from '@math.gl/geospatial'; in oriented-bounding-box.ts and import {Ellipsoid} from '@math.gl/geospatial'; in ellipsoid-tangent-plane.ts.

I'm not sure whether the 'lint' command worked correctly since it only showed some warnings for the dev-docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12613161361

Details

  • 199 of 660 (30.15%) changed or added relevant lines in 13 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.8%) to 83.124%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/culling/src/lib/plane.ts 11 31 35.48%
modules/core/src/classes/matrix3.ts 19 49 38.78%
modules/geospatial/src/lng-lat-rectangle.ts 37 67 55.22%
modules/core/src/lib/common.ts 33 67 49.25%
modules/geospatial/src/ellipsoid-tangent-plane.ts 54 98 55.1%
modules/geospatial/src/make-obb-from-region.ts 0 303 0.0%
Totals Coverage Status
Change from base Build 12612903339: -1.8%
Covered Lines: 14996
Relevant Lines: 18228

💛 - Coveralls

@ibgreen ibgreen merged commit 0a0dfb5 into master Jan 4, 2025
1 check passed
@ibgreen ibgreen deleted the sraimund-master branch January 4, 2025 19:46
sraimund added a commit to sraimund/math.gl that referenced this pull request Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants