diff --git a/src/facade/topologyNaming.ts b/src/facade/topologyNaming.ts index e7a8b11..cde6b1a 100644 --- a/src/facade/topologyNaming.ts +++ b/src/facade/topologyNaming.ts @@ -160,5 +160,6 @@ export const matchSubshapes = (previous: Array<{ ref: SubshapeRef; signature: Su matches.push({ current: { ...candidate.ref, status: 'ambiguous', candidates: [best.entry.ref.persistentId, second.entry.ref.persistentId] }, score: best.score, status: 'ambiguous' }) } else matches.push({ current: { ...candidate.ref, status: 'new' }, score: best?.score ?? 0, status: 'new' }) } + for (const entry of previous) if (!used.has(entry.ref.persistentId)) matches.push({ current: { ...entry.ref, status: 'deleted' }, previousId: entry.ref.persistentId, score: 0, status: 'deleted' }) return matches } diff --git a/tests/facade.test.ts b/tests/facade.test.ts index 3ad3b6d..a88a502 100644 --- a/tests/facade.test.ts +++ b/tests/facade.test.ts @@ -151,6 +151,8 @@ test('topology signatures are independent of transient face indexes and flag amb const matches = matchSubshapes([{ ref: first.refs[0], signature: first.signatures[0] }], [{ ref: duplicate.refs[0], signature: duplicate.signatures[0] }]) assert.equal(matches[0].status, 'stable') assert.equal(matches[0].previousId, first.refs[0].persistentId) + const deleted = matchSubshapes([{ ref: first.refs[0], signature: first.signatures[0] }, { ref: duplicate.refs[1], signature: duplicate.signatures[1] }], [{ ref: duplicate.refs[0], signature: duplicate.signatures[0] }]) + assert.equal(deleted.at(-1)?.status, 'deleted') }) test('edge and vertex topology signatures are orientation/index independent', () => {