// Character Encoding: UTF-8 // トーラスの作図 (位相数学のレジュメのため) // 2012年4月10日火曜日 size(80mm,50mm); real u = 1; // Dispensed in favor of implicit scaling using size() statement... real tt = 3; // tension real dx = 1u; // h-size of the cusp real dy = 0.7u; // v-size of the cusp pair z0 = (0u,5u); pair z1 = (9u,0u); pair z2 = (18u,5u); pair z3 = (9u,10u); pair z4 = (6u-dx,5u+dy); pair z5 = (6u,5u); pair z6 = (12u,5u); pair z7 = (12u+dx,5u+dy); pair z8 = (6u-dx,5u-dy); pair z9 = (12u+dx,5u-dy); path outer_envelope = z0{down}.. tension 1.1 ..z1{right}.. tension 1.1 ..z2{up}.. tension 1.1 ..z3{left}.. tension 1.1 ..cycle; path inner_envelope = z5{tt,-1}::{tt,1}z6{-tt,1}::{-tt,-1}cycle; path p1 = z4{1,-1}::z5{tt,-1}::z6{tt,1}::{1,1}z7; path p2 = z5{tt,1}::{tt,-1}z6; path p3 = z8{1,1}..{tt,1}z5; path p4 = z6{tt,-1}..{1,-1}z9; fill (outer_envelope, gray(0.8) ); fill (inner_envelope, white ); // ボツ: カスプ部分の着色 -- // path overlap_left = p3{-tt,1}::{-1,1}z4--cycle; // path overlap_right = p4{tt,1}--z7{-1,-1}::{-tt,-1}cycle; // fill (overlap_left, gray(0.7) ); // fill (overlap_right, gray(0.7) ); draw (outer_envelope, linewidth(1pt) ); draw (p1, linewidth(1pt) ); draw (p2, linewidth(1pt) ); draw (p3, linewidth(0.3pt)+linetype("4 4") ); draw (p4, linewidth(0.3pt)+linetype("4 4") );