2010/2/16 Willy Hertz <willy.he...@yahoo.com>

> hi all,
> i am pythonocc newbie, and my question may seem stupid.
>
> i try to modify a shape in the InteractiveVeiwer example from the pythonocc
> samples, after it has been displayed using display.DisplayShape(shape).
> the following code creates four edges of a rectangle in the plane z=0, and
> one of the edges should be translated to z=10:
>
>     p1=gp_Pnt(0,0,0);
>     p2=gp_Pnt(0,1,0);
>     p3=gp_Pnt(1,1,0);
>     p4=gp_Pnt(1,0,0);
>     e1=BRepBuilderAPI_MakeEdge(p1,p2).Edge()
>     e2=BRepBuilderAPI_MakeEdge(p2,p3).Edge()
>     e3=BRepBuilderAPI_MakeEdge(p3,p4).Edge()
>     e4=BRepBuilderAPI_MakeEdge(p4,p1).Edge()
>     trsf=gp_Trsf();
>     trsf.SetTranslation(gp_Vec(0,0,10));
>     display.DisplayShape(e1);
>     display.DisplayShape(e2);
>     display.DisplayShape(e3);
>     display.DisplayShape(e4);
>     e1.Move(TopLoc_Location(trsf));
>
> this works like a charm, if i put the e1.Move(...) command before the
> display.DisplayShape(...) commands. but not in the order above.
>
> how can i modify what is displayed, after a shape has already been
> displayed?
>
> do i have to remove the modified shape, remove it from the display, and
> create+display the modified shape again? then please tell me how to remove a
> shape from the display. GraphicsCanva3D has the DisplayShape() function, but
> except for EraseAll() there is no function to remove a singe shape?
>
> when answering please consider that i don't understand the pythonocc
> concepts in great detail. please assume that i am as stupid as my question
> ;)
>

Hi Willy,

Welcome to this list. Feel free to ask any question, even if you didn't RTFM
(actually, there's no FM!).

I suggest you have a look at the 'animation' sample in the
/samples/Level1/animation folder. The source code of this script is
available at
http://svn.gna.org/viewcvs/pythonocc/trunk/src/samples/Level1/Animation/animation.py?rev=781&view=markup

I think it does what you want to achieve.



>
> Willy
>

Best Regards,

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

Reply via email to