The bound box for the first example seems to be fine.
That is the intersection of a cylinder and a box.
However the second example, the bound box is wrong.
It seems to refer back to the original loft and not the new intersected shape.
function bbzmax(shape) {
var box = new oc.Bnd_Box();
oc.BRepBndLib.prototype.Add(shape, box);
return box.GetZmax();
}
//---------NO ERROR--------------
let c = Cylinder(2.5,5);
let b0 = Box(10,10,5,true);
let i0 = Intersection([c,b0]);
console.log("Cylinder zmax " + bbzmax(c));
console.log("Box0 zmax " + bbzmax(b0));
console.log("Intersection0 zmax " + bbzmax(i0));
//----------------ERROR-------------
// Sketch: An interface for drawing 2D shapes and curves
let face = new Sketch([-10,-8]).Fillet(2).
LineTo([ 10,-8]).Fillet(2).
LineTo([ 0, 8]).Fillet(2).
End(true).Face();
// Loft: Interpolates along an array of Wires into a continuous solid shape
let l = Loft([GetWire(face), Translate([0,0,20], Circle(8, true))]);
let b1 = Box(10,10,5,true);
let i1 = Intersection([l,b1]);
console.log("Loft zmax " + bbzmax(l));
console.log("Box1 zmax " + bbzmax(b1));
console.log("Intersection1 zmax " + bbzmax(i1));
Hello
See code below.
The bound box for the first example seems to be fine.
That is the intersection of a cylinder and a box.
However the second example, the bound box is wrong.
It seems to refer back to the original loft and not the new intersected shape.
Output from at the console is
Any ideas?