Marko Knöbl | 5 Apr 02:03

How to use undo/redo?

Hi! I'm trying to figure out how to use the undo/redo functionality in 
pythonOCC. From reading docstrings and source code I guess I'll have to use an 
instance of OCC.PAF.Context.ParametricModelingContext with "undo" and "commit" 
set to True. But I didn't get any further. Can somebody please provide some 
example or explanation on how it works?

PS: Once I understand how it works I'd like to help by providing some 
documentation for this. Would the github wiki be the right place to put it?

Thanks, Marko

Dave Cowden | 14 Mar 01:07
Picon

Decompose BSpline to arcs and lines?

Hi, all ( especially Jelle ):


I'm trying to solve a problem i just know someone else has solved: converting a bspline into arcs and lines. ( Actually in my  case i have a list of points, through which I am interpolating a bspline-- so i could skip that step actually. )

Anyway, I came across this OCC thread, which yielded several ideas but its not clear there was a solution:


I tried to fetch the URL Jelle Posted for hb-robotics-code on google, but the link is dead.

 
Does anyone know if there s any pythonOCC code I can grab that will make solving this problem easier?  If not, I certainly think its worth adding to pythonOCC.

Since my problem doesnt care about the intermediate bspline ( I have a list of points ), then I may instead use something along the lines of one of these  algorithms:


which seems very fast. It is for arc detection, but of course what's left is just lines.

Has anyone else had experience with this problem?
thanks a lot!
Dave
Thomas Paviot | 9 Mar 08:31
Picon

RE : Re: Working with python and STEP

Hi steve,

This branch was deleted.

Try tp/python-generator-stage2.

Thomas
- sent from my Android phone

Le 9 mars 2012, 8:00 AM, "Stephen Waterbury" <waterbug <at> pangalactic.us> a écrit :

Hi Thomas,

I just tried to check out the python-generator-dev branch of the
StepClassLibrary using the directions on the wiki (link [4]
below) but it didn't work -- apparently git doesn't recognize
that branch, or any branch other than "master", in the SCL repo
... here is my session:
-----------------------------------------------------------------
$ git clone git://github.com/mpictor/StepClassLibrary.git
Initialized empty Git repository in /home/waterbug/src/StepClassLibrary/python-generator-dev/StepClassLibrary/.git/
remote: Counting objects: 5623, done.
remote: Compressing objects: 100% (1600/1600), done.
remote: Total 5623 (delta 4107), reused 5442 (delta 3945)
Receiving objects: 100% (5623/5623), 8.26 MiB | 257 KiB/s, done.
Resolving deltas: 100% (4107/4107), done.
$ cd StepClassLibrary/
$ git checkout tp/python-generator-dev
error: pathspec 'tp/python-generator-dev' did not match any file(s) known to git.
$ git branch
* master
$
-----------------------------------------------------------------

Am I doing something wrong?

Cheers,
Steve

On 01/11/2012 02:15 AM, Thomas Paviot wrote:

> > Hi, > > This message might be off-topic, but those of you using to work with > python and STEP/E...

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users <at> gna.org
https://mail.gna.org/listinfo/pythonocc-users


_______________________________________________
Pythonocc-users mailing list
Pythonocc-users <at> gna.org
https://mail.gna.org/listinfo/pythonocc-users
Milos Davidovic | 8 Mar 19:29
Picon

Why is new TopoDS_Shape object always generated when shape is selected

Hi everybody!


I was wondering, why the following happens. Lets imagine that we draw a simple cube:

display.DisplayShape(BRepPrimAPI_MakeBox(1,1,1).Shape())        

however, when we select this shape we get this as output:
Current selection (single): <OCC.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x060BD638> >

and if we select it again:
Current selection (single): <OCC.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x060BD650> >

which is a different object. 

What can be done to uniquely identify selected shapes? Is there a way to hash TopoDS shapes for example?

Best regards,
Milos
Hans L | 7 Mar 07:37
Picon

Using pythonOCC on Ubuntu 11.10

I'm trying to get pythonOCC running right on my Ubuntu 11.10 64bit box.

I started with instructions on this page:
http://www.pythonocc.org/resources/build_install/installrun-pythonocc-on-ubuntu-10-04-lucid-lts-in-5-steps-and-10-minutes/

Which says to use this PPA:  http://ppa.launchpad.net/cae-team/ppa/ubuntu/

However that PPA does not have pyhonOCC package for Ubuntu Oneiric 11.10.

Then I found hmeyer's comment on that same page, about his own PPA, which eventually led me to this PPA
https://launchpad.net/~hmeyer/+archive/3d?field.series_filter=oneiric
which contains the oneiric packages.

I was able to install pythonOCC from this PPA, but when I run the example from the install instructions:
from OCC.Display.SimpleGui import *
from OCC.BRepPrimAPI import *
display, start_display, add_menu, add_function_to_menu = init_display()
my_box = BRepPrimAPI_MakeBox(10.,20.,30.).Shape()
display.DisplayShape(my_box)
start_display()


