Discussion:
Updates on PythonOCC
Mark Blome
2012-08-14 20:03:24 UTC
Permalink
Dear PythonOCC users,

I am developing a CAD & Meshing application for finite element simulations (computational nano-optics) using PythonOCC.
I very much enjoy the rapid software development PythonOCC offers - it's fun and robust at the same time.

For the software I develop I decided to update my local PythonOCC installation to the latest version of the underlying libraries
using the sources from Salome version 6.5.0:
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)

For this purpose I wrote python scripts that basically take the Salome sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface files (where necessary, well, most of them, actually).

I would like to contribute my modifications to give something back to this great open-source library, but I am unsure as to how this could be done.
To this end the updated PythonOCC is running fine on my computer, I can run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be resolved within the next days).

There are some things I would like to discuss (e.g. HashCode functions being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK). Also as I am developing on Mac OS X I did not update the SWIG interface files for win32, so I
would need some help for this from people developing on Windows.

Thanks for any feedback on this,
Mark
jelle feringa
2012-08-15 08:54:14 UTC
Permalink
Dear Mark,

I am developing a CAD & Meshing application for finite element simulations
Post by Mark Blome
(computational nano-optics) using PythonOCC.
Interesting!
I take it that your developing a custom solver?
Cool to see PythonOCC in such a sophisticated project, exciting.
Post by Mark Blome
I very much enjoy the rapid software development PythonOCC offers - it's
fun and robust at the same time.
Good to hear so.
Post by Mark Blome
For the software I develop I decided to update my local PythonOCC
installation to the latest version of the underlying libraries
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)
For this purpose I wrote python scripts that basically take the Salome
sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary
patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface
files (where necessary, well, most of them, actually).
This is _very_ cool news.
Just to see if I follow you correctly: there has been an effort to
integrate GEOM and SMESH in PythonOCC, where we've been adapting an effort
by Fotios.
So, I'm curious to know whether by GEOM / SMESH you refer to the Salome
version or what has been integrated in PythonOCC yet.
If I follow along, you've been working on adapting code from Salome?
I'm curious if you've seen this example, coupling Code-Aster [1]?

[1] https://github.com/tpaviot/pythonocc/tree/master/src/examples/Level2/FEM
Post by Mark Blome
I would like to contribute my modifications to give something back to this
great open-source library, but I am unsure as to how this could be done.
Ideally, by creating a new branch from github [2]

[2] https://github.com/tpaviot/pythonocc
Post by Mark Blome
To this end the updated PythonOCC is running fine on my computer, I can
run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be resolved
within the next days).
Wonderful. Do I understand that your SMESH version follows the Salome API?
Post by Mark Blome
There are some things I would like to discuss (e.g. HashCode functions
being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK).
That's what this list is here for.

1) HashCode functions being absent in OCCT Standard_Transient and
Standard_Persistent classes
I'm on the latest version of PythonOCC:

In [1]: from OCC.Standard import *
In [2]: print Standard_Transient.HashCode
<unbound method Standard_Transient.Standard_Transient_HashCode>

2) there's a boost version in our tree:
https://github.com/tpaviot/pythonocc/tree/master/src/contrib

3) VTK is a powerful module. The current SMESH / GEOM module are built
optionally, where SMESH is creating more of an issue compiling / linking
but does not introduce new dependencies, other than boost.
Since we consider SMESH an add-on, we can be a little more relaxed about
this, than when it comes to "core" PythonOCC.
( Boost is not a PythonOCC dependency )
Post by Mark Blome
Also as I am developing on Mac OS X I did not update the SWIG interface
files for win32, so I
would need some help for this from people developing on Windows.
I hope Thomas Paviot can steer you in the right direction here.

Thanks Mark, looking fwd looking into your contributions!

Best,

-jelle
Mark Blome
2012-08-15 11:38:06 UTC
Permalink
Hi Jelle,

thanks for your quick reply. At our institute (Zuse Institute Berlin, www.zib.de) we have developed a FEM solver specialized for nano-optics, which is being
commercialized by the startup-company JCMWave (www.jcmwave.com). In my research I am simulating functional nano-structures (e.g. solar cells) with
complicated geometries - therefore I need a CAD application that can generate high quality volume grids, which I develop using PythonOCC with GEOM and SMESH.

For creating stand-alone versions of SMESH 6.5.0 and GEOM 6.5.0 I take the SMESH and GEOM Salome sources, the netgen sources from the Salome Install Wizard
(apparently this is the only netgen source tree version that is compatible with the Salome patch file required for the smesh netgen plugin) and some of Salomes Kernel source files.

