Geometry package: Difference between revisions

58 bytes removed ,  2 April 2012
m
Line 20: Line 20:


<!-- <syntaxhighlight lang="matlab"> -->
<!-- <syntaxhighlight lang="matlab"> -->
{{Code|Loading the file as polygon compatible with geometry package|subst:{{SyntaxHighlight|
{{Code|Loading the file as polygon compatible with geometry package|
octavesvg = svg ("octave.svg").normalize();
<nowiki><syntaxhighlight line="GESHI_FANCY_LINE_NUMBERS" lang="matlab" style="font-size:13px"></nowiki>
ids      = octavesvg.pathid();
{{{1}}}
P        = octavesvg.path2polygon (ids{1}, 12)(1:end-1,:);
<nowiki></syntaxhighlight></nowiki>
P        = bsxfun (@minus, P, centroid (P));
 
}}
 
 
}}
}}
Now we have our SVG as a polygon compatible with the Geometry package format. You can plot the polygon using the function {{Codeline|drawPolygon}}.  
Now we have our SVG as a polygon compatible with the Geometry package format. You can plot the polygon using the function {{Codeline|drawPolygon}}.  
657

edits