Forgot password
 Register account
View 376|Reply 1

SVG不支持PostScript operator "strokepath"

[Copy link]

3203

Threads

7841

Posts

48

Reputation

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

3203

Threads

7841

Posts

48

Reputation

Show all posts

original poster 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

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-4 10:06 GMT+8

Powered by Discuz!

Processed in 0.016351 seconds, 33 queries