A transformation is an operation that changes the position, orientation, or scale of a geometry.

import Rhino
# create a rectangle
rectangle = Rhino.Geometry.Rectangle3d(Rhino.Geometry.Plane.WorldXY, 10, 10)
# create a translation transformation
translation_vector = Rhino.Geometry.Vector3d(10, 0, 0)
translation = Rhino.Geometry.Transform.Translation(translation_vector)
# transform the rectangle
rectangle.Transform(translation)
import Rhino
import math
# create a rectangle
rectangle = Rhino.Geometry.Rectangle3d(Rhino.Geometry.Plane.WorldXY, 10, 10)
# create a rotation transformation
rotation_angle = math.radians(45)
rotation_axis = Rhino.Geometry.Vector3d(0, 0, 1)
rotation_base_point = Rhino.Geometry.Point3d(0, 0, 0)
rotation = Rhino.Geometry.Transform.Rotation(rotation_angle,
rotation_axis,
rotation_base_point)
# transform the rectangle
rectangle.Transform(rotation)
import Rhino
# create a rectangle
rectangle = Rhino.Geometry.Rectangle3d(Rhino.Geometry.Plane.WorldXY, 10, 10)
# create a scaling transformation
scaling_factor = 2
scaling_base_point = Rhino.Geometry.Point3d(0, 0, 0)
scaling = Rhino.Geometry.Transform.Scale(scaling_base_point, scaling_factor)
# transform the rectangle
rectangle.Transform(scaling)
import Rhino
source_pln = Rhino.Geometry.Plane.WorldXY
target_pln = Rhino.Geometry.Plane(Rhino.Geometry.Point3d(10, 10, 0), # origin
Rhino.Geometry.Point3d(8, 5, 23), # x axis
Rhino.Geometry.Point3d(12, 4, 0)) # y axis
rectangle = Rhino.Geometry.Rectangle3d(source_pln, 10, 10)
xform_pln_2_pln = Rhino.Geometry.Transform.PlaneToPlane(source_pln, target_pln)
rectangle.Transform(xform_pln_2_pln)