Merged
Conversation
bschwind
approved these changes
Jun 22, 2025
Owner
bschwind
left a comment
There was a problem hiding this comment.
LGTM, thanks! I'd like to format the decimal literals in bounding_box.rs but I'll handle that.
Contributor
Author
|
Ah thanks! Sorry I missed those! |
Owner
|
No worries! I wish rustfmt had a stable option to format them so you don't even have to think about it. I think someone had proposed it but I don't know if it ever got implemented. |
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.
Summary
bounding_boxmodule wrappingBnd_BoxandBRepBndLibbounding_boxexampleDescription
I need to compute bounding boxes of OCC geometry for a project that uses
opencascade. Thankfully, OCC has theBRepBndLibpackage that supports this already. This adds a wrapper for theBRepBndLib::Addmethod and the underlyingBnd_Boxclass on which it depends.To support this and show how to use it, there are a few simple tests and an example that uses the viewer to show the bounded and bounding geometry.
One thing that I didn't understand, but that I assume is important to the underlying algorithms in OCC, is that the
Bnd_Boxhas a smallGapvalue that is added to every dimension of the box. I decided to expose this asgap_vecto make it easier to work with in the rust side and tried to document it clearly.