Forgot password?
 Register account
View 397|Reply 1

SVG不支持PostScript operator "strokepath"

[Copy link]

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-4-12 05:53 |Read mode
Last edited by 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));
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

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 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. ]
Copy the Code
EZ42z[1].png

Mobile version|Discuz Math Forum

2025-6-4 17:37 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit