Skip to content

Commit c8bfd7a

Browse files
committed
[ci] fix failed ci demo, speed up vol2surf significantly
1 parent 68292e6 commit c8bfd7a

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

binsurface.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
% populate all the triangles
7474
xy = newdim(1) * newdim(2);
7575

76-
if (nargin == 1 || nface == 3) % create triangular elements
76+
if (nargin == 1 || abs(nface) == 3) % create triangular elements
7777
elem = [id1 id1 + newdim(1) id1 + newdim(1) + xy; id1 id1 + newdim(1) + xy id1 + xy];
7878
elem = [elem; id2 id2 + 1 id2 + 1 + xy; id2 id2 + 1 + xy id2 + xy];
7979
elem = [elem; id3 id3 + 1 id3 + 1 + newdim(1); id3 id3 + 1 + newdim(1) id3 + newdim(1)];

test/run_iso2mesh_test.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function run_iso2mesh_test(tests)
101101

102102
[no, el, fc] = v2m(im, 0.5, 0.03, 10);
103103
test_iso2mesh('v2m face', @savejson, round_to_digits(sum(elemvolume(no, fc(:, 1:3))), 2), '[5.01]');
104-
test_iso2mesh('v2m elem', @savejson, round_to_digits(sum(elemvolume(no, el(:, 1:4))), 4), '[0.8786]');
104+
test_iso2mesh('v2m elem', @savejson, round_to_digits(sum(elemvolume(no, el(:, 1:4))), 4), '[0.8787]');
105105
end
106106

107107
%%

vol2surf.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,7 @@
8989
else
9090
levelmask = int8(newimg >= isovalues(i));
9191
end
92-
[isoct, octver] = isoctavemesh;
93-
if (~isoct || sscanf(octver, '%d') > 5)
94-
[levelno, levelel] = binsurface(levelmask, 'iso');
95-
else
96-
[levelno, levelel] = binsurface(levelmask);
97-
end
92+
[levelno, levelel] = binsurface(levelmask, -3);
9893
if (~isempty(levelel))
9994
if (isstruct(opt) && isfield(opt, 'autoregion'))
10095
if (opt.autoregion)
@@ -146,7 +141,7 @@
146141
f0 = removeisolatedsurf(v0, f0, 3);
147142

148143
if (dofix)
149-
[v0, f0] = meshcheckrepair(v0, f0);
144+
[v0, f0] = meshcheckrepair(v0, f0, 'meshfix');
150145
end
151146

152147
elseif (nargin < 7 || strcmp(method, 'cgalsurf') || strcmp(method, 'cgalpoly'))

0 commit comments

Comments
 (0)