same topology production analyzer

This commit is contained in:
Val Erastov 2022-07-19 18:57:18 -05:00
parent 8cd6de13a6
commit dbceeaea99

View file

@ -7,8 +7,9 @@ import {Classification, Classifier, OCCClassifier} from "cad/craft/production/cl
import {addToListInMap} from "gems/iterables";
import {MEdge} from "cad/model/medge";
import {Edge} from "brep/topo/edge";
import {MBrepShell} from "cad/model/mshell";
import {MBrepShell, MShell} from "cad/model/mshell";
import {TopoObject} from "brep/topo/topo-object";
import {Matrix3x4} from "math/matrix";
const classifier: Classifier = new OCCClassifier();
@ -111,6 +112,27 @@ abstract class BasicProductionAnalyzer implements ProductionAnalyzer {
}
export class SameTopologyProductionAnalyzer extends BasicProductionAnalyzer {
originShell: Shell;
suffix: string;
constructor(originShape: MBrepShell, suffix: string) {
super();
this.originShell = originShape.brepShell;
this.suffix = suffix;
}
assignIdentificationImpl(createdShell: Shell) {
this.originShell.faces.forEach((originFace, index) => {
const createdFace = createdShell.faces[index];
createdFace.data.id = originFace.data.id + ":" + this.suffix;
createdFace.data.productionInfo = originFace.data.productionInfo;
})
}
}
type IdentificationInfo = {
id: string,
productionInfo: any;