vector2d_to_compas

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

Construct a COMPAS vector from an OCC 2D vector.

Parameters:
vectorgp_Vec2d

The OCC vector.

clsType[Vector], optional

The type of COMPAS vector.

Returns:
Vector

Examples

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