compas_line_from_occ_line

compas_occ.conversions.compas_line_from_occ_line(lin: OCC.Core.gp.gp_Lin, cls: Optional[Type[compas.geometry.curves.line.Line]] = None) compas.geometry.curves.line.Line

Convert an OCC line to a COMPAS line.

Parameters
lingp_Lin

The OCC line.

clsType[Line], optional

The type of COMPAS line.

Returns
Line

Examples

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