Dear all,
I have written a perl script to create a line of new atoms which has been shown below:
After running this perl script, I have got a line of new atoms:
Now I would like to create a plane and a volume of new atoms just as these two figures below:
How to modify my script?
Thanks.
Best regards,
Yours
CHENG Xu

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.