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 "simple.txt")

simple

#!/usr/bin/perl -w
# GDSII generation 
#   Most simple example, have only one box-500 structure.
#   It has one boundary.

use GDS2;                                               # --- enable GDSII (GDS2) library
# strict checks variable declaration and subroutine argument consistency
use strict;
  
my $VERSION = "2018-09-03 06:30" ;                      # written by emacs time-stamp (UTC)
## --------------------------------------------
##          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';		                        # ---  Add '.gds' to (output) filename
                                                        #      dot(.) connects string

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

$gds2File -> printInitLib(-name=>'LibraryName');        # --- always necessary for start
							#     名前は何でも良いです
$gds2File -> printBgnstr( -name=> 'box-500');           # --- Start new structure
$gds2File -> printBoundary(                             # --- Boundary with four coordinate
    -xy=>  [-250, -250,
             250, -250,
             250,  250,
            -250,  250],
    -layer=> 0,                                         # --- layer (省略可。その時は 0)
    );

$gds2File -> printEndstr();                             # --- End of this new structure
$gds2File -> printEndlib();                             # --- close library
__END__

Last Update: Mon, 21 Feb 2022 10:13:01 GMT 1.66 2008/03/08