1 个不稳定版本

0.0.0 2022年3月31日

#4#tikz

MPL-2.0 许可证

3KB

Tikz 对照表

线段

\draw (1,3)--(2,2)--(4,5);
\draw[rounded corners] (1,3)--(2,2)--(4,5);
\draw (1,3)--(2,2)--(4,5)--cycle;
polyline(
    [(1, 3), (2, 2), (4, 5)],
    rounded : true,
    circle : true,
);

矩形, 正方形

\draw[rounded corners] (0,0) rectangle (4,2);
rectangle(
    (0, 0), (2, 2),
    rounded: 0.1,
    circle: true,
);

椭圆,园,圆弧

\draw (1, 1) circle (1);
\draw (1, 1) ellipse (2 and 1);
\draw (1 ,1) arc (0:270:1);
\draw (1 ,1) arc (0:270:2 and 1);
circle((1, 1), 1);
ellipse((1, 1), 2, 1);
circle((1, 1), 1, range: (0deg, 270deg));
ellipse((1, 1), 2, 1, range: (0deg, 270deg));

曲线

\draw (5,1) parabola bend (6,0) (7.414 ,2);
parabola(
    (5, 1),
    (6, 0),
    (7.414, 2),
);

网格

\draw [step=20pt] (0,0) grid (3,2);
\draw [help lines ,step=20pt] (4,0) grid (7,2);
\begin{tikzpicture}
\filldraw [gray] (0,0) circle [radius=2pt]
(1,1) circle [radius=2pt]
(2,1) circle [radius=2pt]
(2,0) circle [radius=2pt];
\draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
\end{tikzpicture}

Circle::from_3_points() Circle::from_2_points() Circle::from_point_radius()

new Circle( (0, 0), 2, fill: true, fillColor: .gray, stroke: true, strokeColor: .black, strokeWidth: 1, controls: [(1, 1), (2, 1), (2, 0)], );

依赖项

~1.5MB
~32K SLoC