line_to_compas

compas_occ.conversions.line_to_compas(lin, cls=None)

Convert an OCC line to a COMPAS line.

Parameters:
lingp_Lin

The OCC line.

clsType[Line], optional

The type of COMPAS line.

Returns:
Line

See also

line_to_occ()

Examples

>>> from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Lin
>>> from compas_occ.conversions import line_to_compas
>>> line = gp_Lin(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0))
>>> line_to_compas(line)
Line(Point(x=0.0, y=0.0, z=0.0), Point(x=1.0, y=0.0, z=0.0))