ax2_to_compas

compas_occ.conversions.ax2_to_compas(position, cls=None)

Construct a COMPAS frame from an OCC position.

Parameters:
positiongp_Ax2

The OCC position.

clsType[Frame], optional

The type of COMPAS frame.

Returns:
Frame

See also

ax3_to_compas()

Examples

>>> from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Ax2
>>> from compas_occ.conversions import ax2_to_compas
>>> ax2 = gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0))
>>> ax2_to_compas(ax2)
Frame(point=Point(x=0.0, y=0.0, z=0.0), xaxis=Vector(x=1.0, y=0.0, z=0.0), yaxis=Vector(x=0.0, y=1.0, z=0.0))