Question about create new atom

Dear all,

I have written a perl script to create a line of new atoms which has been shown below:

ps.png

After running this perl script, I have got a line of new atoms:

line.png

Now I would like to create a plane and a volume of new atoms just as these two figures below:

plane.pngvolume.png

How to modify my script?

Thanks.

Best regards,

Yours

CHENG Xu

Answers 1
BM
BM 2014-07-11

Hi

For a grid of aotms in the XY plane use something like:

for (my $x_start = 1; $x_start <=10; $x_start = $x_start + 1)

{

      for (my $y_start = 1; $y_start <=10; $y_start = $y_start + 1)

      {

           $doc->CreateAtom("Si", Point(X => $x_start, Y => $y_start, Z => 0.2));

      }

}

I have not checked the syntax but the method should be clear! I leave it as an excercise for you to do repeat it the z direction to fill the volume!!!!

Regards

S.

BTW In your code snippet the statement "my $start = 1" the variable "$start" is masked within the for loop that follows by the variable of the same name.