This example describes the different mesh functionalities as follows:
EditElementHandle eeh; PolyfaceHeaderPtr dgnPolyface = PolyfaceHeader::CreateFixedBlockCoordinates (4); dgnPolyface->Point ().CopyVectorFrom (m_Points); if (SUCCESS != MeshHeaderHandler::CreateMeshElement(eeh, NULL, *dgnPolyface, true, *ACTIVEMODEL)) return false;
EditElementHandle eeh; PolyfaceHeaderPtr dgnPolyface = PolyfaceHeader::CreateVariableSizeIndexed (); dgnPolyface->AddPolygon(m_Points); // Create Element if (SUCCESS != MeshHeaderHandler::CreateMeshElement(eeh, NULL, *dgnPolyface, true, *ACTIVEMODEL)) return false;
//Compute a boolean operation on two breps if (mdlPop_polyBrepFromPolyBrepBoolOp(pContext, pBrep0, pBrep1, m_boolMode, false, false, false, false)) { if (GetKeepOriginals() == MESH_BOOLEANMODE_KeepNone || false) mdlPop_elementDescrFromPolyBrep(outEdPP, &inEdP1->el, pBrep0, false, false); else mdlPop_elementDescrFromPolyBrep(outEdPP, NULL, pBrep0, false, false); pBrep1 = NULL; // brep1 is consumed#ifdef TIME_RECORD } else { pBrep0 = pBrep1 = NULL; // both breps are consumed }
Load the example mdl application using one of the following methods:
Prerequisite to create a mesh using Boolean operations:
Mesh Unite Operation:
Mesh Subtract Operation:
Mesh Intersect Operation:
If you want to create a vertex-colored mesh, please read below blog article.
创建各顶点颜色不同的网格元素(Creating Vertex-Colored Mesh)