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 "triangle-array-nega.txt")

triangle-array-nega

#!/usr/pkg/bin/perl
use strict;
use GDS2;
require './arc.pm';
# global variable;
my $R3	= 1.7320508;

sub unit($$$) {
    my $pitch    = shift;
    my $diameter = shift;
    my $gds2File = shift;

    my $P	= $pitch;
    my $R	= $diameter / 2;
    my $U	= $R3/2 * $P;
    # get center coordinate

    my @ARC1 = arc::arc(  -0.5 * $P,  $U, 270, 360, $R, 12, 'not-used',  1, $gds2File);
    my @ARC2 = arc::arc(   0.5 * $P,  $U, 180, 270, $R, 12, 'not-used',  1, $gds2File);
    my @ARC3 = arc::arc(   0,         0,    0, 180, $R, 24, 'not-used',  1, $gds2File);
    my @ARC4 = arc::arc(   0,         0,  180, 360, $R, 24, 'not-used',  1, $gds2File);
    my @ARC5 = arc::arc(   0.5 * $P,  -$U, 90, 180, $R, 12, 'not-used',  1, $gds2File);    
    my @ARC6 = arc::arc(  -0.5 * $P,  -$U,  0,  90, $R, 12, 'not-used',  1, $gds2File);
    $gds2File -> printBgnstr(-name => 'unit');
    $gds2File -> printBoundary(
	-xy => [ -$P/2, 0,
		 @ARC1,
		 @ARC2,
		 $P/2, 0,
		 @ARC3,
		 @ARC4,
		 $P/2, 0,
		 @ARC5,
		 @ARC6,
	]);
    $gds2File -> printEndstr();
}
# -----------------------------------------------------
#                     M A I N 
# -----------------------------------------------------
my $filename = $0;
   $filename =~ s/\.txt$//;
   $filename .= '.gds';

my($VERSION);
$VERSION = "2018-11-01 01:20" ; # written by emacs time-stamp
## $VERSION .= ' UTC';

my $gds2File = new GDS2(-fileName => '>'. $filename);
$gds2File -> printInitLib(-name => 'array');

my $span    = 24000;
my $pitch   = 2.1;
my $pitch_v   = $pitch * $R3;
my $diameter  = 1.9;
unit($pitch, $diameter, $gds2File);

my $columns = int($span / $pitch);
my $rows    = int($span / $pitch_v);

my $span_x  = $columns * $pitch;
my $span_y  = $rows    * $pitch_v;

$gds2File -> printBgnstr (-name =>'top');
$gds2File -> printAref(
    -name => 'unit',
    -columns => $columns,
    -rows    => $rows,
    -xy      => [ -$span_x / 2,  -$span_y / 2,
		   $span_x / 2,  -$span_y / 2,
		  -$span_x / 2,   $span_y / 2,
		  ],
    );
$gds2File -> printEndstr ();
$gds2File -> printEndlib();

__END__
See perldoc GDS2 for help

perl DrieCondPerl
; please note I have copy in ~/.emacs-sub/time-stamp-setup.el
(reuiqre 'time-stamp)
(add-hook 'write-file-hooks 'time-stamp)
(setq time-stamp-active t)
;; (setq time-stamp-time-zone "UTC")
(setq time-stamp-time-zone nil)
(setq time-stamp-format "%04y-%02m-%02d %02H:%02M");
(setq time-stamp-start "$VERSION = \"") ;
(setq time-stamp-end "\"") ;
(setq time-stamp-line-limit 20) ; ; default is 8
Last Update: Mon, 21 Feb 2022 10:13:01 GMT 1.66 2008/03/08