Frame.to_local_coordinates

Frame.to_local_coordinates(obj_in_wcf)[source]

Returns the object’s coordinates in the local coordinate system of the frame.

Parameters:
obj_in_wcf[float, float, float] | compas.geometry.Geometry

An object in the world coordinate frame.

Returns:
compas.geometry.Geometry

The object in the local coordinate system of the frame.

Notes

If you pass a list of floats, it is assumed to represent a point.

Examples

>>> from compas.geometry import Point
>>> frame = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
>>> pw = Point(2, 2, 2)  # point in wcf
>>> pl = frame.to_local_coordinates(pw)  # point in frame
>>> print(frame.to_world_coordinates(pl))
Point(x=2.000, y=2.000, z=2.000)