Skip to content

issue#262 error in bounding box computation#239

Open
mpoudot wants to merge 1 commit into
mainfrom
issue#262
Open

issue#262 error in bounding box computation#239
mpoudot wants to merge 1 commit into
mainfrom
issue#262

Conversation

@mpoudot
Copy link
Copy Markdown
Contributor

@mpoudot mpoudot commented Apr 24, 2026

…edge or surface

@mpoudot mpoudot requested a review from nicolaslg April 24, 2026 12:59
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.87%. Comparing base (8210518) to head (b7f4b79).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
+ Coverage   48.86%   48.87%   +0.01%     
==========================================
  Files         466      466              
  Lines       50515    50523       +8     
==========================================
+ Hits        24682    24693      +11     
+ Misses      25833    25830       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicolaslg
Copy link
Copy Markdown
Collaborator

BEWARE : copy-pasting the sphere creation command does not work properly.

The BRepBndLib::AddClose can not be applied in our case, as it expects the shape to be polygonal with planar faces (see https://dev.opencascade.org/doc/refman/html/class_b_rep_bnd_lib.html#a1c5a09bca57f8145e163c59693a45bbf).
The analyzer.IsValid() does not check that property (see https://dev.opencascade.org/doc/refman/html/class_b_rep_check___analyzer.html#a99892412af7e25fb4d5c19c7d54a41fb)

I think checking whether the returned bounding box is flat is not sufficient. Considering a volume and the created block

ctx.getGeomManager().newSphere (Mgx3D.Point(0, 0, 0), 1, 125)
ctx.getTopoManager().newFreeTopoOnGeometry ("Vol0000")

Currently in the branch is returned the following block :
current

When always calling BRepBndLib::Add(shape, box) instead we have this behavior, which is what we expect :

add_sphere

But when the sphere is scaled, the call to BRepBndLib::Add(shape, box) will return a bounding box that is not "correct"

ctx.getGeomManager().scaleAll(1.000000e+01, 2.000000e+01, 1.000000e+01)
add_scale

Whereas calling BRepBndLib::AddOptimal(shape, box) gives
addoptimal_scale

BRepBndLib::AddOptimal(shape, box), or rather BRepBndLib::AddOptimal(shape, box, false) might be the better choice; I have not managed to exhibit differences when the third parameter useTriangulation==false. I guess it is better still to put it at false considering we want to behave the same way whether a triangulation is attached to the shapes or not.

@nicolaslg nicolaslg changed the title Add test for plane boundaryBox where TopoDS_Shape is neither vertex, … issue#262 error in bounding box computation Apr 29, 2026
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