
Fri, 01/03/2025 - 19:55
Forums:
Hello all
when I set the displaymode=2 on an ais_shape I get a dotted line around the dimensions of TopoDS_Shape.
when I increase the dimensions of the TopoDS_Shape the dotted outline is updated correct - so far, so good.
but if I make a dimension of the TopoDS_Shape smaller, for example the length, the dotted line is not updated at all. But the selection is correct as you can see on the attached picture.
Any help is appreciated!
Attachments:
Fri, 03/07/2025 - 22:06
I bring this up again. I spend now many hours try to fix this. it becomes a real problem now.
let me explain again:
ais_shape, showing a BRepPrimAPI_MakeBox... and with displaymode (dm) 1:
when I change the dimensions of the shap and redisplay all is correct displayed. I can go larder and smaller no problem at all, in all display modes BUT 2
if I switch ONCE to display mode 2, and i increasy the size, all is good. but I can go smaller anymore then the size i had when switching to dm 2.
it is like in dm2 it only updates when it is increasing but not decreasing. This must be a bug.
I tried everything:
nothing works
I so need help here.
Thanks!
Sat, 03/08/2025 - 02:52
bbox is only accurate updated if it gets bigger
this always works correct
was hoping i can overwrite but this doesn't work
now I am out of ideas
Sat, 03/08/2025 - 17:39
AIS_Shape::Compute()
for display mode2
displays bounding box of a shape returned byAIS_Shape::BoundingBox()
.If you'll take a look at
AIS_Shape::BoundingBox()
implementation, you'll see that bounding box is cached inmyBB
and updated only when flagmyCompBB
is changed:and the only place where this flag is changed is
AIS_Shape::SetShape()
:Neither of the methods resets bounding box (
myBB.SetVoid()
or similar), hence it is only expanded, which is indeed a bug. You may file a bugfix to OCCT or workaround bug by clearingmyBB
on your own or implementing::Compute()
at application level.Anyway, if you really want to display box around the shape, then overriding
::Compute()
and displaying oriented bounding boxBRepBndLib::AddOBB()
instead of AABB might look better to user.Sat, 03/08/2025 - 18:49
Thank you!
Not sure if I have to do something now. Report that bug? Could you do this and I just wait until it is fixed?
Sat, 03/08/2025 - 19:36
Visualization - Bounding box is not decreasing for mode 2
PR: Visualization - AIS_Shape bounding box re-computation is not working properly
During today I will prepare the fix (at the moment writing a tests)
Mon, 03/10/2025 - 20:19
great news - thanks!
Sat, 03/08/2025 - 17:57
Test case:
Possible fix: