Perl で gdsii
実行環境
  Active Perl
     更新するには
ppm
  ppm
  DownLoad
  実行
Help
   perldoc GDS2
Examples
  basic-lines
  simple
  simple-sref
  aref
  circle
  circle-inverted
  sample-arc
  donut
  Inverted-Donuts
  Donuts_Combination
  Hello-World
  CP-array
  text2gds.pm
  rotate.pm
  rotate-rectangle
  arc.pm
  line-and-space-180
  triangle-array-nega
  sq_sleeve.pm
  TriangleGridStep
  triangle-array-nega-CP
  CirclesArray-SQ
  LargeCircles
  MA6-Alignment-mark.pm
  Alignment-Place
  Triangle-Grid
  Triangle-Grid-Wide
  ellipsis-polygons
  inscribe_polygon
  inscribe_polygon.pm
  inscribe_polygon-ellipsis.pm
  sleeving-by-square-sample
  sleeving-by-square.pm

Perl Perl/GDSII page
Download (as "line-and-space-180.txt")

line-and-space-180

#!/usr/bin/perl -w
# GDSII generation 
# Line and Space 0.18 x 2 を  2880 x 2880 の四角に並べたもの作ります。
# 2880 um というのは、
# Field Size 32 um と、刻み(pitch) 0.36 um の最小公倍数です  Least Common Multiple

use GDS2;						# --- enable GDSII (GDS2) library
# strict checks variable declaration and subroutine argument consistency
use strict;
  
my $VERSION = "2018-10-24 01:47" ;			# written by emacs time-stamp
## --------------------------------------------
##          M A I N  R O U T I N E 
## --------------------------------------------
my ($gds2File);						# ---  file handle

#		出力名を 「自分の名前.gds」 に設定します。ただし、もし、 .txt が付いていたら、それは先に削除します。
my $filename = $0;					# ---  set filename with the same as this script
   $filename =~ s/.txt$//;				# ---  Strip '.txt' part
							#      $ は行末を意味します
   $filename .= '.gds';					#      . connects string

$gds2File = new GDS2(-fileName=> '>'. $filename);	# ---  open new GDS2 (object) to write

$gds2File -> printInitLib(-name=>'LibraryName');	# --- always necessary for start

my $W = 0.18;						# --- 幅  (um)
my $L = 2880;						# --- 一単位の大きさ、縦と横
my $name = 'line-0.18x2880';				# --- 名前

# 本来は必要ないのですが、念為、同じものを別の layer で作って、隣に並べて大丈夫かを確認します
# -------------------------------------------------------
#                     一つ目の縦線, layer 1
# -------------------------------------------------------
$gds2File -> printBgnstr( -name=> $name.'.1');		# --- Start new structure
$gds2File -> printBoundary( 
    -xy=>  [-$W/2, -$L/2, $W/2, -$L/2, $W/2, $L/2, -$W/2, $L/2],
    -layer=> 1,
    );
 $gds2File -> printEndstr();				# --- End of this new structure

# -------------------------------------------------------
#                    二つ目の縦線, layer 2
# -------------------------------------------------------
$gds2File -> printBgnstr( -name=> $name.'.2');		# --- Start new structure
$gds2File -> printBoundary( 
    -xy=>  [-$W/2, -$L/2, $W/2, -$L/2, $W/2, $L/2, -$W/2, $L/2],
    -layer=> 2,
    );
 $gds2File -> printEndstr();				# --- End of this new structure

# -------------------------------------------------------
#  一つ目の縦線を 2.880 m/m 四方に並べます bef 変換に使うので  top としておきます
# -------------------------------------------------------
my $name_1 ='top';
$gds2File -> printBgnstr( -name=> $name_1);		# --- Start another structure
  $gds2File -> printAref( 				# --- Place structure reference
      -name	=>  $name .'.1', 				# --- of name 'box-500
      -columns	=>  $L/($W * 2),
      -rows	=>  1,							
      -xy	=> [ -$L/2 + $W, 0, 
		      $L/2 + $W, 0, 
		      $L/2 + $W, 0],
	);							
 $gds2File -> printEndstr();				# --- End of this new structure
# -------------------------------------------------------
#              二つ目の縦線を 2.880 m/m 四方に並べます
# -------------------------------------------------------

my $name_2 ='span-2880x2880.2';
$gds2File -> printBgnstr( -name=> $name_2);		# --- Start another structure
  $gds2File -> printAref( 				# --- Place structure reference
      -name	=>  $name .'.2', 				# --- of name 'box-500
      -columns	=>  $L/($W * 2),
      -rows	=>  1,							
      -xy	=> [ -$L/2 + $W, 0, 
		      $L/2 + $W, 0, 
		      $L/2 + $W, 0],
	);							
 $gds2File -> printEndstr();				# --- End of this new structure

# 何も考えないと  0.36 x 8000, 2880 x 1 で、 2880 x 2880 の大きさになります
#                     -1440, -1440
#                      1440, -1440
#                     -1440,  1440
# ところ、が、それは空きの(間の)空白も含んだ数え方なので、 最後の 0.18 x 2880 には
# 何も置かれない
# これを パターン + 空白部分 = (0.36um) の半分ずつ、右に動かしています

# 以下は、調査用(人間が確認するため)のものですので、座標を簡単にしています。中心は (0,0) には
# なりません。 bef 変換する時には上のうちの一つだけを使います。 --root top

$gds2File -> printBgnstr( -name=> 'human-check');	# --- Start another structure
$gds2File -> printSref( -name => $name_1,		# --- Place structure
			-xy => [0,0]);
$gds2File -> printSref( -name => $name_2,		# --- Place structure
			-xy => [2880,0]);

$gds2File -> printEndstr;    				# --- End 'TOP' structure

$gds2File -> printEndlib(); 				# --- close library
__END__
Last Update: Mon, 21 Feb 2022 10:13:01 GMT 1.66 2008/03/08