|
@@ -25,6 +25,7 @@ function buildAssemblyImpl(structure: Structure, name: string) {
|
|
|
|
|
|
const assembler = Structure.Builder();
|
|
|
|
|
|
+ let unitId = 0;
|
|
|
for (const g of assembly.operatorGroups) {
|
|
|
const selection = g.selector(structure);
|
|
|
if (Selection.structureCount(selection) === 0) continue;
|
|
@@ -35,7 +36,7 @@ function buildAssemblyImpl(structure: Structure, name: string) {
|
|
|
for (const oper of g.operators) {
|
|
|
for (let uI = 0, _uI = unitIds.length; uI < _uI; uI++) {
|
|
|
const unit = units.get(unitIds[uI]);
|
|
|
- assembler.add(Unit.create(unit.model, oper), AtomSet.unitGetByIndex(atoms, uI));
|
|
|
+ assembler.add(Unit.create(unitId++, unit.model, oper), AtomSet.unitGetByIndex(atoms, uI));
|
|
|
}
|
|
|
}
|
|
|
}
|