compas_circle_from_occ_circle

compas_occ.conversions.compas_circle_from_occ_circle(circ: OCC.Core.gp.gp_Circ, cls: Optional[Type[compas.geometry.curves.circle.Circle]] = None) compas.geometry.curves.circle.Circle

Construct a COMPAS circle from an OCC circle.

Parameters
circgp_Circ

The OCC circle.

clsType[Circle], optional

The type of COMPAS circle.

Returns
Circle

See also

compas_ellipse_from_occ_ellipse()

Examples

>>> from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Ax2, gp_Circ
>>> from compas_occ.conversions import compas_circle_from_occ_circle
>>> ax2 = gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0))
>>> circ = gp_Circ(ax2, 1)
>>> compas_circle_from_occ_circle(circ)
Circle(radius=1.0, frame=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)))