For all the modifications I had to apply I tried to follow as closely as possible the modifications done for the SMESH and GEOM modules on sourceforge
(http://sourceforge.net/projects/salomesmesh/, http://sourceforge.net/projects/salomegeometry/). Well, at least I tried ;-).

I can re-run my application, which uses SMESH (and GEOM) through PythonOCC extensively after applying my modifications, so I think these versions are more or less
compatible. You're right, of course the new VTK and boost thread dependencies are in SMESH, not in PythonOCC itself. Maybe it would be better to remove the SMESH VTK
dependency ? And the boost thread dependency ? On the other hand, running mesh generations in a thread within SMESH is on my personal wish-list (like they do in the latest Salome version to
provide a GUI "cancel" button ) and VTK export / import would also be kind of nice.

I used the SWIG_generator.py with gccxml to regenerate SWIG interface files (with hand-modifications afterwards). While doing that I noticed that all OCC classes derived from
Standard_Transient and Standard_Persistent no longer provide the HashCode functions and therefore I had to remove all
%extend <some_class> {
Standard_Integer __hash__() {
return $self->HashCode(__PYTHONOCC_MAXINT__);
}
};
statements in the SWIG files. Initially I re-introduced the HashCode functions in oce, which was really a bad idea: I experienced lots of random crashes. Are those Hashcode functions
required on the python side or is python happy on those classes with the default __hash__() function ?

Also I had to modify SWIG_generator.py to avoid the generation of artificial copy constructors by adding
if ("%s("%class_parent_name in to_write) and (mem_fun.is_artificial):
return False
in write_functions(). Not sure if that is correct. Maybe that is due to an issue with the specific gccxml version I use ?

If you like you can also directly contact me on my email address.

Thanks,
Mark
Post by jelle feringa
Dear Mark,
I am developing a CAD & Meshing application for finite element simulations (computational nano-optics) using PythonOCC.
Interesting!
I take it that your developing a custom solver?
Cool to see PythonOCC in such a sophisticated project, exciting.
I very much enjoy the rapid software development PythonOCC offers - it's fun and robust at the same time.
Good to hear so.
For the software I develop I decided to update my local PythonOCC installation to the latest version of the underlying libraries
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)
For this purpose I wrote python scripts that basically take the Salome sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface files (where necessary, well, most of them, actually).
This is _very_ cool news.
Just to see if I follow you correctly: there has been an effort to integrate GEOM and SMESH in PythonOCC, where we've been adapting an effort by Fotios.
So, I'm curious to know whether by GEOM / SMESH you refer to the Salome version or what has been integrated in PythonOCC yet.
If I follow along, you've been working on adapting code from Salome?
I'm curious if you've seen this example, coupling Code-Aster [1]?
[1] https://github.com/tpaviot/pythonocc/tree/master/src/examples/Level2/FEM
I would like to contribute my modifications to give something back to this great open-source library, but I am unsure as to how this could be done.
Ideally, by creating a new branch from github [2]
[2] https://github.com/tpaviot/pythonocc
To this end the updated PythonOCC is running fine on my computer, I can run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be resolved within the next days).
Wonderful. Do I understand that your SMESH version follows the Salome API?
There are some things I would like to discuss (e.g. HashCode functions being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK).
That's what this list is here for.
1) HashCode functions being absent in OCCT Standard_Transient and Standard_Persistent classes
In [1]: from OCC.Standard import *
In [2]: print Standard_Transient.HashCode
<unbound method Standard_Transient.Standard_Transient_HashCode>
https://github.com/tpaviot/pythonocc/tree/master/src/contrib
3) VTK is a powerful module. The current SMESH / GEOM module are built optionally, where SMESH is creating more of an issue compiling / linking but does not introduce new dependencies, other than boost.
Since we consider SMESH an add-on, we can be a little more relaxed about this, than when it comes to "core" PythonOCC.
( Boost is not a PythonOCC dependency )
Also as I am developing on Mac OS X I did not update the SWIG interface files for win32, so I
would need some help for this from people developing on Windows.
I hope Thomas Paviot can steer you in the right direction here.
Thanks Mark, looking fwd looking into your contributions!
Best,
-jelle
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
Thomas Paviot
2012-08-16 07:14:52 UTC
Permalink
Post by Mark Blome
Hi Jelle,
Hi Mark,

Thank you for your post. It's not that usual that people here contribute to
the low level SWIG layer.
Post by Mark Blome
thanks for your quick reply. At our institute (Zuse Institute Berlin,
www.zib.de) we have developed a FEM solver specialized for nano-optics,
which is being
commercialized by the startup-company JCMWave (www.jcmwave.com). In my
research I am simulating functional nano-structures (e.g. solar cells) with
complicated geometries - therefore I need a CAD application that can
generate high quality volume grids, which I develop using PythonOCC with
GEOM and SMESH.
For creating stand-alone versions of SMESH 6.5.0 and GEOM 6.5.0 I take the
SMESH and GEOM Salome sources, the netgen sources from the Salome Install
Wizard
(apparently this is the only netgen source tree version that is compatible
with the Salome patch file required for the smesh netgen plugin) and some
of Salomes Kernel source files.
Fotis' salomesmesh and salomegeometry projects are existing attempts to
create standalone versions of SMESH and GEOM.
Post by Mark Blome
For all the modifications I had to apply I tried to follow as closely as
possible the modifications done for the SMESH and GEOM modules on
sourceforge
(http://sourceforge.net/projects/salomesmesh/,
http://sourceforge.net/projects/salomegeometry/). Well, at least I tried
;-).
Why didn't you try to work from the svn trunks of these projects?
Post by Mark Blome
I can re-run my application, which uses SMESH (and GEOM) through PythonOCC
extensively after applying my modifications, so I think these versions are
more or less
compatible. You're right, of course the new VTK and boost thread
dependencies are in SMESH, not in PythonOCC itself. Maybe it would be
better to remove the SMESH VTK
dependency ? And the boost thread dependency ? On the other hand, running
mesh generations in a thread within SMESH is on my personal wish-list (like
they do in the latest Salome version to
provide a GUI "cancel" button ) and VTK export / import would also be kind of nice.
Dependencies can easily be managed from the cmake pythonocc builder system.
The idea is to create optional features, for instance "if lib is installed"
then "enable feature". But additional dependencies should not be included
to the current source code, the objectif being, on the opposite, to reduce
the number of required demendencies of Salome modules.
Post by Mark Blome
I used the SWIG_generator.py with gccxml to regenerate SWIG interface
files (with hand-modifications afterwards).
Waow, well done ;-)

