From b5dc668147466c079ad5f7b1a29b6c2ca1a6a277 Mon Sep 17 00:00:00 2001 From: mmiscool Date: Sat, 13 May 2023 02:35:12 +0000 Subject: [PATCH] Stable ID generator for cloned objects and mirror opperations --- .../cad/craft/production/productionAnalyzer.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/web/app/cad/craft/production/productionAnalyzer.ts b/web/app/cad/craft/production/productionAnalyzer.ts index b759de4b..4c99bfdb 100644 --- a/web/app/cad/craft/production/productionAnalyzer.ts +++ b/web/app/cad/craft/production/productionAnalyzer.ts @@ -116,9 +116,12 @@ export class SameTopologyProductionAnalyzer extends BasicProductionAnalyzer { originShell: Shell; suffix: string; + originShape; constructor(originShape: MBrepShell, suffix: string) { + console.log(originShape); super(); + this.originShape = originShape; this.originShell = originShape.brepShell; this.suffix = suffix; } @@ -130,6 +133,19 @@ export class SameTopologyProductionAnalyzer extends BasicProductionAnalyzer { createdFace.data.id = originFace.data.id + ":" + this.suffix; createdFace.data.productionInfo = originFace.data.productionInfo; }) + + const listOfEdgesToCopy = [...this.originShell.edges]; + const createdShellEdges = [...createdShell.edges]; + + listOfEdgesToCopy.forEach((originEdge, index) => { + //console.log("originEdge", originEdge); + const createdEdge = createdShellEdges[index]; + //console.log(createdEdge); + createdEdge.data.id = originEdge.data.id + ":" + this.suffix; + createdEdge.data.productionInfo = originEdge.data.productionInfo; + }) + + } } @@ -360,7 +376,7 @@ export class FromMObjectProductionAnalyzer extends BasicProductionAnalyzer { constructor(consumed: MObject[], mustAdvance: MObject[] = []) { super(); this.consumed = consumed; - this.mustAdvance = new Set(mustAdvance&&mustAdvance.map(o => o.id)); + this.mustAdvance = new Set(mustAdvance && mustAdvance.map(o => o.id)); consumed.forEach(mShell => { if (mShell instanceof MBrepShell) { classifier.prepare(mShell.brepShell);