youngbin son Wed, 12/02/2020 - 08:15 Forums: Modeling Data and AlgorithmsHi . I want to convert Bnd_Box to TopoDS_Shape . How do this? Is there any class that have that function? Kirill Gavrilov Wed, 12/02/2020 - 10:10 Bnd_Box (AABB) is not a shape, so it is unclear what kind of shape you expect to see (solid? lines?). Solid could be created using BRepPrimAPI_MakeBox class (Bnd_OBB has a constructor from Bnd_Box), as done by Draw Harness command bounding: TopoDS_Solid ConvertBndToShape (const Bnd_OBB& theBox) { const gp_Pnt aBaryCenter = theBox.Center(); const gp_XYZ aXDir = theBox.XDirection(), aYDir = theBox.YDirection(), aZDir = theBox.ZDirection(); Standard_Real aHalfX = theBox.XHSize(), aHalfY = theBox.YHSize(), aHalfZ = theBox.ZHSize(); gp_Ax2 anAxes (aBaryCenter, aZDir, aXDir); anAxes.SetLocation (aBaryCenter.XYZ() - aHalfX * aXDir - aHalfY * aYDir - aHalfZ * aZDir); return BRepPrimAPI_MakeBox (anAxes, 2.0 * aHalfX, 2.0 * aHalfY, 2.0 * aHalfZ); } Log in to post comments youngbin son Thu, 12/03/2020 - 07:25 Thank you. Log in to post comments
Wed, 12/02/2020 - 10:10
Bnd_Box (AABB) is not a shape, so it is unclear what kind of shape you expect to see (solid? lines?).
Solid could be created using BRepPrimAPI_MakeBox class (Bnd_OBB has a constructor from Bnd_Box), as done by Draw Harness command bounding:
Thu, 12/03/2020 - 07:25
Thank you.