From: <jpi...@us...> - 2011-11-02 01:22:46
|
Revision: 8919 http://octave.svn.sourceforge.net/octave/?rev=8919&view=rev Author: jpicarbajal Date: 2011-11-02 01:22:39 +0000 (Wed, 02 Nov 2011) Log Message: ----------- geometry. cleaning up Modified Paths: -------------- trunk/octave-forge/main/geometry/DESCRIPTION trunk/octave-forge/main/geometry/INDEX trunk/octave-forge/main/geometry/inst/io/@svg/loadpaths.m trunk/octave-forge/main/geometry/inst/io/@svg/subsref.m trunk/octave-forge/main/geometry/inst/io/@svg/svg.m trunk/octave-forge/main/geometry/inst/io/data2geo.m trunk/octave-forge/main/geometry/inst/io/drawing6.svg trunk/octave-forge/main/geometry/inst/shapearea.m Removed Paths: ------------- trunk/octave-forge/main/geometry/devel/@svg/ Modified: trunk/octave-forge/main/geometry/DESCRIPTION =================================================================== --- trunk/octave-forge/main/geometry/DESCRIPTION 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/DESCRIPTION 2011-11-02 01:22:39 UTC (rev 8919) @@ -1,6 +1,6 @@ Name: Geometry Version: 1.2.1 -Date: 2011-11-1 +Date: 2011-11-2 Author: David Legland <dav...@gr...>, Juan Pablo Carbajal <car...@if...> Maintainer: Juan Pablo Carbajal <car...@if...> Title: Computational Geometry Modified: trunk/octave-forge/main/geometry/INDEX =================================================================== --- trunk/octave-forge/main/geometry/INDEX 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/INDEX 2011-11-02 01:22:39 UTC (rev 8919) @@ -129,6 +129,9 @@ svgload svgnormalize svgpath2polygon - @svg + @svg/svg + @svg/plot + @svg/getpath + @svg/path2polygon Output data2geo Modified: trunk/octave-forge/main/geometry/inst/io/@svg/loadpaths.m =================================================================== --- trunk/octave-forge/main/geometry/inst/io/@svg/loadpaths.m 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/io/@svg/loadpaths.m 2011-11-02 01:22:39 UTC (rev 8919) @@ -34,7 +34,7 @@ npaths = numel (strpath); - %% Convert path data to polygons + %% Convert path data to polynoms for ip = 1:npaths eval (strpath{ip}); @@ -77,7 +77,7 @@ end if ~isempty(point_end) - %% Straight segmet to close the path + %% Straight segment to close the path points(2,:) = point_end; pp = [(points(2,:)-points(1,:))' points(1,:)']; @@ -89,6 +89,8 @@ end end + %% TODO + % pathdata = shapetransform(pathdata); Paths.(svgpathid).data = pathdata; end Modified: trunk/octave-forge/main/geometry/inst/io/@svg/subsref.m =================================================================== --- trunk/octave-forge/main/geometry/inst/io/@svg/subsref.m 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/io/@svg/subsref.m 2011-11-02 01:22:39 UTC (rev 8919) @@ -68,6 +68,15 @@ error (typeNotImplemented,[method idx(2).type], class (obj)); end + case 'normalize' + if numel (idx) == 1 % obj.path2polygon doesn't exists + error (method4field, class (obj), method, method); + elseif strcmp (idx(2).type, '()') + out = normalize (obj, idx(2).subs); + else + error (typeNotImplemented,[method idx(2).type], class (obj)); + end + otherwise error ("invalid index for reference of class %s", class (obj) ); endswitch Modified: trunk/octave-forge/main/geometry/inst/io/@svg/svg.m =================================================================== --- trunk/octave-forge/main/geometry/inst/io/@svg/svg.m 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/io/@svg/svg.m 2011-11-02 01:22:39 UTC (rev 8919) @@ -22,7 +22,6 @@ ## If no input argument is provided the object is empty. @var{str} can be a filename ## or a string defining an inline SVG. ## -## @seealso{@svn/parsePaths} ## @end deftypefn function svg = svg(name='') @@ -31,7 +30,7 @@ ## SVG data. All the attributes of the <svg> node. ## The field unparsed contains all the attributes that are not being parsed. - svg.Data = struct('height',[],'width',[],'id','null','unparsed',' '); + svg.Data = struct('height',[],'width',[],'id','null','normalized',false); ## SVG metadata. All the attributes of the <metadata> node. ## The field unparsed contains all the attributes that are not being parsed. @@ -48,6 +47,9 @@ if !isempty (name) paths = loadpaths(svg, name); svg.Path = paths; + data = loadsvgdata(svg, name); + svg.Data = data; + svg.Data.normalized = false; elseif !ischar(name) print_usage ; endif Modified: trunk/octave-forge/main/geometry/inst/io/data2geo.m =================================================================== --- trunk/octave-forge/main/geometry/inst/io/data2geo.m 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/io/data2geo.m 2011-11-02 01:22:39 UTC (rev 8919) @@ -24,7 +24,7 @@ %% to write. 'spehrical' following by a real number @var{r} indcating that the % polygon describes a spherical surface of radious @var{r}. %% -%% @seealso{polygon2d, @svg/path2polygon} +%% @seealso{polygon2d, @@svg/path2polygon} %% @end deftypefn function strFile = data2geo(data,lc,varargin) @@ -84,7 +84,7 @@ fclose(fid); disp(['DATA2GEO: Geometry file saved to ' outfile]) end -end +endfunction %!demo %! points = [0 0 0; 0.1 0 0; 0.1 .3 0; 0 0.3 0]; @@ -103,9 +103,8 @@ %! T = msh2m_gmsh(filename); %! pdemesh(T.p,T.e,T.t) %! -%! ---------------------------------------------------------------------------- -%! -%! We load the drawing6.svg file into Octave and transform it into a polygon. -%! Teh we create a temporary fiel where the .geo mesh will be written. -%! If the packages msh and fplare available, a mesh is created from the .geo file. - +%! % -------------------------------------------------------------------------- +%! % We load the drawing6.svg file into Octave and transform it into a polygon. +%! % Teh we create a temporary fiel where the .geo mesh will be written. +%! % If the packages msh and fplare available, a mesh is created from the .geo +%! % file. Modified: trunk/octave-forge/main/geometry/inst/io/drawing6.svg =================================================================== --- trunk/octave-forge/main/geometry/inst/io/drawing6.svg 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/io/drawing6.svg 2011-11-02 01:22:39 UTC (rev 8919) @@ -7,38 +7,12 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="124.01972" - height="153.4819" - id="svg2" version="1.1" - inkscape:version="0.48.2 r9819" - sodipodi:docname="drawing6.svg"> + width="119.45756" + height="143.3053" + id="svg2"> <defs id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.979899" - inkscape:cx="112.40798" - inkscape:cy="108.88861" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - fit-margin-top="0" - fit-margin-left="0" - fit-margin-right="0" - fit-margin-bottom="0" - inkscape:window-width="1440" - inkscape:window-height="817" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" /> <metadata id="metadata7"> <rdf:RDF> @@ -47,20 +21,16 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(-234.51469,-444.48191)"> + transform="translate(-239.12157,-454.58174)" + id="layer1"> <path - style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none" d="m 260.96378,516.60238 c 30.24071,-2.69283 -21.42438,-1.97992 -11.85009,-13.65203 l 21.42457,-26.11886 c 13.05645,-15.91722 30.86608,-35.97287 54.50085,-2.94599 23.63477,33.02688 45.79537,-26.11007 21.35844,51.55486 -24.43694,77.66493 -14.74615,-18.4048 -36.8249,43.45338 -22.07875,61.85819 -8.61317,-1.90227 -22.09494,13.25697 -13.48177,15.15924 0.70519,-11.24233 -25.04093,-25.77743 -25.74613,-14.53511 -31.71371,-37.07807 -1.473,-39.7709 z" id="path2985" - inkscape:connector-curvature="0" - sodipodi:nodetypes="zsszzzzzz" /> + style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none" /> </g> </svg> Modified: trunk/octave-forge/main/geometry/inst/shapearea.m =================================================================== --- trunk/octave-forge/main/geometry/inst/shapearea.m 2011-11-01 23:30:54 UTC (rev 8918) +++ trunk/octave-forge/main/geometry/inst/shapearea.m 2011-11-02 01:22:39 UTC (rev 8919) @@ -17,7 +17,7 @@ %% @deftypefn {Function File} { @var{a} =} shapearea (@var{pp}) %% Shape is defined with piecewise smooth polynomials. @var{pp} is a %% cell where each elements is a 2-by-(poly_degree+1) array containing -%% @code{px(i,:) = pp{i}(1,:) and py(i,:) = pp{i}(2,:)}. +%% @code{px(i,:) = pp@{i@}(1,:)} and @code{py(i,:) = pp@{i@}(2,:)}. %% %% @end deftypefn This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |