# filletCurve

Below is a demonstration of the features of the filletCurve function

## Syntax

[VN]=filletCurve(Vt,r,np,closedLoopOption);

## Description

This function fillets a curve based on the input radius r using np points per fillet arc. If closedLoopOpt==1 then closed end conditions are used such that the end and start regions are also filleted.

## Examples

```clear; close all; clc;
```

Plot settings

```fontSize=15;
markerSize1=45;
lineWidth1=2;
lineWidth2=5;
lineWidth3=2;
faceAlpha=0.5;
```

## Example: Filleting a curve in 3D

Simulating a curve with sharp features

```Vt=[0 0 0; 10 0 0; 5 10 0; 10 0 10; 0 10 10; ];
```
```%Setting control parameters
np=25; %Number of points used to construct each fillet edge
closedLoopOption=0; %Use 1 if curve represents a closed loop but containes unique points
[VN]=filletCurve(Vt,r,np,closedLoopOption);
```

Plotting results

```hf1=cFigure;
title('A filleted curve','FontSize',fontSize);
xlabel('X','FontSize',fontSize);ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize);
hold on;

plotV(Vt,'k.-.','lineWidth',lineWidth1,'MarkerSize',markerSize1);
plotV(VN,'r.-','lineWidth',lineWidth2);

axis equal; view(3); axis tight;  grid on;  set(gca,'FontSize',fontSize);
drawnow;
``` ## Example: Filleting a closed curve in 3D

```closedLoopOption=1;
[VN]=filletCurve(Vt,r,np,closedLoopOption);
```

Plotting results

```hf2=cFigure;
title('A filleted curve based on closed end conditions','FontSize',fontSize);
xlabel('X','FontSize',fontSize);ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize);
hold on;

plotV(Vt,'k.-.','lineWidth',lineWidth1,'MarkerSize',markerSize1);
plotV([Vt(1,:);Vt(end,:)],'g.-.','lineWidth',lineWidth1,'MarkerSize',markerSize1);
plotV(VN,'r.-','lineWidth',lineWidth2);

axis equal; view(3); axis tight;  grid on;  set(gca,'FontSize',fontSize);
drawnow;
``` ## Example: Extruding a filleted curve for CAD like model building

```%Sketching side profile
x=[0 0 5 15 15];
y=[0 4 9 10 0];
V=10*[x(:) y(:)];

%Fillet sketch
np=50; %Number of points used to construct each fillet edge
closedLoopOption=0; %Use 1 if curve represents a closed loop but containes unique points
[Vc]=filletCurve(V,r,np,closedLoopOption);
```

Plotting sketch

```hf1=cFigure;
title('The side profile sketch','FontSize',fontSize);
xlabel('X','FontSize',fontSize);ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize);
hold on;

plotV(V,'k.-.','lineWidth',lineWidth1,'MarkerSize',markerSize1);
plotV(Vc,'r-','lineWidth',lineWidth2,'MarkerSize',markerSize1);

axis equal; view(2); axis tight;  grid on;  set(gca,'FontSize',fontSize);
drawnow;
``` Extruding model

```cPar.pointSpacing=10;
cPar.depth=85;
cPar.patchType='tri';
cPar.dir=0;
cPar.n=[0 0 1];
cPar.closeLoopOpt=0;

[F_tri,V_tri]=polyExtrude(Vc,cPar);
```

Plotting meshed model

```hf2=cFigure;
title('The extruded model mesh','FontSize',fontSize);
xlabel('X','FontSize',fontSize);ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize);
hold on;

hp=patch('faces',F_tri,'Vertices',V_tri);

set(hp,'FaceColor','g','EdgeColor','k','FaceAlpha',1);
axis equal; view(3); axis tight;  grid on;  set(gca,'FontSize',fontSize);
drawnow;
``` GIBBON www.gibboncode.org

Kevin Mattheus Moerman, [email protected]

GIBBON footer text

GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.

Copyright (C) 2019 Kevin Mattheus Moerman

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.

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.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5076022,"math_prob":0.8300842,"size":4082,"snap":"2020-45-2020-50","text_gpt3_token_len":1150,"char_repetition_ratio":0.18244237,"word_repetition_ratio":0.15130024,"special_character_ratio":0.26408625,"punctuation_ratio":0.27803203,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9614849,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,4,null,4,null,4,null,4,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-04T01:25:15Z\",\"WARC-Record-ID\":\"<urn:uuid:c047710f-1cc2-469a-addd-4d2931d3db98>\",\"Content-Length\":\"18480\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b84cb443-ad60-4848-a190-362b3b5b955b>\",\"WARC-Concurrent-To\":\"<urn:uuid:4260037b-bec5-47e8-b198-b3dabbd160bc>\",\"WARC-IP-Address\":\"172.67.131.4\",\"WARC-Target-URI\":\"https://www.gibboncode.org/html/HELP_filletCurve.html\",\"WARC-Payload-Digest\":\"sha1:DIMTLK6XCTUHXPGWGIXVDW7KWQEE2FAN\",\"WARC-Block-Digest\":\"sha1:3XT2U2ZY3LQ7EAFJW2LWITSQRUA2NFPG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141733120.84_warc_CC-MAIN-20201204010410-20201204040410-00170.warc.gz\"}"}