XML technologies / SVG / Using complex graphic elements and formatting / Summary, questions and exercises

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

Summary

  • Paths consist of individual path commands.

  • Each path command begins with a letter, followed by coordinates and other parameters as required by its syntax.

  • The command M sets the starting point.

  • The commands L, H and V draw lines.

  • The A command and the Bézier curve commands C, Q, T and S draw curves.

  • Paths can be closed with the z command.

  • Lowercase commands take relative values; uppercase commands take absolute values.

  • Use the style attribute to format paths.

Questions and exercises

The following exercises form a single unit.

  1. Create an SVG file and insert a triangle defined by a path.

  2. Add an arc forming a semicircle.

  3. Close the semicircle with a straight line.

  4. Fill the semicircle red and set transparency to 50%.

  5. Group the triangle and semicircle.

  6. Rotate the semicircle by 15° within the group and the entire group by 30°.

   

 

 

 

back to top