how to convert SVG shapes to polygon


how to convert SVG shapes to polygon

如何將 svg 的 rect 轉換成 polygon

  1. rect、circle、ellipse、line、polyline、polygon 六種基本形狀可轉換 path路徑
  2. path to polygon

SVG shapes

https://www.w3.org/TR/SVG/shapes.html


XMLSerializer & serializeToString()

https://www.ruanyifeng.com/blog/2018/08/svg.html



const svgString = new XMLSerializer().serializeToString(document.querySelector('svg'));




SVG 壓縮優化,發現SVG預定義的 rect、circle、ellipse、line、polyline、polygon 六種基本形狀可通過path路徑轉換實現,這樣可以在一定程度上減少代碼量。

https://aotu.io/notes/2017/01/16/base-shapes-to-path/index.html

https://github.com/convertSvg/convertPath



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM