修复左侧版切割右侧板造成的错误(未拷贝计算导致源实体被修改),修正造型转换厚度.

pull/295/MERGE
ChenX 5 years ago
parent c6f01897ab
commit 5aa42f632c

@ -45,7 +45,7 @@ export class NonAssociativeCutting implements Command
{ {
for (let br of cutBoards) for (let br of cutBoards)
{ {
let gs = orgBoard.ConverToLocalGroove(br); let gs = orgBoard.ConverToLocalGroove(br.Clone());
for (let g of gs) for (let g of gs)
orgBoard.AppendGroove(g); orgBoard.AppendGroove(g);
} }

@ -674,7 +674,7 @@ export class ExtureSolid extends Entity
if (isParallelTo(this.Normal, target.Normal)) if (isParallelTo(this.Normal, target.Normal))
{ {
if (this.GrooveCheckPosition(target) !== Status.True) if (this.GrooveCheckPosition(target) !== Status.True)
return; return [];
return this.GrooveCheckContour(target); return this.GrooveCheckContour(target);
} }
@ -725,19 +725,17 @@ export class ExtureSolid extends Entity
let maxZ = tp.z + target.thickness; let maxZ = tp.z + target.thickness;
if (minZ <= 1e-2)//背面 if (minZ <= 1e-2)//背面
{ {
target.Thickness = maxZ; target.Thickness = Math.min(maxZ, this.thickness);
if (minZ < -1e-4) if (minZ < -1e-4)
target.ApplyMatrix( target.ApplyMatrix(
MoveMatrix(this.Normal.multiplyScalar(-minZ)) MoveMatrix(this.Normal.multiplyScalar(-minZ))
); );
} }
else if (maxZ >= (this.thickness - 1e-3) && minZ > 0)//正面 else if (maxZ >= (this.thickness - 1e-3) && minZ > 0)//正面
{
target.Thickness = this.thickness - minZ; target.Thickness = this.thickness - minZ;
}
else return Status.False; else return Status.False;
return Status.True; return target.Thickness > 0 ? Status.True : Status.False;
} }
/** /**

Loading…
Cancel
Save