-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add extrudesurf function to expand an open surface into a solid
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function [node,face]=extrudesurf(no,fc,vec) | ||
% | ||
% [node,face]=extrudesurf(no,fc,vec) | ||
% | ||
% create a enclosed surface mesh by extruding an open surface | ||
% | ||
% author: Qianqian Fang, <q.fang at neu.edu> | ||
% | ||
% input: | ||
% | ||
% output: | ||
% node: 3D node coordinates for the generated surface mesh | ||
% face: triangular face patches of the generated surface mesh, each | ||
% row represents a triangle denoted by the indices of the 3 nodes | ||
% | ||
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) | ||
% | ||
|
||
nlen=size(no,1); | ||
if(length(vec)>1) | ||
node=[no; no+repmat(vec(:)', nlen,1)]; | ||
else | ||
node=[no; no+vec*nodesurfnorm(no, fc)]; | ||
end | ||
|
||
face=[fc; fc+nlen]; | ||
|
||
edge=surfedge(fc); | ||
sideface=[edge edge(:,1)+nlen; edge+nlen edge(:,2)]; | ||
face=[face; sideface]; | ||
|
||
|