sphere_to_compas

compas_occ.conversions.sphere_to_compas(sphere, cls=None)

Convert an OCC sphere to a COMPAS sphere.

Parameters:
spheregp_Sphere

The OCC sphere.

clsType[Sphere], optional

The type of COMPAS sphere.

Returns:
Sphere

Examples

>>> from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Ax3, gp_Sphere
>>> from compas_occ.conversions import sphere_to_compas
>>> ax3 = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0))
>>> sphere = gp_Sphere(ax3, 1)
>>> sphere_to_compas(sphere)  
Sphere(radius=1.0, frame=Frame(...))