direction_to_compas

compas_occ.conversions.direction_to_compas(vector, cls=None)

Construct a COMPAS vector from an OCC direction.

Parameters:
vectorgp_Dir

The OCC direction.

clsType[Vector], optional

The type of COMPAS vector.

Returns:
Vector

Examples

>>> from OCC.Core.gp import gp_Dir
>>> from compas_occ.conversions import direction_to_compas
>>> vector = gp_Dir(1, 0, 0)
>>> direction_to_compas(vector)
Vector(x=1.0, y=0.0, z=0.0)