HiGreg
October 5, 2025, 10:31pm
11
I don’t think width is adjustable. Here’s a generation of lines for using with CreateGreasedLine():
The code below depends on the specific ordering of BoundingBox.vectors.
function getBoundingBoxLines(boundingBox) {
// CONVERT BoundingInfo TO LINES FOR CreateGreasedLine or CreateLineSystem
// boundingBox.vectors indexes that draw lines along edges
// in four lines and 16 vertices (4 vertices are repeated).
// This is the fewest vertices.
const lines = [[0,3,5,1], [3,6,1,7], [6,4,0,2], [5,2,7,4]];
const vec = boundingBox.vectors.map((v)=>v.clone())
lines.forEach((row)=>row.forEach((i,colnum)=>{row[colnum]=vec[i];}))
return lines;
}
From Getting efficient lines for drawing BoundingBox
You could use vectorsWorld (for a static “snapshot” of the BoundingBox) or make the resulting GreaseLineMesh a child of the mesh you get the BoundingInfo from.
2 Likes