Download (as "ellipsis-polygons.txt") ellipsis-polygons
#!/usr/bin/perl
use strict;
use GDS2;
use Getopt::Std;
require './inscribe_polygon-ellipsis.pm'; # please download this too
## ----------------------------------------------------
our(%opts,@ARGV);
## Sample program to test inscribe_polygon.pm package
my($VERSION);
$VERSION = "2019-09-27 04:45" ; # written by emacs time-stamp
## ----------------------------------------------------
## M A I N R O U T I N E
## ----------------------------------------------------
my $span = 100;
my $pitch = 0.1;
my $filename = $0; # --- set filename with the same as this script
$filename =~ s/\.txt$//; # --- Strip '.txt' part
# 単に dot(.) と書くと、「何でも文字一つ」にー致するので、 # $ は行末を意味します
$filename =~ s/^[0-9]*\.//;
my $gds_name = sprintf("%s.gds", $filename);
#print $gds_name . "\n"; exit;
my $gds2File = new GDS2(-fileName=> '>'. $gds_name);
$gds2File -> printInitLib(-name=>'LibraryName');
my @LIST;
# -----------------------------------------------------
# generate structure and collect the name of them
# -----------------------------------------------------
push (@LIST, inscribe::ellipsis_polygon(14, 10, 0.1, $gds2File));
push (@LIST, inscribe::ellipsis_polygon(14, 14, 0.4, $gds2File));
push (@LIST, inscribe::ellipsis_polygon(10, 14, 0.5, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 8, 6, 0.2, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 6, 8, 0.6, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 0.44, 0.40, 0.025, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 2.5, 0.010, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 2.5, 0.025, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 2.5, 0.050, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 2.5, 0.1, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 2.5, 0.5, $gds2File));
push (@LIST, inscribe::ellipsis_polygon( 5, 1.0, 0.1, $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, $i * 15]);
}
$gds2File -> printEndstr();
$gds2File -> printEndlib();
__END__
|