While doing that I noticed that all OCC classes derived from
Post by Mark Blome
Standard_Transient and Standard_Persistent no longer provide the HashCode
functions and therefore I had to remove all
%extend <some_class> {
Standard_Integer __hash__() {
return $self->HashCode(__PYTHONOCC_MAXINT__);
}
};
statements in the SWIG files. Initially I re-introduced the HashCode
functions in oce, which was really a bad idea: I experienced lots of
random crashes. Are those Hashcode functions
required on the python side or is python happy on those classes with the
default __hash__() function ?
HashCode was a member function for all classes that inherit from
Standard_Transient. However, since OCCT6.5.0 (or 6.5.1, I don't remember
exactly), this was changes by the OCC team. I already fixed this issue, a
month ago, in the tp/oce-0.10-support branch on github (see
https://github.com/tpaviot/pythonocc/branches). The related commit is
https://github.com/tpaviot/pythonocc/commit/00141683e58a641ac1103e3d8df706b75a712332to
make use of the new HashCode function. Having a __hash__ method is a
requirement, since it is used by python lists/dicts (for instance when
looking for 'a_shape *in* a_list'). When modifying the SWIG files, you
should each time restart the unittest suite to check that you did not
introduce any regression. I think (but I'm not sure), that removing the
__hash__ method introduces some regression.
Post by Mark Blome
Also I had to modify SWIG_generator.py to avoid the generation of
artificial copy constructors by adding
return False
in write_functions(). Not sure if that is correct. Maybe that is due to an
issue with the specific gccxml version I use ?
I can't understand this part of your code. What problem do you try to solve?
Post by Mark Blome
If you like you can also directly contact me on my email address.
Of course not. This interesting contribution (and the related discussion)
has to remain public. I'm impressed by your deep understanding of the SWIG
OCCT wrapper, and your work/skill can help improving pythonocc while I'm
not having as much free time as I used to have in a recent past. Here is
what I suggest in order to get efficient :
* use OCE instead of the officiel OCCT. OCE is very easy to compile/install
compared to OCCT. You can work with the OCE 0.10 release ;
* I pushed a branch to the github repos that is sync with the oce master
branch (see my comment above). Please push code/comments/issue to
https://github.com/tpaviot/pythonocc. If you don't feel comfortable with
git, post code to this ml in the meantime ;
* you can send your improvements over salomesmesh/salomegeometry to Fotis
Soutis (sfotis-***@public.gmane.org). It's the best way to have these projects include
your changes.
Post by Mark Blome
Thanks,
Mark
Much looking forward to discussing these issues with you,

Best Regards,

Thomas
Post by Mark Blome
Dear Mark,
I am developing a CAD & Meshing application for finite element simulations
Post by Mark Blome
(computational nano-optics) using PythonOCC.
Interesting!
I take it that your developing a custom solver?
Cool to see PythonOCC in such a sophisticated project, exciting.
Post by Mark Blome
I very much enjoy the rapid software development PythonOCC offers - it's
fun and robust at the same time.
Good to hear so.
Post by Mark Blome
For the software I develop I decided to update my local PythonOCC
installation to the latest version of the underlying libraries
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)
For this purpose I wrote python scripts that basically take the Salome
sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary
patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface
files (where necessary, well, most of them, actually).
This is _very_ cool news.
Just to see if I follow you correctly: there has been an effort to
integrate GEOM and SMESH in PythonOCC, where we've been adapting an effort
by Fotios.
So, I'm curious to know whether by GEOM / SMESH you refer to the Salome
version or what has been integrated in PythonOCC yet.
If I follow along, you've been working on adapting code from Salome?
I'm curious if you've seen this example, coupling Code-Aster [1]?
[1]
https://github.com/tpaviot/pythonocc/tree/master/src/examples/Level2/FEM
Post by Mark Blome
I would like to contribute my modifications to give something back to
this great open-source library, but I am unsure as to how this could be
done.
Ideally, by creating a new branch from github [2]
[2] https://github.com/tpaviot/pythonocc
Post by Mark Blome
To this end the updated PythonOCC is running fine on my computer, I can
run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be resolved
within the next days).
Wonderful. Do I understand that your SMESH version follows the Salome API?
Post by Mark Blome
There are some things I would like to discuss (e.g. HashCode functions
being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK).
That's what this list is here for.
1) HashCode functions being absent in OCCT Standard_Transient and
Standard_Persistent classes
In [1]: from OCC.Standard import *
In [2]: print Standard_Transient.HashCode
<unbound method Standard_Transient.Standard_Transient_HashCode>
https://github.com/tpaviot/pythonocc/tree/master/src/contrib
3) VTK is a powerful module. The current SMESH / GEOM module are built
optionally, where SMESH is creating more of an issue compiling / linking
but does not introduce new dependencies, other than boost.
Since we consider SMESH an add-on, we can be a little more relaxed about
this, than when it comes to "core" PythonOCC.
( Boost is not a PythonOCC dependency )
Post by Mark Blome
Also as I am developing on Mac OS X I did not update the SWIG interface
files for win32, so I
would need some help for this from people developing on Windows.
I hope Thomas Paviot can steer you in the right direction here.
Thanks Mark, looking fwd looking into your contributions!
Best,
-jelle
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
Mark Blome
2012-08-17 09:24:03 UTC
Permalink
Hi Thomas, hi Jelle,

thanks for your comments and hints.

About the GEOM and SMESH modules: I started all over again creating stand-alone versions of SMESH and GEOM from the Salome V6.5.0 sources cause I
judged that updating these projects file by file would have been too cumbersome. Well, probably that's not true for GEOM, but at least in SMESH
a lot of the code base has changed between 5.1.x and 6.5.0.

IMHO GEOM and SMESH are a huge plus for PythonOCC. In my Project I use non-manifold topology a lot using GEOMs most valuable
GEOMAlgo_Splitter (for creating multi-material domains ) and use SMESH for advanced meshing techniques like creating periodic 3d volume grids or
hybrid meshing with prisms and tetrahedra mixed.

Thanks Thomas for pointing me to your commit about the HashCode function. According to the OCCT 6.5.3 release document that is exactly the way how this
should be done. BTW: For my modifications I use oce 0.10. Opencascade is a pain to compile on Mac OS X, but with oce it's an absolute no-issue. It's really
nice to see what the community has done here.

My modification in swig_generator.py (function write_functions) on my computer was necessary because (apparently following the C++ standard) gccxml
reports implicit copy constructors for the classes it parses (in cases where explicit copy ctors are absent). Compilation of the corresponding wrapper classes
fails because of class members that can not be instantiated using copy construction. I found that there are versions of gccxml that do not report implicit
copy constructors. With my version (V0.7 based on gcc V3.3.2) I had to filter them out using mem_fun.is_artificial (that's the way gccxml marks implicit functions).
* I pushed a branch to the github repos that is sync with the oce master branch (see my comment above). Please push code/comments/issue to https://github.com/tpaviot/pythonocc. If you don't feel comfortable with git, post code to this ml in the meantime ;
I am not familiar with git, but wanted to learn using it sooner or later anyway, so now is the best time for that ;-).
But I am not sure I understand you correctly. The branch you mention is already using oce 0.10 and has the SWIG files modified ?
So there's not more to do for me other than contributing SMESH and GEOM modifications, right ? Those modifications I should send
to Fotis Soutis (sfotis-***@public.gmane.org) for merging them into the sourceforge code trees, right ? And after that is done PythonOCC would
incorporate them at a later time for a new PythonOCC release ?

