applied matter constraints to superposed concernements clones

This commit is contained in:
2023-09-11 15:12:22 +02:00
parent c4dd253b98
commit 8377a4b2b1
4 changed files with 96 additions and 70 deletions

View File

@@ -33,18 +33,23 @@ export default {
// loop through all superposition grouped by concernements couples
for(let [couple_id, superpositions] of Object.entries(this.allSuperpositions_byid)){
// if one concernement couple has more than one superposition
if (superpositions.length > 1) {
let superpositions_ids = Object.keys(superpositions);
if (superpositions_ids.length > 1) {
// loop through these superpositions for one concernement couple starting with the second
for (let i = 1; i < superpositions.length; i++) {
let superposition_id = `${superpositions[i][0].cid}-${superpositions[i][0].eid}--${superpositions[i][1].cid}-${superpositions[i][1].eid}`
let i = 0;
for(let [superposition_id, superposition] of Object.entries(superpositions)){
i++
if (i === 1) {
continue;
}
// first concernement of the couple
clones.push({
concernement: this.concernementsByID[superpositions[i][0].cid],
concernement: this.concernementsByID[superposition[0].cid],
superposition_id: superposition_id
})
// second concernement of the couple
clones.push({
concernement: this.concernementsByID[superpositions[i][1].cid],
concernement: this.concernementsByID[superposition[1].cid],
superposition_id: superposition_id
})
}