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

circle-inverted

#!/usr/bin/perl -w
# 21 x 21 um の四角の中を
# 直径 9.5 um の 24 角形でくり抜く
# circle と比べると、 外側の 6 点を追加しただけ
use GDS2;
use strict;
use POSIX qw(floor ceil);
use Getopt::Std;
use Math::Trig;

require './text2gds.pm';
require './arc.pm';     # 円弧座標(の組)を計算して返す
# ---------------------------------
#  arc::arc(中心 x, 中心 y, 開始角, 終了角, 半径, 頂点の数,
#           'not-used', 時計回り(-1) or 反時計回り(1)   )
# ---------------------------------
our @ARGS;
our %opts;

my($VERSION);
$VERSION = "2018-11-03 10:51" ; # written by emacs time-stamp
## --------------------------------------------
##          M A I N  R O U T I N E 
## --------------------------------------------
my ($gds2File);
my ($X) = 0;  # constant (MACRO)
my ($Y) = 1;  # ditto

my $filename = $0;
   $filename =~ s/\.txt$//;                     # ---  Strip '.txt' part
   $filename .= '.gds';

print 'output name: '. $filename, "\n";

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

my $x		=   0;
my $y		=   0;
my $start	=   0;		# in degree
my $end		= 360;		# in degree
my $radius	=   9.5 / 2;	# in micron
my $polygon	=  24;
my $not_used	= '' ;
my $direction	=  1;		# CCW(1), CW(0) 今回はどちらでも同じ

my @COORDS_PAIR =
    arc::arc( $x, $y, $start, $end, $radius, $polygon, $not_used, $direction);

my $frame = 21/2;
$gds2File -> printBgnstr( -name=> 'simple-circle');
$gds2File -> printBoundary (
    -xy =>
    [
     @COORDS_PAIR,
      $frame, 0,
      $frame, -$frame,
     -$frame, -$frame,
     -$frame,  $frame,
      $frame,  $frame,
      $frame, 0,
    ]);

  text2gds::text_flat(-1.0, - $radius * 0.8, 20, 0.02, $VERSION,   $gds2File);
 $gds2File -> printEndstr;    

 $gds2File -> printEndlib(); 

__END__
(ここから下は、 Perl は読みません)
(require '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