Hi, I’m trying to process dae file for creating mesh faces,
I’ve used SUFaceCreateSimple() to successfully create multiple faces into SketchUp,
but the SUModelMergeCoplanarFaces() dosen’t work on it,
so I was trying to use SUGeoemtryInputRef for creating faces
but I can’t figure out how to use InputAddVertex(), InputSetVertices() and SULoopInputAddVertexIndex().
can anyone help me correct my code, or help me with an example how it works
SUGeometryInputRef input1 = SU_INVALID; SUGeometryInputCreate(&input1); SULoopInputRef faceLoop1 = SU_INVALID; SULoopInputCreate(&faceLoop1); std::vector<int> arrIndex1 = { 0,5,6, 5,0,1, 3,6,2, 6,3,0, 4,1,7, 1,4,5, 7,2,6, 2,7,1 }; SUPoint3D arrVertex1[] = { {-112.7238, -142.5420, 15.7480}, {- 34.9911, -180.4548, 15.7480}, {- 34.9911, -180.4548, 68.7336}, {- 112.7238, -142.5420, 68.7336}, {- 71.2711, -162.7598, 35.3998}, {- 73.9692, -161.4438, 35.3998}, {- 73.9692, -161.4438, 39.4024}, {- 71.2711, -162.7598, 39.4024}, }; SUGeometryInputAddVertex(input1, arrVertex1); SUGeometryInputSetVertices(input1, 8, arrVertex1); for each(int index in arrIndex1) { SULoopInputAddVertexIndex(faceLoop1, index); } size_t index1 = 0; SUGeometryInputAddFace(input1, &faceLoop1, &index1); SUEntitiesFill(ent1, input1, true); SUModelMergeCoplanarFaces(model1);
the final result should looks like below image:
and the .dae file is in the attachment,
wall_temp3.dae (5.8 KB)
thanks in advance :]