Skip to content

Commit

Permalink
qmeshcut returns node id
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Dec 31, 2020
1 parent 12e7e8e commit 58de92c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions qmeshcut.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function [cutpos,cutvalue,facedata,elemid]=qmeshcut(elem,node,value,cutat,varargin)
function [cutpos,cutvalue,facedata,elemid,nodeid]=qmeshcut(elem,node,value,cutat,varargin)
%
% [cutpos,cutvalue,facedata,elemid]=qmeshcut(elem,node,value,cutat)
% [cutpos,cutvalue,facedata,elemid,nodeid]=qmeshcut(elem,node,value,cutat)
%
% fast tetrahedral mesh slicer
%
Expand Down Expand Up @@ -37,6 +37,10 @@
% same as "value".
% facedata: define the intersection polygons in the form of patch "Faces"
% elemid: the index of the elem in which each intersection polygon locates
% nodeid: 3 column array, first two columns are the node indices that
% each intersection position is interpolated between, and the
% last column is a weight (0-1) for the first node (that for
% the 2nd node is 1-weight).
%
% without any output, qmeshcut generates a cross-section plot
%
Expand Down Expand Up @@ -83,7 +87,8 @@
if(numel(cutat)==9)
[a,b,c,d]=getplanefrom3pt(cutat);
else
[a,b,c,d]=deal(cutat(:));
coeff=num2cell(cutat(:));
[a,b,c,d]=deal(coeff{:});
end

% compute which side of the cutat for all nodes in the mesh
Expand Down Expand Up @@ -137,6 +142,9 @@

% calculate the cross-cut position and the interpolated values

nodeid=edges(cutedges,:);
nodeid(:,3)=cutweight(:,2);

cutpos=node(edges(cutedges,1),:).*repmat(cutweight(:,2),[1 3])+...
node(edges(cutedges,2),:).*repmat(cutweight(:,1),[1 3]);
if(size(value,1)==size(node,1))
Expand Down
2 changes: 1 addition & 1 deletion tools/cork
Submodule cork updated 2 files
+0 −6 Makefile
+0 −6 src/util/prelude.h
2 changes: 1 addition & 1 deletion tools/meshfix
2 changes: 1 addition & 1 deletion tools/tetgen
Submodule tetgen updated 5 files
+1 −1 README
+84 −84 example.poly
+4 −0 predicates.cxx
+2,088 −3,364 tetgen.cxx
+78 −182 tetgen.h

0 comments on commit 58de92c

Please sign in to comment.