Best,
Mark

PS: In the GUI I developed using PythonOCC and PyQt I define boundary IDs on faces of the geometry and keep the surface grids after
volume meshing such that I have the link OCC face --> surface triangles for setting boundary conditions. Periodic boundary conditions
are more tricky because in that case I need to identify pairs of triangles for surface grids that must be identical.
Hi Jelle,
Hi Mark,
Thank you for your post. It's not that usual that people here contribute to the low level SWIG layer.
thanks for your quick reply. At our institute (Zuse Institute Berlin, www.zib.de) we have developed a FEM solver specialized for nano-optics, which is being
commercialized by the startup-company JCMWave (www.jcmwave.com). In my research I am simulating functional nano-structures (e.g. solar cells) with
complicated geometries - therefore I need a CAD application that can generate high quality volume grids, which I develop using PythonOCC with GEOM and SMESH.
For creating stand-alone versions of SMESH 6.5.0 and GEOM 6.5.0 I take the SMESH and GEOM Salome sources, the netgen sources from the Salome Install Wizard
(apparently this is the only netgen source tree version that is compatible with the Salome patch file required for the smesh netgen plugin) and some of Salomes Kernel source files.
Fotis' salomesmesh and salomegeometry projects are existing attempts to create standalone versions of SMESH and GEOM.
For all the modifications I had to apply I tried to follow as closely as possible the modifications done for the SMESH and GEOM modules on sourceforge
(http://sourceforge.net/projects/salomesmesh/, al/). Well, at least I tried ;-).
Why didn't you try to work from the svn trunks of these projects?
I can re-run my application, which uses SMESH (and GEOM) through PythonOCC extensively after applying my modifications, so I think these versions are more or less
compatible. You're right, of course the new VTK and boost thread dependencies are in SMESH, not in PythonOCC itself. Maybe it would be better to remove the SMESH VTK
dependency ? And the boost thread dependency ? On the other hand, running mesh generations in a thread within SMESH is on my personal wish-list (like they do in the latest Salome version to
provide a GUI "cancel" button ) and VTK export / import would also be kind of nice.
Dependencies can easily be managed from the cmake pythonocc builder system. The idea is to create optional features, for instance "if lib is installed" then "enable feature". But additional dependencies should not be included to the current source code, the objectif being, on the opposite, to reduce the number of required demendencies of Salome modules.
I used the SWIG_generator.py with gccxml to regenerate SWIG interface files (with hand-modifications afterwards).
Waow, well done ;-)
While doing that I noticed that all OCC classes derived from
Standard_Transient and Standard_Persistent no longer provide the HashCode functions and therefore I had to remove all
%extend <some_class> {
Standard_Integer __hash__() {
return $self->HashCode(__PYTHONOCC_MAXINT__);
}
};
statements in the SWIG files. Initially I re-introduced the HashCode functions in oce, which was really a bad idea: I experienced lots of random crashes. Are those Hashcode functions
required on the python side or is python happy on those classes with the default __hash__() function ?
HashCode was a member function for all classes that inherit from Standard_Transient. However, since OCCT6.5.0 (or 6.5.1, I don't remember exactly), this was changes by the OCC team. I already fixed this issue, a month ago, in the tp/oce-0.10-support branch on github (see https://github.com/tpaviot/pythonocc/branches). The related commit is https://github.com/tpaviot/pythonocc/commit/00141683e58a641ac1103e3d8df706b75a712332 to make use of the new HashCode function. Having a __hash__ method is a requirement, since it is used by python lists/dicts (for instance when looking for 'a_shape *in* a_list'). When modifying the SWIG files, you should each time restart the unittest suite to check that you did not introduce any regression. I think (but I'm not sure), that removing the __hash__ method introduces some regression.
Also I had to modify SWIG_generator.py to avoid the generation of artificial copy constructors by adding
return False
in write_functions(). Not sure if that is correct. Maybe that is due to an issue with the specific gccxml version I use ?
I can't understand this part of your code. What problem do you try to solve?
If you like you can also directly contact me on my email address.
* use OCE instead of the officiel OCCT. OCE is very easy to compile/install compared to OCCT. You can work with the OCE 0.10 release ;
* I pushed a branch to the github repos that is sync with the oce master branch (see my comment above). Please push code/comments/issue to https://github.com/tpaviot/pythonocc. If you don't feel comfortable with git, post code to this ml in the meantime ;
Thanks,
Mark
Much looking forward to discussing these issues with you,
Best Regards,
Thomas
Post by jelle feringa
Dear Mark,
I am developing a CAD & Meshing application for finite element simulations (computational nano-optics) using PythonOCC.
Interesting!
I take it that your developing a custom solver?
Cool to see PythonOCC in such a sophisticated project, exciting.
I very much enjoy the rapid software development PythonOCC offers - it's fun and robust at the same time.
Good to hear so.
For the software I develop I decided to update my local PythonOCC installation to the latest version of the underlying libraries
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)
For this purpose I wrote python scripts that basically take the Salome sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface files (where necessary, well, most of them, actually).
This is _very_ cool news.
Just to see if I follow you correctly: there has been an effort to integrate GEOM and SMESH in PythonOCC, where we've been adapting an effort by Fotios.
So, I'm curious to know whether by GEOM / SMESH you refer to the Salome version or what has been integrated in PythonOCC yet.
If I follow along, you've been working on adapting code from Salome?
I'm curious if you've seen this example, coupling Code-Aster [1]?
[1] https://github.com/tpaviot/pythonocc/tree/master/src/examples/Level2/FEM
I would like to contribute my modifications to give something back to this great open-source library, but I am unsure as to how this could be done.
Ideally, by creating a new branch from github [2]
[2] https://github.com/tpaviot/pythonocc
To this end the updated PythonOCC is running fine on my computer, I can run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be resolved within the next days).
Wonderful. Do I understand that your SMESH version follows the Salome API?
There are some things I would like to discuss (e.g. HashCode functions being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK).
That's what this list is here for.
1) HashCode functions being absent in OCCT Standard_Transient and Standard_Persistent classes
In [1]: from OCC.Standard import *
In [2]: print Standard_Transient.HashCode
<unbound method Standard_Transient.Standard_Transient_HashCode>
https://github.com/tpaviot/pythonocc/tree/master/src/contrib
3) VTK is a powerful module. The current SMESH / GEOM module are built optionally, where SMESH is creating more of an issue compiling / linking but does not introduce new dependencies, other than boost.
Since we consider SMESH an add-on, we can be a little more relaxed about this, than when it comes to "core" PythonOCC.
( Boost is not a PythonOCC dependency )
Also as I am developing on Mac OS X I did not update the SWIG interface files for win32, so I
would need some help for this from people developing on Windows.
I hope Thomas Paviot can steer you in the right direction here.
Thanks Mark, looking fwd looking into your contributions!
Best,
-jelle
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
jelle feringa
2012-08-17 10:12:43 UTC
Permalink
hi Mark,
Post by Mark Blome
thanks for your comments and hints.
Its exciting to have you onboard =)
Post by Mark Blome
About the GEOM and SMESH modules: I started all over again creating
stand-alone versions of SMESH and GEOM from the Salome V6.5.0 sources cause
I
judged that updating these projects file by file would have been too
cumbersome. Well, probably that's not true for GEOM, but at least in SMESH
a lot of the code base has changed between 5.1.x and 6.5.0.
That figures.
So your API resembles SMESH, with the Corba crap yanked out of it?
Post by Mark Blome
IMHO GEOM and SMESH are a huge plus for PythonOCC.
hear hear, and considerable easier to work with than delving into Salome,
so yes, its a forté, also taking into account the "options" are fairly
limited if your keen on working in OS
Post by Mark Blome
In my Project I use non-manifold topology a lot using GEOMs most valuable
GEOMAlgo_Splitter (for creating multi-material domains ) and use SMESH for
advanced meshing techniques like creating periodic 3d volume grids or
hybrid meshing with prisms and tetrahedra mixed.
Thanks Thomas for pointing me to your commit about the HashCode function.
According to the OCCT 6.5.3 release document that is exactly the way how
this
should be done. BTW: For my modifications I use oce 0.10. Opencascade is a
pain to compile on Mac OS X, but with oce it's an absolute no-issue. It's
really
nice to see what the community has done here.
My modification in swig_generator.py (function write_functions) on my
computer was necessary because (apparently following the C++ standard)
gccxml
reports implicit copy constructors for the classes it parses (in cases
where explicit copy ctors are absent). Compilation of the
corresponding wrapper classes
fails because of class members that can not be instantiated using copy
construction. I found that there are versions of gccxml that do not report
implicit
copy constructors. With my version (V0.7 based on gcc V3.3.2)
Hmmm... that version is ~ 5 years old...
Post by Mark Blome
I had to filter them out using mem_fun.is_artificial (that's the way
gccxml marks implicit functions).
* I pushed a branch to the github repos that is sync with the oce master
branch (see my comment above). Please push code/comments/issue to
https://github.com/tpaviot/pythonocc. If you don't feel comfortable with
git, post code to this ml in the meantime ;
I am not familiar with git, but wanted to learn using it sooner or later
anyway, so now is the best time for that ;-).
But I am not sure I understand you correctly. The branch you mention is
already using oce 0.10 and has the SWIG files modified ?
So there's not more to do for me other than contributing SMESH and GEOM
modifications, right ?
Nope. Its best to have a branch dedicated for your work.
Once all is nice & peachy, it can be branched back into the master.
Perhaps its best to read up on the OCE workflow, which reflects some solid
ideas on developing with git as your
cvs<https://github.com/tpaviot/oce/wiki/Git-workflow>
Post by Mark Blome
merging them into the sourceforge code trees, right ?
[ CC'd to Fotios ]
Fotios maintains GEOM and SMESH as a separate project.
It would be interesting to diff both trees, from there it would be more
practical to see what is the overlap between the projects.
Post by Mark Blome
And after that is done PythonOCC would incorporate them at a later time
for a new PythonOCC release?
Yep, when your branch works well and doesn't clash with master and it
tested, than its time to merge things back into the master, and time to
release.
Post by Mark Blome
PS: In the GUI I developed using PythonOCC and PyQt I define boundary IDs
on faces of the geometry and keep the surface grids after
volume meshing such that I have the link OCC face --> surface triangles
for setting boundary conditions.
Clever! I'm working on a PythonOCC based gui too, which is based on
enthought traits, which allows for very rapid development of GUI's.
Curious to hear your take on PyOCC gui development.
But that's another thread ;D

Cheers!

-jelle
Mark Blome
2012-08-20 14:36:17 UTC
Permalink
Hi Jelle and Thomas,

thanks for pointing me to the OCEworkflow document.
My SMESH / GEOM modifications are following along the line of what Fotis Soutis did (Corba stuff removed), with working NETGEN and Tetgen mesher Plugins.
I am going to contact Fotis Soutis about my modifications to see if he is interested in them. I think it would be really great if there would be a PythonOCC
release based on oce 0.10 and SMESH/GEOM V6.5.0 with Netgen and Tetgen integration sometimes in the foreseeable future.

Thomas , I cloned into your "tp/oce-0.10-support" branch on github and tried my software on oce 0.10 wrapped using your interface files (with my SMESH/GEOM
extensions) and it works like a charm ! Gosh, I should have checked the git repositories before diving into modifying the PythonOCC-0.5 SWIG interfaces. Well, at least
I learned a lot during that week ;-).

