Skip to content
On this page

倒圆角

typescript
// 准备颜色
const redColor = new Mx3dGeColor(MdGe.MxNameOfColor.Color_NOC_RED);
// 生成形状
const csysr = new Mx3dGeCSYSR();
csysr.SetLocation(850, 0, 0);
const box = new Mx3dMkBox(csysr, 20, 20, 20);
const boxShape = box.Shape();
const fillet = new Mx3dAlgoFillet(boxShape, MdGe.MxCF3dFilletShapeEnum.Enum_Rational);
boxShape.Explore(MdGe.MxShapeEnum.Enum_EDGE).forEach((shape) => {
  const edge = Mx3dShapeDownCast.Edge(shape);
  fillet.Add(3, edge);
});
const filletShape = fillet.Shape();
// 形状颜色添加至文档
addShapeToDoc(filletShape, redColor);
// 更新显示(会更新canvas中显示的模型)
mxcad3d.update();

倒斜角

typescript
// 准备颜色
const brownColor = new Mx3dGeColor(MdGe.MxNameOfColor.Color_NOC_BROWN);
// 生成形状
const csysr = new Mx3dGeCSYSR();
csysr.SetLocation(900, 0, 0);
const box = new Mx3dMkBox(csysr, 20, 20, 20);
const boxShape = box.Shape();
const chamfer = new Mx3dAlgoChamfer(boxShape);
boxShape.Explore(MdGe.MxShapeEnum.Enum_EDGE).forEach((shape) => {
  const edge = Mx3dShapeDownCast.Edge(shape);
  chamfer.Add(3, edge);
});
const chamferShape = chamfer.Shape();
// 形状颜色添加至文档
addShapeToDoc(chamferShape, brownColor);
// 更新显示(会更新canvas中显示的模型)
mxcad3d.update();