Skip to content

Commit

Permalink
fix for recursive cleaning
Browse files Browse the repository at this point in the history
- make sure projected fixed points are passed to preserve fixed points in the smoothing operation
- avoid repeating cleaning in an infinite loop by not calling when the triangulation is unchanged
  • Loading branch information
WPringle committed Jun 20, 2022
1 parent 5d590ca commit 658cd30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions @msh/msh.m
Original file line number Diff line number Diff line change
Expand Up @@ -1197,18 +1197,22 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
qual = [mq_m,mq_l3sig,mq_l];
LTn = size(obj.t,1);

if mq_l < opt.mqa && (opt.ds || LT ~= LTn)
if mq_l < opt.mqa && LT ~= LTn
% Need to clean it again
disp('Poor or overlapping elements, cleaning again')
disp(['(Min Qual = ' num2str(mq_l) ')'])
% repeat without projecting (already projected)
ii = find(strcmp(varargino,'proj'));
ii = find(strcmp(varargino,'proj'), 1);
if ~isempty(ii)
varargino{ii+1} = 0;
else
varargino{end+1} = 'proj';
varargino{end+1} = 0;
end
ii = find(strcmp(varargino,'pfix'), 1);
if ~isempty(ii)
varargino{ii+1} = pfixV;
end
obj = clean(obj,varargino(:));
elseif opt.nscreen
disp(['number of nodes is ' num2str(length(obj.p))])
Expand Down

0 comments on commit 658cd30

Please sign in to comment.