I get the following error:
 ###### 3D rendering pipe initialisation #####
Display3d class initialization starting ...
Traceback (most recent call last):
  File "tut1.py", line 7, in <module>
    display, start_display, add_menu, add_function_to_menu = init_display()
  File "/usr/lib/pymodules/python2.7/OCC/Display/SimpleGui.py", line 161, in init_display
    win.canva.InitDriver()
  File "/usr/lib/pymodules/python2.7/OCC/Display/qtDisplay.py", line 108, in InitDriver
    self._display.Create()
  File "/usr/lib/pymodules/python2.7/OCC/Display/OCCViewer.py", line 84, in Create
    self.Init(self._window_handle)
RuntimeError: Aspect_GraphicDeviceDefinitionError
libftgl.so.2: cannot open shared object file: No such file or directory


I have these packages installed already:  ftgl-dev, libftgl-dev, libftgl2. 
I'm not sure where libftgl.so.2 is supposed to come from.

Can anyone tell me what else I need for this to work?

Thanks,
Hans

Hannes Kröger | 23 Jan 23:46
Picon
Picon

SMESH: Creating Group On Geometry

Hello Experts,

I have just managed to install python OCC 0.6 together with oce 0.8.0,
GEOM 6.3.1 and SMESH 5.1.2 on Ubuntu 11.10.

My intention is to create meshes for CFD with the SMESH classes.
Everything works so far: I have created geometry and a hexahedral mesh
and could export it in a UNV file.

Now I want to name the boundaries by creating "GroupOnGeom". I followed
the example/Level1/grouping.py (seems a bit outdated, it needed some
changes to run) but this example does not work when I change the output
from ExportDAT to ExportUNV.
The script terminates when writing the groups to the UNV file with a
"segmentation fault"

Is there some common mistake, which I could have stumbled over? What is
the preferred way to name the boundaries?

Thanks for any info.

Regards, Hannes

Thomas Paviot | 11 Jan 11:15
Picon

Working with python and STEP

Hi,


This message might be off-topic, but those of you using to work with python and STEP/EXPRESS product data will perhaps be interested in the python generator I contributed to the StepClassLibrary project [1][2]. This early release was announced [3] yesterday. A wiki entry [4] introduces the project purpose, how to get/build/install/getting started etc.

This project is not a dependency of pythonocc (nor the opposite), but it is closely related and could be a 'partner': one can imagine, for instance, a STEP Part21 file quality checker based upon python/SCL, processing an AP203 file before it is sent to pythonOCC for rendering. 

Regards,

Thomas

Kermit | 10 Jan 16:53
Picon

Python OCC and Win64 compilation

Hi,


i've try to compile Python OCC with VS2010, Win64 and Python 2.7

compilation and build of OCE-bundle OK
compilation and build of OCE ( fresh git ) OK

but for compilation of pythonocc, i've this error :
fatal error C1083: Cannot open include file: 'Standard_Static.hxx'

in fact, this file doesn't exist

thx for your help

Kermit
Henning Meyer | 8 Jan 21:17
Picon
Gravatar

pythonocc reference api/ tutorial?

Hello *,

is there a reference api besides http://api.pythonocc.org/ - which is
quite commentless and therefore still leaves a lot of room for
questions. Or is there even an tutorial?
Or is all documentation to be based on OCC-doc? How to get it, if I
don't want to give them my personal data?

and...practically speaking: How do I do CSG with 2d-shapes, e.g. Union
of two Geom2d_Circle?

Thank you,

Henning

Thomas Paviot | 6 Jan 11:08
Picon

Re: Opencascade and PyQt: Possible license incompatibilities, (Open CASCADE Technology Public License vs GPL)

2012/1/6 jelle feringa <jelleferinga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The issue is then to *remove* any python code based upon PyQt from pythonocc.

?
Nope, I can write "from X import Y" whatever draconian licensing X uses.
That is code written by me, not X...

Of course you wrote the code, but you're not free to do whatever with *your* code if it is based upon a third part software. I do think that just writing:
'from PyQt4 import QtCore'
is enough for your code to fall under PyQt license, that is to say the GPL license (but I'm not sure about that).

However, what I'm sure about is that the module qtDisplay.py must be distributed under the GPL license, and then removed from pythonocc (LGPL).

...
Hence the Pyside / PyQt4 import abstraction is a pretty good idea I think...

I don't think so.

Thomas

Oliver Borm | 5 Jan 16:45
Picon

Re: Opencascade and PyQt: Possible license incompatibilities, (Open CASCADE Technology Public License vs GPL)


So in essence this problem was introduced with the license change of
pythonOCC from GPL to LGPL last year. We have already discussed this
change on this list, but it would theoretical be possible to change the
license of pythonOCC again to GPL in order to resolve this issue?!?


Gmane