Bryan Bishop a écrit : > On Fri, Apr 17, 2009 at 5:58 AM, Jelle Feringa <jelleferi...@gmail.com> wrote: > >>> I didn't notice this bug on Windows or Ubtuntu 8.04. This may come from >>> your video driver or may be related to OpenCascade/OpenGL. >>> >>> Anyone else encoutered this bug? >>> >> Setting a nice shading in pythonOCC can be tricky. >> Could you perhaps upload a few images such that we can see what you mean >> Bryan? >> > > Yes. In this first image, you see that as I rotate the cylinder > around, it actually starts to become transparent: > http://heybryan.org/~bbishop/docs/gears/CADgears2/wtf.png >
The small cylinder (foreground) seems to be clipped, not being transparent. > In this image, you see that a top-view of my cylinders makes them all > white (rather than yellow): > http://heybryan.org/~bbishop/docs/gears/CADgears2/worm_bottom.bmp > I sent this to somebody to repeat and it produces the problem: > http://heybryan.org/~bbishop/docs/scripts/pythonocc-coloring-error.py > I also have the same problem. It confirms the previous observation. I think it's something relevant to OpenGL lightning (emissive color, specular, ligths etc.). Documentation for the SetColor method of AIS_InteractiveContext states 'Set the color of the selected entity'. However, even if you define the color of the AIS_InteractiveObject, there is always a default material for this shape. You then have to set emissive, specular etc. colors for this material. For instance: mat.SetDiffuse(1.0) mat.SetDiffuseColor(m_color) mat.SetEmissive(1.0) mat.SetEmissiveColor(m_color) mat.SetReflectionModeOn(Graphic3d_TOR_EMISSION) mat.SetShininess(0.5) (extracted from OCC post: http://www.opencascade.org/org/forum/thread_5432/ ) Note thath you can create your own material with pythonOCC and call display.DisplayShape(shape,mat). I have on sample somewhere on my harddisk that I have to find out and upload to the repository. Cheers, Thomas _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users