Skip to content

Commit

Permalink
fix #21, also make surf2mesh to use tetgen in system path as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jul 21, 2018
1 parent 1176437 commit e67caf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions mcpath.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function binname=mcpath(fname)
function binname=mcpath(fname, ext)
%
% binname=mcpath(fname)
%
Expand Down Expand Up @@ -27,8 +27,16 @@
if(isempty(p))
% the bin folder under iso2mesh is searched first
tempname=[fileparts(which(mfilename)) filesep 'bin' filesep fname];
if(exist(tempname,'file'))
binname=tempname;
if(exist([fileparts(which(mfilename)) filesep 'bin'])==7)
if(nargin>=2)
if(exist([tempname ext],'file'))
binname=[tempname ext];
else
binname=fname; % use binary without suffix on system PATH
end
else
binname=tempname;
end
else
binname=fname;
end
Expand Down
4 changes: 2 additions & 2 deletions surf2mesh.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@
end
end
if(isempty(cmdopt))
system([' "' mcpath(method) exesuff '" -A -q1.414a' num2str(maxvol) ' ' moreopt ' "' mwpath('post_vmesh.poly') '"']);
system([' "' mcpath(method,exesuff) '" -A -q1.414a' num2str(maxvol) ' ' moreopt ' "' mwpath('post_vmesh.poly') '"']);
else
system([' "' mcpath(method) exesuff '" ' cmdopt ' "' mwpath('post_vmesh.poly') '"']);
system([' "' mcpath(method,exesuff) '" ' cmdopt ' "' mwpath('post_vmesh.poly') '"']);
end

% read in the generated mesh
Expand Down

0 comments on commit e67caf7

Please sign in to comment.