CPLwriteSVG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Import/Export
Introduced first in SolidGeometry 2.5.1, Creation date: 2015-09-13, Last change: 2025-09-14

writes a SVG file for a laser cutter

Description

This functions writes a CPL as SVG file for plotting or laser cutting. It is possible to sort the CPLS from inside to outside and give them different colors depending on the level of embedding.
The file also include wrt Christina Hein the "height", "width" and the "viewbox" commands of SVG.

See Also: svgpolylineofCPL , CPLsortinout , selectNaN , CPLwriteDXF

Example Illustration

 missing image of CPLwriteSVG (CPL,FNAME,ONAME,cutter,colmap,stkwd)

Syntax

CPLwriteSVG(CPL,[FNAME,ONAME,cutter,colmap,stkwd])

Input Parameter

CPL: Contour list
FNAME: Filename
ONAME: Creator Name; default is calling function name
cutter: if true; CPLs are sorted inside out in different colors; default is false
colmap: stroke color or colormap; default is {}
stkwd: stroke width

Examples

Try different parameters
CPLwriteSVG(CPLsample(10))
CPLwriteSVG(CPLsample(14))
CPLwriteSVG(CPLsample(14),'','Tim Lueth',false,'blue',1)
CPLwriteSVG(CPLsample(14),'','Tim Lueth',true,{'blue','red','green'},0.2)




Copyright 2015-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21