compas_frame_from_occ_ax2

compas_occ.conversions.compas_frame_from_occ_ax2(position: OCC.Core.gp.gp_Ax2, cls: Optional[Type[compas.geometry.frame.Frame]] = None) compas.geometry.frame.Frame

Construct a COMPAS frame from an OCC position.

Parameters
positiongp_Ax2

The OCC position.

clsType[Frame], optional

The type of COMPAS frame.

Returns
Frame

Examples

>>> from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Ax2
>>> from compas_occ.conversions import compas_frame_from_occ_ax2
>>> ax2 = gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0))
>>> compas_frame_from_occ_ax2(ax2)
Frame(point=Point(0.0, 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))