Skip to content

Commit

Permalink
Merge pull request #158 from oqilipo/master
Browse files Browse the repository at this point in the history
Header update of matGeom root folder, utils, and polygons2d.
  • Loading branch information
dlegland committed Jul 13, 2023
2 parents a4be530 + 1882e97 commit 61e4fb0
Show file tree
Hide file tree
Showing 92 changed files with 152 additions and 149 deletions.
9 changes: 6 additions & 3 deletions checks/checkHeader.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
% Additional checks could be added.
%
% Todo
% - Standardize E-mail adress to "david.legland@inrae.fr"?
% - Add checks for "Example" section.
% - Add additional checks for the "See also" section: No
% self-reference, references, indentations of the references.
Expand All @@ -26,11 +25,12 @@
% Author: oqilipo
% E-mail: N/A
% Created: 2022-11-08, using MATLAB 9.13.0.2080170 (R2022b) Update 1
% Copyright 2022
% Copyright 2022-2023

cd(strrep(mfilename('fullpath'),mfilename,''))

mFiles = dir('../matGeom/**/*.m');
% mFiles = dir('../matGeom/**/*.m');
mFiles = dir('../matGeom/utils/*.m');
% Exclude the Contents.m files
mFiles(contains({mFiles.folder}','deprecated'))=[];

Expand Down Expand Up @@ -133,8 +133,11 @@
end
end
end

% Change e-mail to E-Mail
S(aSec1Idx+2) = regexprep(S(aSec1Idx+2), '% e-mail:', '% E-mail:');
% Standardize E-Mail of David Legland to david.legland@inrae.fr
S(aSec1Idx+2) = regexprep(S(aSec1Idx+2), 'david.legland@([a-zA-Z0-9._-])+\.([a-zA-Z]{2,4})', 'david.legland@inrae.fr');

% Move affiliation to the copyright line if necesarry
if contains(S(aSec1Idx+3),'INRA') && contains(S(aSec1Idx+4),'created','IgnoreCase',1)
Expand Down
4 changes: 2 additions & 2 deletions matGeom/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

% ------
% Author: David Legland
% E-mail: david.legland@inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2011-03-21, using Matlab 7.9.0.529 (R2009b)
% Copyright 2011-2022 INRA - Cepia Software Platform
% Copyright 2011-2023 INRA - Cepia Software Platform

help(mfilename);
2 changes: 1 addition & 1 deletion matGeom/polygons2d/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-11-07
% Copyright 2005-2022 INRAE
% Copyright 2005-2023 INRAE

help(mfilename);

Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/cart2geod.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2004-04-08
% Copyright 2004-2022 INRA - Cepia Software Platform
% Copyright 2004-2023 INRA - Cepia Software Platform

% parametrization approximation
t = parametrize(curve);
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/clipPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-05-14
% Copyright 2005-2022 INRA - Cepia Software Platform
% Copyright 2005-2023 INRA - Cepia Software Platform

% check case of polygons stored in cell array
if iscell(polygon)
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/clipPolygonHP.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
% Author: David Legland, oqilipo
% E-mail: david.legland@inrae.fr
% Created: 2005-07-31
% Copyright 2005-2022 INRA - Cepia Software Platform
% Copyright 2005-2023 INRA - Cepia Software Platform

% Parsing
p = inputParser;
Expand Down Expand Up @@ -187,4 +187,4 @@
end


end
end
2 changes: 1 addition & 1 deletion matGeom/polygons2d/clipPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-05-14
% Copyright 2005-2022 INRA - Cepia Software Platform
% Copyright 2005-2023 INRA - Cepia Software Platform

% check case of polylines stored in cell array
if iscell(poly)
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/contourMatrixToPolylines.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2013-08-22, using Matlab 7.9.0.529 (R2009b)
% Copyright 2013-2022 INRA - Cepia Software Platform
% Copyright 2013-2023 INRA - Cepia Software Platform

% size of the contour matrix array
nCoords = size(C, 2);
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/convexHull.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@nantes.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2011-04-08, using Matlab 7.9.0.529 (R2009b)
% Copyright 2011-2022 INRA - Cepia Software Platform
% Copyright 2011-2023 INRA - Cepia Software Platform

% checkup on array size
if size(points, 1) < 3
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/convexification.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-01-12
% Copyright 2005-2022 INRA - Cepia Software Platform
% Copyright 2005-2023 INRA - Cepia Software Platform

if ~isempty(varargin)>0
var = varargin{1};
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/curvature.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2003-04-07
% Copyright 2003-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2003-2023 INRA - TPV URPOI - BIA IMASTE

% default values
degree = 5;
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/curveCMoment.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-03-25, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% compute curve centroid
centroid = polylineCentroid(curve);
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/curveCSMoment.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-03-25, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% compute curve centroid
centroid = polylineCentroid(curve);
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/curveMoment.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-03-25, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% coordinate of vertices
px = curve(:,1);
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/densifyPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2011-11-25, using Matlab 7.9.0.529 (R2009b)
% Copyright 2011-2022 INRA - Cepia Software Platform
% Copyright 2011-2023 INRA - Cepia Software Platform

% number of vertices, and of edges
Nv = size(poly, 1);
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/distancePointPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@nantes.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-04-30, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% eventually copy first point at the end to ensure closed polygon
if sum(poly(end, :) == poly(1,:)) ~= 2
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/distancePointPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

% ------
% Author: David Legland, Juan Pablo Carbajal
% E-mail: david.legland@nantes.inra.fr, ajuanpi+dev@gmail.com
% E-mail: david.legland@inrae.fr, ajuanpi+dev@gmail.com
% Created: 2009-04-30, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% check if input polyline is closed or not
closed = false;
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/distancePolygons.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@nantes.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-17, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% cjeck if the two polygons intersect
pts = intersectPolylines(poly1([1:end 1], :), poly2([1:end 1], :));
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/distancePolygonsNoCross.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@nantes.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-17, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% compute distance of each vertex of a polygon to the other polygon
dist1 = min(distancePointPolygon(poly1, poly2));
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/distancePolylines.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-17, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% compute distance of each vertex of a polyline to the other polyline
dist1 = min(distancePointPolyline(poly1, poly2));
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/drawPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2004-05-05
% Copyright 2004-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2004-2023 INRA - TPV URPOI - BIA IMASTE

% Store hold state
state = ishold(gca);
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/drawPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2004-04-06
% Copyright 2004-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2004-2023 INRA - TPV URPOI - BIA IMASTE

% extract handle of axis to draw on
if isAxisHandle(varargin{1})
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/drawVertices.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2011-12-11, using Matlab 7.9.0.529 (R2009b)
% Copyright 2011-2022 INRA - Cepia Software Platform
% Copyright 2011-2023 INRA - Cepia Software Platform

% extract handle of axis to draw on
if isAxisHandle(varargin{1})
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/expandPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-05-14
% Copyright 2005-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2005-2023 INRA - TPV URPOI - BIA IMASTE

% default options
cleanupLoops = false;
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/fillPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-04-07
% Copyright 2005-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2005-2023 INRA - TPV URPOI - BIA IMASTE

% check input
if isempty(varargin)
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/findPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2003-07-17
% Copyright 2003-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2003-2023 INRA - TPV URPOI - BIA IMASTE

% number of points
np = size(coord, 1);
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/geod2cart.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2004-04-08
% Copyright 2004-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2004-2023 INRA - TPV URPOI - BIA IMASTE

t = parametrize(curve);
N = size(src, 1);
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/intersectEdgePolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2012-02-24, using Matlab 7.9.0.529 (R2009b)
% Copyright 2012-2022 INRA - Cepia Software Platform
% Copyright 2012-2023 INRA - Cepia Software Platform

% get computation tolerance
tol = 1e-14;
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/intersectLinePolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2003-10-31, using Matlab 7.9.0.529 (R2009b)
% Copyright 2003-2022 INRA - Cepia Software Platform
% Copyright 2003-2023 INRA - Cepia Software Platform

% line origin and angle
ox = line(1);
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/intersectLinePolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2003-10-31
% Copyright 2003-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2003-2023 INRA - TPV URPOI - BIA IMASTE

% get computation tolerance
tol = 1e-14;
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/intersectPolylines.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-15, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% The code is a slight rewritting of the interX function, consisting in
% avoiding argument transposition in the begining of the function. Comment
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/intersectRayPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2010-01-26
% Copyright 2010-2022
% Copyright 2010-2023

% compute intersections with supporting line
[intersects, edgeIndices, pos] = intersectLinePolygon(ray, poly, varargin{:});
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/isPointInPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-19, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% In case of a multiple polygon, decompose into a set of contours, and
% performs test for each contour
Expand Down
4 changes: 2 additions & 2 deletions matGeom/polygons2d/isPointOnPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

% ------
% Author: David Legland
% E-mail: david.legland@grignon.inra.fr
% E-mail: david.legland@inrae.fr
% Created: 2009-06-19, using Matlab 7.7.0.471 (R2008b)
% Copyright 2009-2022 INRA - Cepia Software Platform
% Copyright 2009-2023 INRA - Cepia Software Platform

% extract computation tolerance
tol = 1e-14;
Expand Down
2 changes: 1 addition & 1 deletion matGeom/polygons2d/medialAxisConvex.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2005-07-07
% Copyright 2005-2022 INRA - TPV URPOI - BIA IMASTE
% Copyright 2005-2023 INRA - TPV URPOI - BIA IMASTE

% TODO: is not fully implemented, need to finish it

Expand Down
Loading

0 comments on commit 61e4fb0

Please sign in to comment.