Forgot password?
 Register account
View 1711|Reply 15

[无聊]画个蛋蛋

[Copy link]

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2018-6-8 21:25 |Read mode
  1. \begin{tikzpicture}
  2.   \def\eggheight{3cm}
  3.   \path[preaction={fill=orange!50!white},
  4.   ball color=orange!60!gray,fill opacity=.5]
  5.   plot[domain=-pi:pi,samples=100]
  6.   ({.78*\eggheight *cos(\x/4 r)*sin(\x r)},{-\eggheight*(cos(\x r))})
  7.   -- cycle;
  8. \end{tikzpicture}
Copy the Code
选自:tex.stackexchange.com/questions/74168/how-can … aw-an-egg-using-tikz

768

Threads

4685

Posts

310K

Credits

Credits
35004

Show all posts

isee Posted 2018-6-8 21:45
好蛋

768

Threads

4685

Posts

310K

Credits

Credits
35004

Show all posts

isee Posted 2018-6-8 23:03
Last edited by hbghlyj 2025-4-14 00:42你们直观感受下

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2018-6-8 23:28
Last edited by hbghlyj 2025-4-14 00:42回复 3# isee

我贴过来的代码是这个

感觉这个颜色好点

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

hbghlyj Posted 2025-4-22 13:26

4

Threads

139

Posts

2198

Credits

Credits
2198

Show all posts

Aluminiumor Posted 2025-4-22 23:35
Last edited by Aluminiumor 2025-4-22 23:40

Comment

想画个荷包蛋,为什么蛋黄是黑色的,求指点  Posted 2025-4-22 23:42
在真 latex 里蛋黄没问题,不知为何这里是黑的  Posted 2025-4-23 00:16
Wir müssen wissen, wir werden wissen.

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2025-4-23 00:15
参照 3# 4# 似乎要加一行 \dvisvgm(我不懂这是啥意思,问 @hbghlyj

Comment

查了下,这个是将 Tikz 生成的 DVI 文件转换为 SVG 图片的命令。但还是不知道与我画的蛋黄变黑有什么关系。  Posted 2025-4-23 00:34

4

Threads

139

Posts

2198

Credits

Credits
2198

Show all posts

Aluminiumor Posted 2025-4-23 00:32

Comment

加了 \dvisvgm 命令后就正常了  Posted 2025-4-23 00:34
Wir müssen wissen, wir werden wissen.

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

hbghlyj Posted 2025-4-23 01:33
See the PGF/TikZ docs for more details. The input to latex needs to specify the PGF dvisvgm driver by passing the dvisvgm option to the document class
  1. \documentclass[dvisvgm]{minimal}
  2. \usepackage{tikz}
  3. \begin{document}
  4. Hello \tikz [baseline] \fill [fill=blue!80!black] (0,.75ex) circle[radius=.75ex];
  5. \end{document}
Copy the Code
And then run
  1. latex example
  2. dvisvgm example
Copy the Code
See also mgieseki/dvisvgm#225 & parpalak/upmath.me#37.

13

Threads

901

Posts

110K

Credits

Credits
12272

Show all posts

色k Posted 2025-4-23 02:04
hbghlyj 发表于 2025-4-23 01:33
See the PGF/TikZ docs for more details. The input to latex needs to specify the PGF dvisvgm driver b ...
是不是凡是涉及渐变色彩的就要加这个

Comment

可以自动添加吗  Posted 2025-4-23 10:45
我看不需要吧,渐变色很少用,记住这个就行了  Posted 2025-4-23 12:25
这名字我喜欢

Mobile version|Discuz Math Forum

2025-6-5 01:13 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit