From: <jpi...@us...> - 2011-11-04 18:41:10
|
Revision: 8980 http://octave.svn.sourceforge.net/octave/?rev=8980&view=rev Author: jpicarbajal Date: 2011-11-04 18:41:03 +0000 (Fri, 04 Nov 2011) Log Message: ----------- geometry. Improving docstrign of @svg/normalize Modified Paths: -------------- trunk/octave-forge/main/geometry/INDEX trunk/octave-forge/main/geometry/inst/io/@svg/normalize.m Modified: trunk/octave-forge/main/geometry/INDEX =================================================================== --- trunk/octave-forge/main/geometry/INDEX 2011-11-04 16:44:40 UTC (rev 8979) +++ trunk/octave-forge/main/geometry/INDEX 2011-11-04 18:41:03 UTC (rev 8980) @@ -116,13 +116,13 @@ cbezier2poly 2D Polygons drawPolygon - simplifypolygon.m + simplifypolygon 2D Piecewise polynomial shapes - polygon2shape.m - shape2polygon.m - shapecentroid.m - shapeplot.m - shapetransform.m + polygon2shape + shape2polygon + shapecentroid + shapeplot + shapetransform 2D Others bisector crackPattern2 Modified: trunk/octave-forge/main/geometry/inst/io/@svg/normalize.m =================================================================== --- trunk/octave-forge/main/geometry/inst/io/@svg/normalize.m 2011-11-04 16:44:40 UTC (rev 8979) +++ trunk/octave-forge/main/geometry/inst/io/@svg/normalize.m 2011-11-04 18:41:03 UTC (rev 8980) @@ -1,5 +1,5 @@ %% Copyright (c) 2011 Juan Pablo Carbajal <car...@if...> -%% +%% %% This program is free software: you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation, either version 3 of the License, or @@ -15,7 +15,7 @@ %% -*- texinfo -*- %% @deftypefn {Function File} @var{SVGn} = normalize (@var{SVG}) -%% TODO: normalizes and SVG. +%% normalizes and SVG. %% @end deftypefn function [SVGn bb] = normalize (obj) @@ -34,13 +34,13 @@ p = shape2polygon(obj.Path.(ids{ip}).data); bb = mergeBoxes(bb, [min(p) max(p)]([1 3 2 4])); end - + if npath > 1 v = mean(v)(:); else v = v.'; end - + %% check whether document and bounding box agree. bbHeight = bb(2)-bb(1); bbWidth = bb(4)-bb(2); @@ -66,7 +66,7 @@ for ip = 1:npath SVGn.Path.(ids{ip}).data = shapetransform(obj.Path.(ids{ip}).data,-v); - + % Put to middle SVGn.Path.(ids{ip}).data = ... shapetransform(SVGn.Path.(ids{ip}).data,[0; -bbHeight/2]); @@ -76,21 +76,20 @@ % Put to bottom SVGn.Path.(ids{ip}).data = ... shapetransform(SVGn.Path.(ids{ip}).data,[0; bbHeight/2]); - + % Scale SVGn.Path.(ids{ip}).data = ... shapetransform(SVGn.Path.(ids{ip}).data,S); - + p = shape2polygon(SVGn.Path.(ids{ip}).data); bb = mergeBoxes(bb, [min(p) max(p)]([1 3 2 4])); end bbHeight = bb(2)-bb(1); bbWidth = bb(4)-bb(2); - + SVGn.Data.height = bbHeight; SVGn.Data.width = bbWidth; SVGn.Data.normalized = true; end end - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |