Skip to content

Commit

Permalink
Added documentation for patchEdges
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin-Mattheus-Moerman committed Jul 10, 2023
1 parent f122e8f commit fbe3705
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 10 deletions.
28 changes: 26 additions & 2 deletions docs/HELP_patchEdges.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,36 @@
clear; close all; clc;

%% Syntax
% |varargout=patchEdges(varargin);|
% | [E] = patchEdges(F,uniOpt);|

%% Description
% UNDOCUMENTED
% Get the nx2 patch array for the input faces (F) and vertices (V). If
% uniOpt=1 then only unique edges are returned e.g. the edges spanning from
% node 1 to node 2 is the same as from node 2 to node 1. If uniOpt=0 then
% such non-unique edges are also inluded.

%% Examples
%

%%
% Example geometry
[F,V]=geoSphere(1,1);

uniOpt=0;
E=patchEdges(F,uniOpt);

cFigure;
subplot(1,2,1);
title('Patch geometry')
gpatch(F,V,'rw','r');
axisGeom; camlight headlight;

subplot(1,2,2);
title('Edges')
gedge(E,V,'r',2);
axisGeom;

drawnow;
%%
%
% <<gibbVerySmall.gif>>
Expand Down
56 changes: 49 additions & 7 deletions docs/html/HELP_patchEdges.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>patchEdges</title><meta name="generator" content="MATLAB 9.6"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2019-06-20"><meta name="DC.source" content="HELP_patchEdges.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
--><title>patchEdges</title><meta name="generator" content="MATLAB 9.14"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2023-07-10"><meta name="DC.source" content="HELP_patchEdges.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}

html { min-height:100%; margin-bottom:1px; }
html body { height:100%; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000; line-height:140%; background:#fff none; overflow-y:scroll; }
Expand All @@ -23,7 +23,7 @@

p { padding:0px; margin:0px 0px 20px; }
img { padding:0px; margin:0px 0px 20px; border:none; }
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; }
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; }

ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }
ul li { padding:0px; margin:0px 0px 7px 0px; }
Expand Down Expand Up @@ -52,6 +52,7 @@
span.string { color:#A020F0 }
span.untermstring { color:#B20000 }
span.syscmd { color:#B28C00 }
span.typesection { color:#A0522D }

.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
.footer p { margin:0px; }
Expand All @@ -67,7 +68,24 @@


</style></head><body><div class="content"><h1>patchEdges</h1><!--introduction--><p>Below is a demonstration of the features of the <tt>patchEdges</tt> function</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#3">Description</a></li><li><a href="#4">Examples</a></li></ul></div><pre class="codeinput">clear; close <span class="string">all</span>; clc;
</pre><h2 id="2">Syntax</h2><p><tt>varargout=patchEdges(varargin);</tt></p><h2 id="3">Description</h2><p>UNDOCUMENTED</p><h2 id="4">Examples</h2><p><img vspace="5" hspace="5" src="gibbVerySmall.gif" alt=""> </p><p><i><b>GIBBON</b></i> <a href="www.gibboncode.org">www.gibboncode.org</a></p><p><i>Kevin Mattheus Moerman</i>, <a href="gibbon.toolbox@gmail.com">gibbon.toolbox@gmail.com</a></p><p><i><b>GIBBON footer text</b></i></p><p>License: <a href="https://github.com/gibbonCode/GIBBON/blob/master/LICENSE">https://github.com/gibbonCode/GIBBON/blob/master/LICENSE</a></p><p>GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.</p><p>Copyright (C) 2019 Kevin Mattheus Moerman</p><p>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 (at your option) any later version.</p><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2019a</a><br></p></div><!--
</pre><h2 id="2">Syntax</h2><p>| [E] = patchEdges(F,uniOpt);|</p><h2 id="3">Description</h2><p>Get the nx2 patch array for the input faces (F) and vertices (V). If uniOpt=1 then only unique edges are returned e.g. the edges spanning from node 1 to node 2 is the same as from node 2 to node 1. If uniOpt=0 then such non-unique edges are also inluded.</p><h2 id="4">Examples</h2><p>Example geometry</p><pre class="codeinput">[F,V]=geoSphere(1,1);

uniOpt=0;
E=patchEdges(F,uniOpt);

cFigure;
subplot(1,2,1);
title(<span class="string">'Patch geometry'</span>)
gpatch(F,V,<span class="string">'rw'</span>,<span class="string">'r'</span>);
axisGeom; camlight <span class="string">headlight</span>;

subplot(1,2,2);
title(<span class="string">'Edges'</span>)
gedge(E,V,<span class="string">'r'</span>,2);
axisGeom;

drawnow;
</pre><img width="100%" height="auto" vspace="5" hspace="5" src="HELP_patchEdges_01.jpg" alt=""> <p><img vspace="5" hspace="5" src="gibbVerySmall.gif" alt=""> </p><p><i><b>GIBBON</b></i> <a href="www.gibboncode.org">www.gibboncode.org</a></p><p><i>Kevin Mattheus Moerman</i>, <a href="gibbon.toolbox@gmail.com">gibbon.toolbox@gmail.com</a></p><p><i><b>GIBBON footer text</b></i></p><p>License: <a href="https://github.com/gibbonCode/GIBBON/blob/master/LICENSE">https://github.com/gibbonCode/GIBBON/blob/master/LICENSE</a></p><p>GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.</p><p>Copyright (C) 2006-2023 Kevin Mattheus Moerman and the GIBBON contributors</p><p>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 (at your option) any later version.</p><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2023a</a><br></p></div><!--
##### SOURCE BEGIN #####
%% patchEdges
% Below is a demonstration of the features of the |patchEdges| function
Expand All @@ -76,12 +94,36 @@
clear; close all; clc;
%% Syntax
% |varargout=patchEdges(varargin);|
% | [E] = patchEdges(F,uniOpt);|
%% Description
% UNDOCUMENTED
% Get the nx2 patch array for the input faces (F) and vertices (V). If
% uniOpt=1 then only unique edges are returned e.g. the edges spanning from
% node 1 to node 2 is the same as from node 2 to node 1. If uniOpt=0 then
% such non-unique edges are also inluded.
%% Examples
%
%%
% Example geometry
[F,V]=geoSphere(1,1);
uniOpt=0;
E=patchEdges(F,uniOpt);
cFigure;
subplot(1,2,1);
title('Patch geometry')
gpatch(F,V,'rw','r');
axisGeom; camlight headlight;
subplot(1,2,2);
title('Edges')
gedge(E,V,'r',2);
axisGeom;
drawnow;
%%
%
% <<gibbVerySmall.gif>>
Expand All @@ -99,7 +141,7 @@
% image segmentation, image-based modeling, meshing, and finite element
% analysis.
%
% Copyright (C) 2019 Kevin Mattheus Moerman
% Copyright (C) 2006-2023 Kevin Mattheus Moerman and the GIBBON contributors
%
% 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
Expand Down
Binary file added docs/html/HELP_patchEdges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/html/HELP_patchEdges_01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/patchEdges.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
E=[E1(:) E2(:)];
end

%% Remove doulble entire if requested
%% Remove double entries if requested

if uniOpt==1
[Es,indSort]=sort(E,2); %Sorted so [1 4] and [4 1] are seen as the same edge
Expand Down

0 comments on commit fbe3705

Please sign in to comment.