Menu

#124 povray format problem

2.2
open
nobody
None
5
2015-02-12
2008-02-01
Anonymous
No

I am using OpenBabel 2.1.1 under Windows. When translating a file (of any format) into .pov (povray), teh atoms are declared with the path of the initial file when it will be better if the are declared with the type of atom.

Example with the water molecule as produced by OpenBabel (I have attached what I think it is a more reasonable file):
//Coodinates of atoms 1 - 3

declare D:\imartinez\Mes_images\nanoseries\water6_pos_1 = <-2.174,2.006,0>;

declare D:\imartinez\Mes_images\nanoseries\water6_pos_2 = <-2.544,3.053,0>;

declare D:\imartinez\Mes_images\nanoseries\water6_pos_3 = <-1.064,2.006,0>;

//Povray-description of atoms 1 - 3

declare D:\imartinez\Mes_images\nanoseries\water6_atom1 = object {

  Atom_O
  translate D:\imartinez\Mes_images\nanoseries\water6_pos_1
 }

declare D:\imartinez\Mes_images\nanoseries\water6_atom2 = object {

  Atom_H
  translate D:\imartinez\Mes_images\nanoseries\water6_pos_2
 }

declare D:\imartinez\Mes_images\nanoseries\water6_atom3 = object {

  Atom_H
  translate D:\imartinez\Mes_images\nanoseries\water6_pos_3
 }

//Povray-description of bonds 1 - 2

if (BAS)

declare D:\imartinez\Mes_images\nanoseries\water6_bond0 = object {

  bond_1
  scale <1.11045,1.0000,1.0000>
  rotate <0.0000,0.0000,70.5371>
  rotate <0.0000,-180,0.0000>
  translate D:\imartinez\Mes_images\nanoseries\water6_pos_1
 }

declare D:\imartinez\Mes_images\nanoseries\water6_bond1 = object {

  bond_1
  scale <1.11,1.0000,1.0000>
  translate D:\imartinez\Mes_images\nanoseries\water6_pos_1
 }

end //(BAS-Bonds)

if (CST)

declare D:\imartinez\Mes_images\nanoseries\water6_bond0 = object {

  union {
   object {
    bond_1
    pigment{color Color_O3}
    scale <0.555227,1.0000,1.0000>
    rotate <0.0000,0.0000,70.5371>
    rotate <0.0000,-180,0.0000>
    translate D:\imartinez\Mes_images\nanoseries\water6_pos_1
   }
   object {
    bond_1
    pigment{color Color_H}
    scale <0.555227,1.0000,1.0000>
    rotate <0.0000,0.0000,250.537>
    rotate <0.0000,-180,0.0000>
    translate D:\imartinez\Mes_images\nanoseries\water6_pos_2
   }
  }
 }

declare D:\imartinez\Mes_images\nanoseries\water6_bond1 = object {

  union {
   object {
    bond_1
    pigment{color Color_O3}
    scale <0.555,1.0000,1.0000>
    translate D:\imartinez\Mes_images\nanoseries\water6_pos_1
   }
   object {
    bond_1
    pigment{color Color_H}
    scale <0.555,1.0000,1.0000>
    rotate <0.0000,0.0000,180>
    translate D:\imartinez\Mes_images\nanoseries\water6_pos_3
   }
  }
 }

end // (CST-Bonds)

//All atoms of molecule D:\imartinez\Mes_images\nanoseries\water6

ifdef (TRANS)

declare D:\imartinez\Mes_images\nanoseries\water6_atoms = merge {

else

declare D:\imartinez\Mes_images\nanoseries\water6_atoms = union {

end //(End of TRANS)

  object{D:\imartinez\Mes_images\nanoseries\water6_atom1}
  object{D:\imartinez\Mes_images\nanoseries\water6_atom2}
  object{D:\imartinez\Mes_images\nanoseries\water6_atom3}
 }

//Bonds only needed for ball and sticks or capped sticks models

if (BAS | CST)

declare D:\imartinez\Mes_images\nanoseries\water6_bonds = union {

  object{D:\imartinez\Mes_images\nanoseries\water6_bond0}
  object{D:\imartinez\Mes_images\nanoseries\water6_bond1}
 }

end

//Definition of molecule D:\imartinez\Mes_images\nanoseries\water6

if (SPF)

declare D:\imartinez\Mes_images\nanoseries\water6 = object{

  D:\imartinez\Mes_images\nanoseries\water6_atoms

else

declare D:\imartinez\Mes_images\nanoseries\water6 = union {

  object{D:\imartinez\Mes_images\nanoseries\water6_atoms}

if (BAS | CST)//(Not really needed at moment!)

if (TRANS)

  difference {
   object{D:\imartinez\Mes_images\nanoseries\water6_bonds}
   object{D:\imartinez\Mes_images\nanoseries\water6_atoms}
  }

else

  object{D:\imartinez\Mes_images\nanoseries\water6_bonds}

end //(End of TRANS)

end //(End of (BAS|CST))

end //(End of SPF)

// bounded_by {
// box {
// <-5.544,-3,-3>
// <3,6.053,3>
}

//Center of molecule D:\imartinez\Mes_images\nanoseries\water6 (bounding box)

declare D:\imartinez\Mes_images\nanoseries\water6_center = <1.272,-1.5265,-0>

Thank you,
Irene Suarez
(irene.suarez/at/crns-imn.fr)

Discussion

  • Nobody/Anonymous

    suggestion of a water molecule in a more reasonable povray format

     
  • Noel O'Boyle

    Noel O'Boyle - 2008-02-01

    water molecule as produced by openBabel

     
  • Noel O'Boyle

    Noel O'Boyle - 2008-02-01

    Logged In: YES
    user_id=850620
    Originator: NO

    Attaching file from duplicate bug 1884384...
    File Added: water-OpenBabel2.1.1.pov

     
  • Geoff Hutchison

    Geoff Hutchison - 2008-06-27

    Logged In: YES
    user_id=21420
    Originator: NO

    This is more of a feature suggestion...