
\documentclass[border=10pt,pstricks,12pt]{standalone}
\begin{document}
\begin{pspicture}[showgrid](0,0)(3,3)
\pscircle*[linecolor=gray!20](1.5,1.5){1.5}
\pscircle[fillstyle=crosshatch*](1,2){1}
\pscircle[hatchcolor=gray,hatchsep=5pt,hatchwidth=.5pt,fillstyle=dots*](2,1){1}
\end{pspicture}
\end{document}
TikZには というオプションがありcrosshatch dots
、AsymptoteにはTikZと同じ がありますhatch(1.5mm,dotted+...)
。つまり、dotted in line
見たところ、出力画像はあまり良くありません。では、dotted in line
PSTricks で vlines、hlines、crosshatch などを追加するにはどうすればいいのでしょうか?
私は Asymptote を使用してこの図を描いていますが、次のような間違いがあります。
// asy -f pdf <name>.asy
import math;
import patterns;
unitsize(1cm);
defaultpen(1);
pair C1=(-3,0),C2=(2.5,0);
real r=4;
path EllipseA=scale(.75,.55)*circle(C1,r);
path EllipseB=scale(.5,.35)*circle(C2,r);
add("fillA",hatch(1.5mm,red));
add("AinterB",crosshatch(2mm,green));
add("fillB",hatch(1.5mm,dotted+blue+1.5bp));//
fill(EllipseA,pattern("fillA"));
fill(EllipseB,pattern("fillB"));
picture AinterB;
fill(AinterB,EllipseA,white);
fill(AinterB,EllipseA,pattern("AinterB"));
clip(AinterB,EllipseB);
add(AinterB);
draw(EllipseA^^EllipseB);
label("$C$",C1,dir(180),UnFill);
label("$D$",C2,UnFill);
label("$E$",(0,0),UnFill);
pair A=point(EllipseA,1.25),B=point(EllipseB,.5);
label("$A$",A,6N);
label("$B$",shift(.2,0)*B,6N);
label("$G$",(0,2),9N); // dot((0,1));
draw(A--shift(0,.6)*A);
draw(B--shift(.2,.7)*B);
draw(shift(-2.5,.75)*(0,1)--shift(-.5,2)*(0,1));
draw(shift(.2,0)*(0,1)--shift(0,2)*(0,1));
draw(shift(1.5,0)*(0,1)--shift(.5,2)*(0,1));
add(shift(-6,-3)*grid(10,7,1bp+dotted));
shipout(bbox(5mm,white));
add("fillB",hatch(1.5mm,dotted+blue+1.5bp));//
1.5mm を 1.2mm に置き換えると、同じ出力が得られます。1.5mm を 1.75mm または 2mm に置き換えると、実際の出力は次のようになります。
では、なぜ違うのでしょうか?それは漸近線または...
答え1
Asymptoteの奇妙な動作について
Asymptote にバグがあるようです。これは、hatch
とのパラメータ間の特定の条件下での周期性の問題だと思いますdotted
。動作は、点線をクリップし、次にタイリングとクリッピングによってパターンを追加することです。しかし、なぜこのような問題が単純なパターンでは発生しないのかはわかりません。回避策を次に示します。を追加して、 penline
のような新しいペンを定義するだけで十分です 。dotted
offset
pen mdotted=linetype(new real[] {0,4},offset=.5);
import math;
import patterns;
unitsize(1cm);
defaultpen(1);
pair C1=(-3,0),C2=(2.5,0);
real r=4;
path EllipseA=scale(.75,.55)*circle(C1,r);
path EllipseB=scale(.5,.35)*circle(C2,r);
add("fillA",hatch(1.5mm,red));
add("AinterB",crosshatch(2mm,green));
pen mdotted=linetype(new real[] {0,4},offset=.5);
add("fillB",hatch(1.5mm,mdotted+blue+1.5bp));//
fill(EllipseA,pattern("fillA"));
fill(EllipseB,pattern("fillB"));
picture AinterB;
fill(AinterB,EllipseA,white);
fill(AinterB,EllipseA,pattern("AinterB"));
clip(AinterB,EllipseB);
add(AinterB);
draw(EllipseA^^EllipseB);
label("$C$",C1,dir(180),UnFill);
label("$D$",C2,UnFill);
label("$E$",(0,0),UnFill);
pair A=point(EllipseA,1.25),B=point(EllipseB,.5);
label("$A$",A,6N);
label("$B$",shift(.2,0)*B,6N);
label("$G$",(0,2),9N); // dot((0,1));
draw(A--shift(0,.6)*A);
draw(B--shift(.2,.7)*B);
draw(shift(-2.5,.75)*(0,1)--shift(-.5,2)*(0,1));
draw(shift(.2,0)*(0,1)--shift(0,2)*(0,1));
draw(shift(1.5,0)*(0,1)--shift(.5,2)*(0,1));
add(shift(-6,-3)*grid(10,7,1bp+dotted));
shipout(bbox(5mm,white));
そしてその結果
問題を追加しますhttps://github.com/vectorgraphics/asymptote/issues/133
答え2
PostScript の塗りつぶしパターンで点線のペンを使用するには、Asymptote のペン幅の自動スケーリングと線の長さの調整を無効にする必要があります。
import patterns;
unitsize(1cm);
pen dotted=linetype(new real[] {0,4},offset=1,scale=false,adjust=false);
add("fillA",hatch(1.5mm,red+1.5bp+opacity(0.5)));
add("fillB",hatch(1.5mm,blue+1.5bp+dotted));
fill(unitcircle,pattern("fillA"));
fill(unitcircle,pattern("fillB"));