Skip to content
On this page

Creating a Wedge

We can create a wedge by instantiating an Mx3dMkWedge object.

You can construct an Mx3dMkWedge object by providing a right-handed coordinate system Mx3dGeCSYSR and the dimensions of the wedge.

typescript
// Get the document
const doc = mxcad3d.getDocument();
// The default constructed right-handed coordinate system is aligned with the world coordinate system
const csysr = new Mx3dGeCSYSR();
// Create a wedge with the specified dimensions
const wedgeMaker = new Mx3dMkWedge(csysr, 20, 10, 5, 5);
// Get the topological shape
const wedgeShape = wedgeMaker.Shape();
// Create a shape label in the document
const wedgeLabel = doc.addShapeLabel();
// Set the shape to the label
wedgeLabel.setShape(wedgeShape);
// Update the display (this will update the model displayed in the canvas)
mxcad3d.update();

Note

GitHub and network issues may cause slow loading times, so please be patient and allow a few minutes for the content to load.