RyanZhou
(ryan)
1
BoundingBox.Transform not change internal data, while transform.TransformBoundingBox work well.
boundingBox = transform.TransformBoundingBox(boundingBox);
bool result = boundingBox.Transform(transform);
Rhino version: 7 SR13 (7.13.21348.13001, 2021-12-14)
Nuget “RhinoCommon” version:7.13.21348.13001
RyanZhou
(ryan)
2
@dale , Would you please have a look at this?
dale
(Dale Fugier)
3
Hi @RyanZhou,
This seems to work as expected:
import Rhino
min = Rhino.Geometry.Point3d.Origin
max = Rhino.Geometry.Point3d(5, 5, 5)
bbox = Rhino.Geometry.BoundingBox(min, max)
print(bbox)
xform = Rhino.Geometry.Transform.Scale(min, 5)
bbox.Transform(xform)
print(bbox)
What am I missing?
Thanks,
– Dale
RyanZhou
(ryan)
4
Dale, thanks for your reply. After checking code, I find that I make a mistake and there is no problem with api. Sorry for that.
BoundingBox is struct, instance’s property return a copy of it, anything changed will not affect origin value, below is demo code.
class XXXClass
{
BoundingBox BoundingBox { get; set; }
void XXXFun(Transform transform)
{
BoundingBox.Transform(transform);
}
}