public static IInstance Transform(this IInstance instance, TransformMatrix transform, double tolerance = Tolerance.Distance) { if (!transform.IsRigidTransformation(tolerance)) { BH.Engine.Reflection.Compute.RecordError("Transformation failed: only rigid body transformations are currently supported."); return(null); } IInstance result = instance.GetShallowClone() as IInstance; result.Location = result.Location?.ITransform(transform); result.Orientation = result.Orientation?.Transform(transform); return(result); }