I have a few questions about the SWIG interface files:
- How much time and effort do you think would it take for also updating the win32 swig interface files ?
- I think the gccxml issue I am having on my Mac really is related to my gccxml version being 5 years old.
So I don't think a patch about that is necessary. What do you think ?
- I was wondering about the renames in TopoDS_renames.i:
%rename(vertex) TopoDS::Vertex;
%rename(edge) TopoDS::Edge;
...
In the version I used before, I could do TopoDS().Vertex(), TopoDS().Edge(), etc. What is the rationale behind these changes ?

best,
Mark
Post by jelle feringa
hi Mark,
thanks for your comments and hints.
Its exciting to have you onboard =)
About the GEOM and SMESH modules: I started all over again creating stand-alone versions of SMESH and GEOM from the Salome V6.5.0 sources cause I
judged that updating these projects file by file would have been too cumbersome. Well, probably that's not true for GEOM, but at least in SMESH
a lot of the code base has changed between 5.1.x and 6.5.0.
That figures.
So your API resembles SMESH, with the Corba crap yanked out of it?
IMHO GEOM and SMESH are a huge plus for PythonOCC.
hear hear, and considerable easier to work with than delving into Salome, so yes, its a forté, also taking into account the "options" are fairly limited if your keen on working in OS
In my Project I use non-manifold topology a lot using GEOMs most valuable
GEOMAlgo_Splitter (for creating multi-material domains ) and use SMESH for advanced meshing techniques like creating periodic 3d volume grids or
hybrid meshing with prisms and tetrahedra mixed.
Thanks Thomas for pointing me to your commit about the HashCode function. According to the OCCT 6.5.3 release document that is exactly the way how this
should be done. BTW: For my modifications I use oce 0.10. Opencascade is a pain to compile on Mac OS X, but with oce it's an absolute no-issue. It's really
nice to see what the community has done here.
My modification in swig_generator.py (function write_functions) on my computer was necessary because (apparently following the C++ standard) gccxml
reports implicit copy constructors for the classes it parses (in cases where explicit copy ctors are absent). Compilation of the corresponding wrapper classes
fails because of class members that can not be instantiated using copy construction. I found that there are versions of gccxml that do not report implicit
copy constructors. With my version (V0.7 based on gcc V3.3.2)
Hmmm... that version is ~ 5 years old...
I had to filter them out using mem_fun.is_artificial (that's the way gccxml marks implicit functions).
* I pushed a branch to the github repos that is sync with the oce master branch (see my comment above). Please push code/comments/issue to https://github.com/tpaviot/pythonocc. If you don't feel comfortable with git, post code to this ml in the meantime ;
I am not familiar with git, but wanted to learn using it sooner or later anyway, so now is the best time for that ;-).
But I am not sure I understand you correctly. The branch you mention is already using oce 0.10 and has the SWIG files modified ?
So there's not more to do for me other than contributing SMESH and GEOM modifications, right ?
Nope. Its best to have a branch dedicated for your work.
Once all is nice & peachy, it can be branched back into the master.
Perhaps its best to read up on the OCE workflow, which reflects some solid ideas on developing with git as your cvs
[ CC'd to Fotios ]
Fotios maintains GEOM and SMESH as a separate project.
It would be interesting to diff both trees, from there it would be more practical to see what is the overlap between the projects.
And after that is done PythonOCC would incorporate them at a later time for a new PythonOCC release?
Yep, when your branch works well and doesn't clash with master and it tested, than its time to merge things back into the master, and time to release.
PS: In the GUI I developed using PythonOCC and PyQt I define boundary IDs on faces of the geometry and keep the surface grids after
volume meshing such that I have the link OCC face --> surface triangles for setting boundary conditions.
Clever! I'm working on a PythonOCC based gui too, which is based on enthought traits, which allows for very rapid development of GUI's.
Curious to hear your take on PyOCC gui development.
But that's another thread ;D
Cheers!
-jelle
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
jelle feringa
2012-08-20 14:57:13 UTC
Permalink
Post by Mark Blome
Gosh, I should have checked the git repositories before diving into
modifying the PythonOCC-0.5 SWIG interfaces. Well, at least
I learned a lot during that week ;-).
Your a very fast learner...
Post by Mark Blome
- I think the gccxml issue I am having on my Mac really is related to my
gccxml version being 5 years old.
Yep, 99.99% certain that's the issue...

