Metapost 路径完整

Metapost 路径完整

MetaPost 路径是否全圆循环?

我尝试在“METAPOST——用户手册”中寻找答案,但没有找到。

更新:

显示循环全圆;

将打印答案true

答案1

诸如这样的路径

(0,0)..(1,0)..(1,1)..(0,1)..(0,0)

是开放的。您可以通过以下方式检查

*path p;

*p:=(0,0)..(1,0)..(1,1)..(0,1)..(0,0);

*show point 3 of p;
>> (0,1)
*show point 3.5 of p;
>> (-0.20709,0.49998)
*show point 4 of p;
>> (0,0)
*show point 4.1 of p;
>> (0,0)
*show point 10 of p;
>> (0,0)
*show point 12 of p;
>> (0,0)

另一方面,我们可以看到

*p:=(0,0)..(1,0)..(1,1)..(0,1)..cycle;

*show point 3 of p;
>> (0,1)
*show point 3.5 of p;
>> (-0.20709,0.49998)
*show point 4 of p;
>> (0,0)
*show point 4.1 of p;
>> (0.08765,-0.07457)
*show point 10 of p;
>> (1,1)
*show point 12 of p;
>> (0,0)

继续:

*p:=(0,0)..(1,0)..(1,1)..(0,1)..(0,0);

*show cycle p;
>> false
*p:=(0,0)..(1,0)..(1,1)..(0,1)..cycle;

*show cycle p;
>> true

您可以获得的定义fullcircle

*show fullcircle;
>> Path at line 0:
(0.5,0)..controls (0.5,0.13261) and (0.44731,0.25978)
 ..(0.35355,0.35355)..controls (0.25978,0.44731) and (0.13261,0.5)
 ..(0,0.5)..controls (-0.13261,0.5) and (-0.25978,0.44731)
 ..(-0.35355,0.35355)..controls (-0.44731,0.25978) and (-0.5,0.13261)
 ..(-0.5,0)..controls (-0.5,-0.13261) and (-0.44731,-0.25978)
 ..(-0.35355,-0.35355)..controls (-0.25978,-0.44731) and (-0.13261,-0.5)
 ..(0,-0.5)..controls (0.13261,-0.5) and (0.25978,-0.44731)
 ..(0.35355,-0.35355)..controls (0.44731,-0.25978) and (0.5,-0.13261)
 ..cycle

这是一个循环。

实际上,您无法在 中找到定义plain.mp,因为fullcircle由 定义fullcircle = makepath pencircle;,但是当路径构建完成后,它就可以显示出来。

相关内容