In Draw Harness, commands bounding and vbounding are intended to display bounding box of shape or presentation. bounding command can also print AABB and OBB values.
pload MODELING VISUALIZATION
psphere s 1
# 3D Viewer
vclear
vinit View1
vdisplay -dispMode 1 s
vfit
vbounding s
# axo viewer
axo
bounding s
fit
Tue, 11/19/2019 - 06:25
the code from my app's lua interface,first build the bndbox wire shape,the add the shape two your shape renderer
function MakeBndShape(xmin,ymin,zmin,xmax,ymax,zmax)
P1=OCC.gp_Pnt(xmin,ymin,zmin)
P2=OCC.gp_Pnt(xmax,ymin,zmin)
P3=OCC.gp_Pnt(xmax,ymax,zmin)
P4=OCC.gp_Pnt(xmin,ymax,zmin)
P5=OCC.gp_Pnt(xmin,ymin,zmax)
P6=OCC.gp_Pnt(xmax,ymin,zmax)
P7=OCC.gp_Pnt(xmax,ymax,zmax)
P8=OCC.gp_Pnt(xmin,ymax,zmax)
bottom=OCC.BRepBuilderAPI_MakePolygon(P1,P2,P3,P4,true):Shape()
top=OCC.BRepBuilderAPI_MakePolygon(P5,P6,P7,P8,true):Shape()
e1=OCC.BRepBuilderAPI_MakeEdge(P1,P5):Shape()
e2=OCC.BRepBuilderAPI_MakeEdge(P2,P6):Shape()
e3=OCC.BRepBuilderAPI_MakeEdge(P3,P7):Shape()
e4=OCC.BRepBuilderAPI_MakeEdge(P4,P8):Shape()
wire=OCC.TopoDS_Compound()
builder=OCC.TopoDS_Builder()
builder:MakeCompound(wire)
builder:Add(wire,bottom)
builder:Add(wire,top)
builder:Add(wire,e1)
builder:Add(wire,e2)
builder:Add(wire,e3)
builder:Add(wire,e4)
return wire
end
Mon, 11/25/2019 - 06:08
谢谢。
Tue, 11/19/2019 - 10:36
In Draw Harness, commands bounding and vbounding are intended to display bounding box of shape or presentation.
bounding command can also print AABB and OBB values.
Mon, 11/25/2019 - 06:09
Thank you.