/// <summary> /// 设置拖拉预览 /// </summary> /// <param name="ld"></param> private void SetDimFeatuer(LinearDimension ld, int row, ref double[] offset) { double temp = UMathUtils.GetDis(ld.HandleOrigin, superBox.CenterPt); //判断拖拉是否超过边界 if (Math.Abs(ld.Value) >= 2 * temp && ld.Value < 0) { return; } if (boolOffset.Value) { SetDimSame(ld.Value, ref offset); dimOffset.Value = ld.Value; negativeX.Value = ld.Value; negativeY.Value = ld.Value; negativeZ.Value = ld.Value; positiveX.Value = ld.Value; positiveX.Value = ld.Value; positiveZ.Value = ld.Value; } else { offset[row] = ld.Value; } superBox.Update(matr, offset); }
/// <summary> /// 通过面数据获得最大外形点(相对Matr) /// </summary> /// <param name="centerPt"></param> /// <param name="disPt"></param> private void GetCenterAndDisForData(out Point3d centerPt, out Point3d disPt) { centerPt = new Point3d(); disPt = new Point3d(); Point3d min = this.Data.BoxMinCorner; Point3d max = this.Data.BoxMaxCorner; this.Matr.ApplyPos(ref min); this.Matr.ApplyPos(ref max); centerPt = UMathUtils.GetMiddle(min, max); disPt.X = this.Data.Radius; disPt.Y = this.Data.Radius; disPt.Z = UMathUtils.GetDis(min, max) / 2; }