Thomas Paviot
2012-08-17 14:05:09 UTC
Permalink
Post by Mark Blome
Hi Thomas, hi Jelle,
Hi Mark,
Post by Mark Blome
thanks for your comments and hints.
About the GEOM and SMESH modules: I started all over again creating
stand-alone versions of SMESH and GEOM from the Salome V6.5.0 sources cause
I
judged that updating these projects file by file would have been too
cumbersome. Well, probably that's not true for GEOM, but at least in SMESH
a lot of the code base has changed between 5.1.x and 6.5.0.
IMHO GEOM and SMESH are a huge plus for PythonOCC. In my Project I use
non-manifold topology a lot using GEOMs most valuable
GEOMAlgo_Splitter (for creating multi-material domains ) and use SMESH for
advanced meshing techniques like creating periodic 3d volume grids or
hybrid meshing with prisms and tetrahedra mixed.
Thank you for this feedback. A few months ago, I was about to drop SMESH
support, since I do no use it and it's a tough work to get it wrapped in
pythonocc.
Post by Mark Blome
Thanks Thomas for pointing me to your commit about the HashCode function.
According to the OCCT 6.5.3 release document that is exactly the way how
this
should be done. BTW: For my modifications I use oce 0.10. Opencascade is a
pain to compile on Mac OS X, but with oce it's an absolute no-issue. It's
really
nice to see what the community has done here.
My modification in swig_generator.py (function write_functions) on my
computer was necessary because (apparently following the C++ standard)
gccxml
reports implicit copy constructors for the classes it parses (in cases
where explicit copy ctors are absent). Compilation of the
corresponding wrapper classes
fails because of class members that can not be instantiated using copy
construction. I found that there are versions of gccxml that do not report
implicit
copy constructors. With my version (V0.7 based on gcc V3.3.2) I had to
filter them out using mem_fun.is_artificial (that's the way gccxml marks
implicit functions).
So this patch can come has a gccxml fix. It can be commited in a branch
created from the master branch, since it does not depend on the oce version.
Post by Mark Blome
* I pushed a branch to the github repos that is sync with the oce master
branch (see my comment above). Please push code/comments/issue to
https://github.com/tpaviot/pythonocc. If you don't feel comfortable with
git, post code to this ml in the meantime ;
I am not familiar with git, but wanted to learn using it sooner or later
anyway, so now is the best time for that ;-).
The move from svn to git requires some efforts, but it's worth trying,
you'll get definitely convinced.
Post by Mark Blome
But I am not sure I understand you correctly. The branch you mention is
already using oce 0.10 and has the SWIG files modified ?
Yes, for Linux/OSX only, not Windows.
Post by Mark Blome
So there's not more to do for me other than contributing SMESH and GEOM
modifications, right ?
This branch does not include support for SMESH and GEOM yet. 'not more to
do than' is a time consuming task: patch GEOM, patch SMESH, generate SWIG
files, compile, run and fix GEOM unittests, run and fix SMESH examples. In
my experience, it can be one week of full time job just to achieve this
task. That's why, unfortunately, and did not do it so far. So your
contribution is *very* welcome.

