# Draw a plane using Python

**URL:** <https://discuss.avogadro.cc/t/draw-a-plane-using-python/1886>\
**Category:** Development\
**Created:** [May 24, 2010, 3:54pm UTC](https://discuss.avogadro.cc/t/draw-a-plane-using-python/1886 "2010-05-24T15:54:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reinis\_Danne](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/r/f08c70/32.png) [@Reinis\_Danne](https://discuss.avogadro.cc/u/Reinis_Danne)\
**Post date:** [May 24, 2010, 3:54pm UTC](https://discuss.avogadro.cc/t/draw-a-plane-using-python/1886/1 "2010-05-24T15:54:24Z")

</div>

Hi!

I’m trying to write some Python plugin for Avogadro but it seems that  
not all of the API is available from Python (Painter?)… is it possible  
to draw geometrical shapes using Python? I want to draw a transparent  
rectangle with specified dimensions (or normal) in the (xy) plane.

glwidget.painter drawing methods in extension does nothing, e.g.,  
glwidget.painter.drawSphere(zeros(3), 1.0). Interacting with molecule  
(glwidget.molecule) works fine. What exactly glwidget.painter is  
supposed to do? How it is intended to be used?

I also tried to implement an engine. With that I’m able to draw text,  
lines and spheres, but not quadrilaterals! And there is no error  
messages nor warnings that the drawing have failed. Debug information or  
the lack of it is quite some problem.

I’m using Avogadro 1.0.1 on 64bit Gentoo Linux.

Any pointers would be appreciated.

Thanks for the great program!  
Reinis
