找回密码
 快速注册
搜索
查看: 61|回复: 1

SVG不支持PostScript operator "strokepath"

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-4-12 05:53 |阅读模式
本帖最后由 hbghlyj 于 2023-7-30 13:10 编辑
  1. size(100);
  2. axialshade((0,0)..controls(1,1)..(2,0),stroke=true,red,(0,0),green,(2,0));
复制代码

如果输出格式为 svg,Asymptote 将输出警告SVG does not support strokepath,不支持笔画渐变,因此在输出中,整个区域被渐变填充。 Screenshot 2023-04-11 at 23-15-28 Asymptote Vector Graphics.png
如果输出格式为pdf,则笔画的渐变是正确的。 Screenshot 2023-04-11 at 23-16-17 workspace.pdf.png

Related: SVG渐变部分显示不正常
笔划转为可填充的轮廓: How to get the outline of a stroke? 其中也提到了PostScript operator strokepath

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-4-12 06:27
Mathematica Graphics: Color Blend in BezierCurve

A simple line strip should be sufficient for most purposes and there you can use VertexColors as usual:
  1. pts = {{0, 0}, {1, 1}, {2, 0}};
  2. Graphics[{Thick,
  3.   Line[BezierFunction[pts] /@ #,
  4.     VertexColors -> (Blend[{Red, Green}, #] & /@ #)] &[Range[0, 1, .01]],
  5.   Line[{{0, 0}, {2, 0}}, VertexColors -> {Red, Green}]}
  6. ]
复制代码

EZ42z[1].png

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 12:02

Powered by Discuz!

× 快速回复 返回顶部 返回列表