Forgot password?
 Create new account
View 216|Reply 1

SVG不支持PostScript operator "strokepath"

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-4-12 05:53:29 |Read mode
Last edited by hbghlyj at 2023-7-30 13:10:00
  1. size(100);
  2. axialshade((0,0)..controls(1,1)..(2,0),stroke=true,red,(0,0),green,(2,0));
Copy the Code

如果输出格式为 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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2023-4-12 06:27:24
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. ]
Copy the Code

EZ42z[1].png

手机版Mobile version|Leisure Math Forum

2025-4-20 12:32 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list