tpaviot/pythonocc — Issue #66: ProjLib is broken, somehow fails to use the correct arguments
Author: jf---
Created: 2012-03-07 21:34:08+00:00
State: open

Somehow there is a serious issue with arguments when using the ProjLib...
Its better to explain this awkward behaviour by an example:

from OCC.Utils.Construct import * # use overloaded gp_*
from OCC.ProjLib import *

neutral_vec = gp_Vec(0, 0, 1)
tool_vec = gp_Vec(1/3., 1/3., 1/3.)
orientation = gp_Quaternion(neutral_vec, tool_vec)
vec_ = (orientation * gp_Vec(0, 0, 1)).as_pnt()
li_quat = gp_Lin( gp_Pnt(), vec_ )
xy = gp_Pln(gp_Pnt(), gp.DZ())

proj_xy = ProjLib_Plane(xy, li_quat)
# ProjLib_Plane(xy, li_quat)
# File "/Library/Python/2.6/site-packages/OCC/ProjLib.py", line 983, in __init__
# _ProjLib.ProjLib_Plane_swiginit(self,_ProjLib.new_ProjLib_Plane(*args))
# TypeError: in method 'new_ProjLib_Plane', argument 2 of type 'gp_Hypr const'

p = ProjLib.Project(xy, li_quat)

# File "/Library/Python/2.6/site-packages/OCC/ProjLib.py", line 890, in Project
# return _ProjLib.ProjLib_Project(*args)
# TypeError: in method 'ProjLib_Project', argument 1 of type 'gp_Torus const'