Last change
on this file since 22758 was 22758, checked in by Mathieu Morlighem, 7 years ago |
merged trunk-jpl and trunk for revision 22757
|
File size:
473 bytes
|
Rev | Line | |
---|
[22452] | 1 | function levelsetnew = reinitializelevelset(md,levelset)
|
---|
| 2 | %REINITIALIZELEVELSET - reinitialize levelset as a signed distance function
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
| 5 | % levelsetnew = reinitializelevelset(md,levelset)
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | %First: extract segments
|
---|
| 9 | contours=contourlevelzero(md,levelset,0);
|
---|
| 10 |
|
---|
| 11 | %Now, make this a distance field (might not be closed)
|
---|
| 12 | levelsetnew=abs(ExpToLevelSet(md.mesh.x,md.mesh.y,contours));
|
---|
| 13 |
|
---|
| 14 | %Finally, change sign
|
---|
| 15 | pos = find(levelset<0);
|
---|
| 16 | levelsetnew(pos) = -levelsetnew(pos);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.