Changeset 24766


Ignore:
Timestamp:
04/30/20 12:39:47 (5 years ago)
Author:
Eric.Larour
Message:

CHG: fixing major bug in the logical flow + better output logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/meshintersect3d.m

    r24155 r24766  
    2828                                        hold on;plot3(x(s(j)),y(s(j)),z(s(j)),'c.','MarkerSize',40)
    2929                                end
    30                                 disp(['Vertex ' num2str(i) ' of input mesh coincides with vertices ' num2str(s) ' of output mesh']);
     30                                disp(['Vertex ' num2str(i) ' of input mesh coincides with the following output mesh vertices ']);
     31                                s
    3132                                if force,
    3233                                        indices(i)=s(1);
     
    3738                                indices(i)=s;
    3839                        end
    39                 end
     40                else
    4041
    41                 %we could not find a 0 distance, find the lowest tolerance that generates a find:
    42                 count=1;
    43                 while isempty(s),
    44                         if count>1000,
    45                                 disp(['could not find a vertex matching vertex ' num2str(i) ' of input mesh!']);
    46                                 disp('Might think about changing tolerance increment');
     42                        %we could not find a 0 distance, find the lowest tolerance that generates a find:
     43                        count=1;
     44                        while isempty(s),
     45                                if count>1000,
     46                                        disp(['could not find a vertex matching vertex ' num2str(i) ' of input mesh!']);
     47                                        disp('Might think about changing tolerance increment');
     48                                        error('');
     49                                end
     50                                tolerance=tolerance+tolincrement;
     51                                s=find(distance<tolerance);
     52                                count=count+1;
     53                        end
     54                        if tolerance>maxtol,
     55                                disp(['found matching vertices ' num2str(s) ' in output mesh for input mesh vertex ' num2str(i) ]);
     56                                disp(' however, these vertices are farther that the max tolerance allowed!');
    4757                                error('');
    4858                        end
    49                         tolerance=tolerance+tolincrement;
    50                         s=find(distance<tolerance);
    51                         count=count+1;
     59
     60                        %recover minimum distance:
     61                        sf=distance(s);
     62                        pos=find(sf==min(sf));
     63                        s=s(pos);
     64                        indices(i)=s;
    5265                end
    53                 if tolerance>maxtol,
    54                         disp(['found matching vertices ' num2str(s) ' in output mesh for input mesh vertex ' num2str(i) ]);
    55                         disp(' however, these vertices are farther that the max tolerance allowed!');
    56                         error('');
    57                 end
    58 
    59                 %recover minimum distance:
    60                 sf=distance(s);
    61                 pos=find(sf==min(sf));
    62                 s=s(pos);
    63                 indices(i)=s;
    6466        end
    6567
Note: See TracChangeset for help on using the changeset viewer.