Download (as "inscribe_polygon.txt") inscribe_polygon
#!/usr/bin/perl
use strict;
use GDS2;
require './inscribe_polygon.pm'; # please download this too
## ----------------------------------------------------
## Sample program to test inscribe_polygon.pm package
my($VERSION);
$VERSION = "2019-09-13 02:32" ; # written by emacs time-stamp
## ----------------------------------------------------
## M A I N R O U T I N E
## ----------------------------------------------------
my $filename = $0; # --- set filename with the same as this script
$filename =~ s/\.txt$//; # --- Strip '.txt' part
# 単に dot(.) と書くと、「何でも文字一つ」にー致するので、 # $ は行末を意味します
my $gds_name = sprintf("%s.gds", $filename);
my $gds2File = new GDS2(-fileName=> '>'. $gds_name);
$gds2File -> printInitLib(-name=>'LibraryName');
my @LIST;
# -----------------------------------------------------
# generate structure and collect the name of them
# -----------------------------------------------------
push (@LIST, inscribe::inscribe_polygon(15, 0.1, $gds2File));
push (@LIST, inscribe::inscribe_polygon(12, 1.5, $gds2File));
push (@LIST, inscribe::inscribe_polygon( 8, 2, $gds2File));
push (@LIST, inscribe::inscribe_polygon( 8, 0.6, $gds2File));
push (@LIST, inscribe::inscribe_polygon( 0.44, 0.025, $gds2File));
push (@LIST, inscribe::inscribe_polygon( 0.50, 0.010, $gds2File));
push (@LIST, inscribe::inscribe_polygon( 0.75, 0.050, $gds2File));
# --------------------------------------------------------
# place collected structure on to top with the pitch 20
# -------------------------------------------------------
$gds2File -> printBgnstr( -name => 'top');
foreach my $i (0..$#LIST){
$gds2File -> printSref (-name => $LIST[$i], -xy => [0, 20 * $i]);
}
$gds2File -> printEndstr();
$gds2File -> printEndlib();
__END__
|