跳到主内容
Ciallo
Back to games & experiments

SVG 形状练习场

基础图元、变换、描边动画的交互Experiment。

rect / circle / pathtransform

Try the experience, then read the guide. Pausing keeps your state; resetting clears the current session and parameters.

Try a different scene

Loading a preset restarts the experiment and applies its parameters. You can fine-tune them afterwards.

Preparing the experience…

UNDERSTAND EVERY MOVE

SVG 形状练习场 · Detailed guide

用同1套变换观察矩形、圆、多边形、星形和曲线路径。这里的重点是图形由哪些参数构成,以及平移、旋转、描边如何改变外观。图形的基本数据与屏幕里的变换位置要分开理解。

Getting started

  1. 01先选择多边形,从3边逐渐增加到十2边。
  2. 02保持尺寸,改变描边宽度,再切换圆与星形。
  3. 03Pause旋转,观察变换文字和描边进度,最后导出1张SVG快照。

Controls & parameters

  • 边数影响多边形和星形结构,尺寸以画布像素表示。
  • 描边宽度改变轮廓粗细,圆角rx主要影响矩形。
  • 旋转Speed单位°/s;描边动画逐步显示路径,不会改变图形的填充区域。

基础图元各司其职

rect用位置、宽高和rx描述矩形,circle用圆心与半径描述圆,ellipse用两个半轴描述椭圆。polygon连接顶点并闭合;path通过M、Q、T等命令描述更1般的线与曲线。并不是所有参数对所有形状都有意义。

变换与描边

图元先在自身坐标中定义,再通过平移放到画布、绕局部原点旋转。路径长度归1化后,可用dasharray和dashoffset控制已显露比例。旋转对圆的轮廓几乎没有影响,却会明显改变非圆形的方向。

Strategies & observations
  • 先把旋转Speed设为0,再Comparison形状参数。
  • 同样半径的多边形不代表面积相同;边数增加时更接近圆。
  • 导出的SVG保留当前帧,可以放大检查轮廓和文字。
Common misconceptions
  • 边数参数对圆不起作用,这是图元定义的差别。
  • 背景参考网格用于观察,不代表所有Experiment已采用相同物理单位。

Put your understanding into practice

completed0 / 3

Follow the steps, compare the expected results, and mark the challenge complete yourself. This records your practice without judging your results.

CHALLENGE 01

多边形到近似圆

  1. 保持尺寸不变,把边数由3逐步增至12。
  2. 观察边与角的变化。

Expected result: 能说明顶点增加为何让轮廓更接近圆。

CHALLENGE 02

变换的分工

  1. 选矩形,先改圆角再改旋转Speed。
  2. Comparison哪些变化影响形状、哪些影响朝向。

Expected result: 能够区分圆角、尺寸与旋转的作用。

CHALLENGE 03

保存1张图

  1. 选星形并调整到喜欢的参数。
  2. 冻结后导出当前SVG。

Expected result: 下载的图可独立打开,轮廓与当前帧1致。

Explore similar experiences

Contact Ender

Say hello, discuss a commission, or send a little kindness. Here's where to find me.

© 2026 Ender · Cat Garden