Hello, I’m trying to scale an object which I do manually with Scale tool on a specific point, dragging from Green Scale about Opposite Point, like on the screen:
I drew a line between that point and the center of object, and this is the point where “Green Scale about Opposite Point” is situated, I named it in code ‘point_to_scale’.
So I tried to use this method but the result is not what I expected:
When scaling it by 1.1 it makes it 1.1x bigger [in XY&Z].
To ‘flip’ use -1 in the required axial direction.
I appreciate we can’t see all of your code, but a scaling transformation can take various arguments.
So I’m unsure which is which axis of the object - I’ll assume ‘Y’ is the ‘green’ scale your refer to…
In your case perhaps:
Thank you for your reply, based on your code, I found solution for my needs.
instance_bb = instance.bounds
tr=instance.transformation
center = instance_bb.center
ip=tr.origin
if is_oriented_on_x
point_to_scale = [ip.x, center.y, center.z] #for scale about opposite point
#Green Scale about Opposite Point
scale = Geom::Transformation.scaling(point_to_scale, value_to_scale, 1, 1)
#Green scale about Center
#scale = Geom::Transformation.scaling(center, value_to_scale, 1, 1)
else
point_to_scale = [center.x, ip.y, center.z] #for scale about opposite point
#Green scale about Center
#scale = Geom::Transformation.scaling(center, 1, value_to_scale, 1)
#Green scale about Opposite Point
scale = Geom::Transformation.scaling(point_to_scale, 1, value_to_scale, 1)
end