Hi,

It seems to my you are using the 0.2 release.
The thing is, we've made a lot of improvements since this release and plan to release 0.3 very soon. The current daily release reflects these improvements, and can be considered a release candidate:
http://www.pythonocc.org/Releases/daily/

I recall trying to do something similar when working on the HLR examples.
We've changed the way by-reference arguments are dealt with.
You can see that in the current sign of the ConvertWithProj arguments:

In [6]: view = display.GetView().GetObject()

In [7]: view.ConvertWithProj?
Type:           instancemethod
Base Class:     <type 'instancemethod'>
String Form: <bound method V3d_View.ConvertWithProj of <OCC.V3d.V3d_View; proxy of <Swig Object of type 'V3d_View *' at 0xbec71c0> >>
Namespace:      Interactive
File:           /Library/Python/2.5/site-packages/OCC/V3d.py
Definition:     view.ConvertWithProj(self, *args)
Docstring:
    ConvertWithProj(self, Standard_Integer Xp, Standard_Integer Yp)


In [8]: view.ConvertWithProj( 1,1 )

Out[8]:
(815.4696044921875,
 -886.04217529296875,
 896.564208984375,
 -0.57735025882720947,
 0.57735025882720947,
 -0.57735025882720947)

So, I'm sorry to have to inform you that the easiest way to work around is to update pythonOCC.

Cheers,

-jelle


On Jul 19, 2009, at 9:43 AM, Владимир Суханов wrote:

Hi All!
I need example for

V3d_View_ConvertWithProj(...)


V3d_View_ConvertWithProj(V3d_View self, Standard_Integer Xp, Standard_Integer Yp,
    V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z)

ConvertWithProj(self, Standard_Integer Xp, Standard_Integer Yp, V3d_Coordinate X,
            V3d_Coordinate Y, V3d_Coordinate Z,
            Standard_Real OutValue, Standard_Real OutValue,
            Standard_Real OutValue)

All my attempts finished:

TypeError: in method 'V3d_View_ConvertWithProj', argument 4 of type 'V3d_Coordinate &'

For example:
            view = self._3dDisplay.GetView().GetObject()
            Xw = 1.
            Yw = 1.
            Zw =1.
            X1, Y1, Z1 = view.ConvertWithProj(pt1.x, pt1.y, Xw,Yw,Zw)

What is V3d_Coordinate type? How define it into Python code?

Thanks!

--
С уважением, Суханов Владимир, зав.кафедрой ПСС ФУО УГТУ-УПИ
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to