Skip to content
On this page

Fillet

typescript
// Define color
const redColor = new Mx3dGeColor(MdGe.MxNameOfColor.Color_NOC_RED);
// Generate shape
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();
// Add shape with color to the document
addShapeToDoc(filletShape, redColor);
// Update display (updates the model displayed on the canvas)
mxcad3d.update();

Chamfer

typescript
// Define color
const brownColor = new Mx3dGeColor(MdGe.MxNameOfColor.Color_NOC_BROWN);
// Generate shape
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();
// Add shape with color to the document
addShapeToDoc(chamferShape, brownColor);
// Update display (updates the model displayed on the canvas)
mxcad3d.update();