cubic01.svg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" standalone="no"?>
  2. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  3. "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  4. <svg width="5cm" height="4cm" viewBox="0 0 500 400"
  5. xmlns="http://www.w3.org/2000/svg" version="1.1">
  6. <title>Example cubic01- cubic Bézier commands in path data</title>
  7. <desc>Picture showing a simple example of path data
  8. using both a "C" and an "S" command,
  9. along with annotations showing the control points
  10. and end points</desc>
  11. <style type="text/css"><![CDATA[
  12. .Border { fill:none; stroke:blue; stroke-width:1 }
  13. .Connect { fill:none; stroke:#888888; stroke-width:2 }
  14. .SamplePath { fill:none; stroke:red; stroke-width:5 }
  15. .EndPoint { fill:none; stroke:#888888; stroke-width:2 }
  16. .CtlPoint { fill:#888888; stroke:none }
  17. .AutoCtlPoint { fill:none; stroke:blue; stroke-width:4 }
  18. .Label { font-size:22; font-family:Verdana }
  19. ]]></style>
  20. <rect class="Border" x="1" y="1" width="498" height="398" />
  21. <polyline class="Connect" points="100,200 100,100" />
  22. <polyline class="Connect" points="250,100 250,200" />
  23. <polyline class="Connect" points="250,200 250,300" />
  24. <polyline class="Connect" points="400,300 400,200" />
  25. <path class="SamplePath" d="M100,200 C100,100 250,100 250,200
  26. S400,300 400,200" />
  27. <circle class="EndPoint" cx="100" cy="200" r="10" />
  28. <circle class="EndPoint" cx="250" cy="200" r="10" />
  29. <circle class="EndPoint" cx="400" cy="200" r="10" />
  30. <circle class="CtlPoint" cx="100" cy="100" r="10" />
  31. <circle class="CtlPoint" cx="250" cy="100" r="10" />
  32. <circle class="CtlPoint" cx="400" cy="300" r="10" />
  33. <circle class="AutoCtlPoint" cx="250" cy="300" r="9" />
  34. <text class="Label" x="25" y="70">M100,200 C100,100 250,100 250,200</text>
  35. <text class="Label" x="325" y="350"
  36. style="text-anchor:middle">S400,300 400,200</text>
  37. </svg>