Download (as "circle.txt") circle
#!/usr/bin/perl -w
# 直径 9.5 um の円の代りに 24 角形を描く
# arc という subroutine を使って各頂点の座標をもらって多角形にする
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);
$gds2File -> printBgnstr( -name=> 'simple-circle');
$gds2File -> printBoundary (
-xy =>
[
@COORDS_PAIR
]);
text2gds::text_flat(-1.0, - $radius * 1.2, 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
|