Mon, 01/09/2023 - 11:59
Forums:
I want to create a bounding box for a created shape box. Below is the basic code attached.
void MakeBox()
{
BRepPrimAPI_MakeBox abox(1, 1, 1);
TopoDS_Solid aShape = abox.Solid();
Bnd_Box box;
BRepBndLib::Add(aShape, box);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
box.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
Handle(AIS_Shape) aShapePrs = new AIS_Shape(aShape); // creation of the presentable object
myAISContext()->Display(aShapePrs, AIS_Shaded, 0, true); // display the presentable object and redraw 3d viewer
FitAll();
}
Mon, 01/09/2023 - 12:18
So, you have created the Bnd_Box from your shape. What doesn't work?
Mon, 01/09/2023 - 12:49
I want to print it out on the screen.
Mon, 01/09/2023 - 14:01
As highlighting style of
AIS_Shape
(seeAspect_TOHM_BOUNDBOX
orAIS_Shape::SetHilightMode(2)
) or as a dedicated interactive object?Mon, 01/09/2023 - 18:49
It seems you need to display the shape in the viewer. Is that right?