Those modifications I should send
Post by Mark Blome
code trees, right ? And after that is done PythonOCC would
incorporate them at a later time for a new PythonOCC release ?
According to the first paragraph of your email, you successfully created
standalone versions of GEOM and SMESH. I do think that it's better to
contribute this work up to Fotis than creating another project or hosting
your C++ modifications into the pythonocc repository. Fotis has a long
experience with SMESH/GEOM, we should not reinvent the wheel. It would IMO
be the best possible solution.

The workflow you described is correct. But the "later" can be quite fast
since we can request a new release of standalones GEOM and SMESH libs when
we're ready.
Post by Mark Blome
Best,
Mark
PS: In the GUI I developed using PythonOCC and PyQt I define boundary IDs
on faces of the geometry and keep the surface grids after
volume meshing such that I have the link OCC face --> surface triangles
for setting boundary conditions. Periodic boundary conditions
are more tricky because in that case I need to identify pairs of
triangles for surface grids that must be identical.
In an older post, we already discussed licensing issues between PyQt
(GPLed) and pythonOCC (LGPLed). A possible solution is to move to pyside
(LGPLed) for the pythonocc/Qt support. Did you experiment pyside ? on OSX?

Regards,

Thomas
Post by Mark Blome
Post by Mark Blome
Hi Jelle,
Hi Mark,
Thank you for your post. It's not that usual that people here contribute
to the low level SWIG layer.
Post by Mark Blome
thanks for your quick reply. At our institute (Zuse Institute Berlin,
www.zib.de) we have developed a FEM solver specialized for nano-optics,
which is being
commercialized by the startup-company JCMWave (www.jcmwave.com). In my
research I am simulating functional nano-structures (e.g. solar cells) with
complicated geometries - therefore I need a CAD application that can
generate high quality volume grids, which I develop using PythonOCC with
GEOM and SMESH.
For creating stand-alone versions of SMESH 6.5.0 and GEOM 6.5.0 I take
the SMESH and GEOM Salome sources, the netgen sources from the Salome
Install Wizard
(apparently this is the only netgen source tree version that is
compatible with the Salome patch file required for the smesh netgen plugin)
and some of Salomes Kernel source files.
Fotis' salomesmesh and salomegeometry projects are existing attempts to
create standalone versions of SMESH and GEOM.
Post by Mark Blome
For all the modifications I had to apply I tried to follow as closely as
possible the modifications done for the SMESH and GEOM modules on
sourceforge
(http://sourceforge.net/projects/salomesmesh/, al/<http://sourceforge.net/projects/salomegeometry/>).
Well, at least I tried ;-).
Why didn't you try to work from the svn trunks of these projects?
Post by Mark Blome
I can re-run my application, which uses SMESH (and GEOM) through
PythonOCC extensively after applying my modifications, so I think these
versions are more or less
compatible. You're right, of course the new VTK and boost thread
dependencies are in SMESH, not in PythonOCC itself. Maybe it would be
better to remove the SMESH VTK
dependency ? And the boost thread dependency ? On the other hand, running
mesh generations in a thread within SMESH is on my personal wish-list (like
they do in the latest Salome version to
provide a GUI "cancel" button ) and VTK export / import would also be kind of nice.
Dependencies can easily be managed from the cmake pythonocc builder
system. The idea is to create optional features, for instance "if lib is
installed" then "enable feature". But additional dependencies should not be
included to the current source code, the objectif being, on the opposite,
to reduce the number of required demendencies of Salome modules.
Post by Mark Blome
I used the SWIG_generator.py with gccxml to regenerate SWIG interface
files (with hand-modifications afterwards).
Waow, well done ;-)
While doing that I noticed that all OCC classes derived from
Post by Mark Blome
Standard_Transient and Standard_Persistent no longer provide the HashCode
functions and therefore I had to remove all
%extend <some_class> {
Standard_Integer __hash__() {
return $self->HashCode(__PYTHONOCC_MAXINT__);
}
};
statements in the SWIG files. Initially I re-introduced the HashCode
functions in oce, which was really a bad idea: I experienced lots of
random crashes. Are those Hashcode functions
required on the python side or is python happy on those classes with the
default __hash__() function ?
HashCode was a member function for all classes that inherit from
Standard_Transient. However, since OCCT6.5.0 (or 6.5.1, I don't remember
exactly), this was changes by the OCC team. I already fixed this issue, a
month ago, in the tp/oce-0.10-support branch on github (see
https://github.com/tpaviot/pythonocc/branches). The related commit is
https://github.com/tpaviot/pythonocc/commit/00141683e58a641ac1103e3d8df706b75a712332to make use of the new HashCode function. Having a __hash__ method is a
requirement, since it is used by python lists/dicts (for instance when
looking for 'a_shape *in* a_list'). When modifying the SWIG files, you
should each time restart the unittest suite to check that you did not
introduce any regression. I think (but I'm not sure), that removing the
__hash__ method introduces some regression.
Post by Mark Blome
Also I had to modify SWIG_generator.py to avoid the generation of
artificial copy constructors by adding
return False
in write_functions(). Not sure if that is correct. Maybe that is due to
an issue with the specific gccxml version I use ?
I can't understand this part of your code. What problem do you try to solve?
Post by Mark Blome
If you like you can also directly contact me on my email address.
Of course not. This interesting contribution (and the related discussion)
has to remain public. I'm impressed by your deep understanding of the SWIG
OCCT wrapper, and your work/skill can help improving pythonocc while I'm
not having as much free time as I used to have in a recent past. Here is
* use OCE instead of the officiel OCCT. OCE is very easy to
compile/install compared to OCCT. You can work with the OCE 0.10 release ;
* I pushed a branch to the github repos that is sync with the oce master
branch (see my comment above). Please push code/comments/issue to
https://github.com/tpaviot/pythonocc. If you don't feel comfortable with
git, post code to this ml in the meantime ;
* you can send your improvements over salomesmesh/salomegeometry to Fotis
include your changes.
Post by Mark Blome
Thanks,
Mark
Much looking forward to discussing these issues with you,
Best Regards,
Thomas
Post by Mark Blome
Dear Mark,
I am developing a CAD & Meshing application for finite element
Post by Mark Blome
simulations (computational nano-optics) using PythonOCC.
Interesting!
I take it that your developing a custom solver?
Cool to see PythonOCC in such a sophisticated project, exciting.
Post by Mark Blome
I very much enjoy the rapid software development PythonOCC offers - it's
fun and robust at the same time.
Good to hear so.
Post by Mark Blome
For the software I develop I decided to update my local PythonOCC
installation to the latest version of the underlying libraries
- OCCT 6.5.3 (I use oce version 0.10)
- SMESH version 6.5.0
- GEOM version 6.5.0
- Netgen version 4.9.13 (fully functional netgen plugin with python wrapper)
- Tetgen version 1.4.3 (homebrewn tetgen plugin with python wrappers)
For this purpose I wrote python scripts that basically take the Salome
sources found in the install wizard and the PythonOCC V0.5 sources
and convert them to an updated PythonOCC Version applying necessary
patches (e.g. for netgen). Subsequently I hand-modified SMESH,
GEOM sources (to create stand-alone versions of them) and SWIG interface
files (where necessary, well, most of them, actually).
This is _very_ cool news.
Just to see if I follow you correctly: there has been an effort to
integrate GEOM and SMESH in PythonOCC, where we've been adapting an effort
by Fotios.
So, I'm curious to know whether by GEOM / SMESH you refer to the Salome
version or what has been integrated in PythonOCC yet.
If I follow along, you've been working on adapting code from Salome?
I'm curious if you've seen this example, coupling Code-Aster [1]?
[1]
https://github.com/tpaviot/pythonocc/tree/master/src/examples/Level2/FEM
Post by Mark Blome
I would like to contribute my modifications to give something back to
this great open-source library, but I am unsure as to how this could be
done.
Ideally, by creating a new branch from github [2]
[2] https://github.com/tpaviot/pythonocc
Post by Mark Blome
To this end the updated PythonOCC is running fine on my computer, I can
run almost all of my test-cases and use netgen and tetgen through PythonOCC.
I am still having some small issues with SMESH though (should be
resolved within the next days).
Wonderful. Do I understand that your SMESH version follows the Salome API?
Post by Mark Blome
There are some things I would like to discuss (e.g. HashCode functions
being absent in OCCT Standard_Transient and Standard_Persistent classes,
new dependencies of SMESH to boost threads and VTK).
That's what this list is here for.
1) HashCode functions being absent in OCCT Standard_Transient and
Standard_Persistent classes
In [1]: from OCC.Standard import *
In [2]: print Standard_Transient.HashCode
<unbound method Standard_Transient.Standard_Transient_HashCode>
https://github.com/tpaviot/pythonocc/tree/master/src/contrib
3) VTK is a powerful module. The current SMESH / GEOM module are built
optionally, where SMESH is creating more of an issue compiling / linking
but does not introduce new dependencies, other than boost.
Since we consider SMESH an add-on, we can be a little more relaxed about
this, than when it comes to "core" PythonOCC.
( Boost is not a PythonOCC dependency )
Post by Mark Blome
Also as I am developing on Mac OS X I did not update the SWIG interface
files for win32, so I
would need some help for this from people developing on Windows.
I hope Thomas Paviot can steer you in the right direction here.
Thanks Mark, looking fwd looking into your contributions!
Best,
-jelle
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
https://mail.gna.org/listinfo/pythonocc-users
jelle feringa
2012-08-17 11:37:29 UTC
Permalink
I think (but I'm not sure), that removing the __hash__ method introduces
some regression.
A solid test for __hash__ is critical. One needs to be able to compare
TopoDS_* instances for example, and I recall having some issues in the past
with the hashes.
Anyway, comparing TopoDS_* can be somewhat tricky.
Can you be more specific Thomas?
That way I can think about a better unittest.

-jelle
Thomas Paviot
2012-08-17 13:26:15 UTC
Permalink
I think (but I'm not sure), that removing the __hash__ method introduces
Post by Thomas Paviot
some regression.
A solid test for __hash__ is critical. One needs to be able to compare
TopoDS_* instances for example, and I recall having some issues in the past
with the hashes.
Anyway, comparing TopoDS_* can be somewhat tricky.
Can you be more specific Thomas?
That way I can think about a better unittest.
-jelle
There were issues with hashes before the overloading of the python __hash__
method with the HashCode OCCT method (which is now a static function). This
has been solved some time ago.

There's already a unittest for hash (see TestList here
https://github.com/tpaviot/pythonocc/blob/master/src/unittest/wrapper_features_unittest.py#L43).
I think it is sufficient, but you can extend it with additional use cases.

Thomas
jelle feringa
2012-08-17 14:03:12 UTC
Permalink
Post by Thomas Paviot
There were issues with hashes before the overloading of the python
__hash__ method with the HashCode OCCT method (which is now a static
function). This has been solved some time ago.
There's already a unittest for hash (see TestList here
https://github.com/tpaviot/pythonocc/blob/master/src/unittest/wrapper_features_unittest.py#L43).
I think it is sufficient, but you can extend it with additional use cases.
I think so too, that test looks pretty solid...
Loading...