subEdge

Below is a demonstration of the features of the subEdge function

Contents

Syntax

[Fs,Vs]=subEdge(F,V,n,uniqueOpt);

Description

The subEdge function enables refinement of the edges of patch

Examples

clear; close all; clc;

Plot Settings

fontSize=15;
faceAlpha=1;
edgeColor=0.2*ones(1,3);
edgeWidth=1.5;
markerSize=35;
markerSize2=20;

Refining the edges of a triangle

V=[0 0 0; 1 0 0; 0.5 sqrt(3)/2 0];
F=[1 2 3];

n=0:1:3; %Number of added edge nodes
pColors=gjet(numel(n));
cFigure;
for q=1:1:numel(n)
    [Fs,Vs]=subEdge(F,V,n(q));
    subplot(2,2,q); hold on;
    title([num2str(n(q)),' added edge nodes'],'FontSize',fontSize);
    gpatch(Fs,Vs,pColors(q,:),edgeColor,faceAlpha);
    plotV(Vs,'k.','markerSize',markerSize2);
    plotV(V,'k.','markerSize',markerSize);
    set(gca,'FontSize',fontSize);
    view(2); axis tight;  axis equal;  axis off;
end

Refining the edges of 3D patch data

[F,V]=quadSphere(2,1);

n=0:1:3; %Number of added edge nodes
pColors=gjet(numel(n));
cFigure;
for q=1:1:numel(n)
    [Fs,Vs]=subEdge(F,V,n(q));
    subplot(2,2,q); hold on;
    title([num2str(n(q)),' added edge nodes'],'FontSize',fontSize);
    gpatch(Fs,Vs,pColors(q,:),edgeColor,faceAlpha);
    plotV(Vs,'k.','markerSize',markerSize2);
    plotV(V,'k.','markerSize',markerSize);
    set(gca,'FontSize',fontSize);
    view(3); axis tight;  axis equal;  axis off;
    camlight headlight;
end

GIBBON www.gibboncode.org

Kevin Mattheus Moerman, [email protected]