RyanZhou
(ryan)
January 23, 2022, 6:19am
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)
September 26, 2022, 9:42am
2
@dale , Would you please have a look at this?
dale
(Dale Fugier)
September 26, 2022, 2:58pm
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)
September 27, 2022, 3:17am
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);
}
}
Hi @dale , can you explain why attached does not work? I’m trying to get the BoundingBox
in active CPlane orientation. The xform
seems valid as it works for the box corners, but not for the BoundingBox
:
bbox_cplane.3dm (231.2 KB)
bbox_cplane.py (1.1 KB)
thanks,
c.
dale
(Dale Fugier)
February 11, 2025, 9:31pm
6
Hi @clement ,
It doesn’t do much good to transform a BoundingBox
, at it’s just two (min, max) points.
Better to transform the corners.
bbox_cplane.py (1.4 KB)
– Dale
clement
February 12, 2025, 2:03am
7
Thanks @dale . I have no idea why Translation transform works but ChangeBasis not.
_
c.