Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / pythonCascade / Technical Information II.

Technical Information II.

Technical Information II.
Sandor_ Racz 2002/06/01 03:44

Open CASCADE C++ operators that have Python equivalents are supported.
E.g. it is possible to add two gp_XYZ objects or a gp_XYZ can be multiplied / divided by a scalar number. Other operators (those ones that do not have Python equivalents might be supported in subsequent versions as Python functions if it will be necessary.)

Examples:

>>> from gp_XYZ import *
>>> p = gp_XYZ(1,2,3)
>>> p.X()
1.0
>>> q = gp_XYZ(4,5,6)
>>> q.X(),q.Y(),q.Z()
(4.0, 5.0, 6.0)
>>> r=p+q
>>> r.X(),r.Y(),r.Z()
(5.0, 7.0, 9.0)
>>> s = r*13
>>> s.X(),s.Y(),s.Z()
(65.0, 91.0, 117.0)


>>> from gp_Dir import *
>>> dir1 = gp_Dir(1,2,3)
>>> sum=dir1.X()*dir1.X()+dir1.Y()*dir1.Y()+dir1.Z()*dir1.Z()
>>> sum
1.0
>>> dir2=gp_Dir(4,5,6)
>>> prod=dir1*dir2
>>> prod
0.97463184619707621
>>> dir3=-dir1
>>> dir3.X(),dir3.Y(),dir3.Z()
(-0.2672612419124244, -0.53452248382484879, -0.80178372573727319)
>>>
 
 
Latest news
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map