我是 metapost 的新手,我不确定如何重新定义带颜色命令恢复为 metapost 默认值。
我正在尝试绘制一个圆柱体的横截面,其中内圆是空的,但外部有直线标记。
你能帮帮我吗?我的时间很紧!
这是迄今为止的代码:
input hatching;
u := 1cm;
path circle;
circle = fullcircle scaled 10u;
outputtemplate:="%j%c.mps";
beginfig(1);
hatchfill circle withcolor (45, 5mm, -.5bp);
draw circle;
draw fullcircle scaled 5u; % This needs to be filled with color white
endfig;
end
它看起来是这样的:
答案1
先将内圆保存为路径,取消填充,然后绘制它。
input hatching;
u := 1cm;
path circle;
circle = fullcircle scaled 10u;
outputtemplate:="%j%c.mps";
beginfig(1);
hatchfill circle withcolor (45, 5mm, -.5bp);
draw circle;
path inner_circle;
inner_circle := fullcircle scaled 5u; % This needs to be filled with color white
unfill inner_circle;
draw inner_circle;
endfig;
end