On Mon, 21 Mar 2005 13:49:22 -0500
"Richard" <[EMAIL PROTECTED]> wrote:

> I would like to create soya Volumes with an added property of id.
> 
> ie.
> soya.Volume(world, soya.cube.Cube(None, green).shapify()).set_xyz(
> 0.0, -1.0, 0.0)
> 
> to something like
> 
> soya.VolumeID(world. soya.cube.Cube(None, green).shapify(),
> id).set_xyz(0.0, -1.0, 0.0)
> 
> specifically so i can return this value from impact.parent as in the
> raypicking-2.py example
> 
> ie.
> myid = impact.parent.id
> any ideas would be greatly appreciated

You can extend Soya classes as any Python classes :

class VolumeID(soya.Volume):
  def __init__(self, parent, shape, id):
    soya.Volume.__init__(self, parent, shape)
    self.id = id

Jiba

Reply via email to