C API: Can't create correct outer loop of a plane face


#1

Dear expert,

I am trying to export a SketchUp plane face with an outer loop by two ways. I prefer to Way 1 because Way 2 has the performance issue. However, Way 1 has the loop issue. Can we know how solve the loop issue?

Way 1: Create a sketchup face by API SUGeometryInputAddFace(…) by creating an outer loop.
I am using the following API to add the loop vertex index for a plane face with only an loop. The vertex index is: 0, 1, …, 21, 22, …, 61, 62, 21, 63, …, 86, 87. You can see that the vertex index 21 exists twice. When call the following API for the second vertex index 21, this API will return SU_ERROR_INVALID_ARGUMENT error. According to the document of API, it seems the error is as designed. And, if ignore the second vertex index 21 when add the loop index, the result face isn’t expected(Figure 1: lose a segment, holes_s.zip (4.0 KB)
).

SULoopInputAddVertexIndex(SULoopInputRef loop_input, size_t vertex_index)


Figure 1

Way 2: I try to export many triangulated sketchup faces(Figure 2, holes_s_2.zip (6.6 KB)
). Then to get a final plane face, I call API SUModelMergeCoplanarFaces(SUModelRef model). This way will have the big performance issue if the model is complex with a lot of faces. But the result face looks good(there is no any face segment lost, Figure 3, holes_s_3.zip (3.9 KB)
).


Figure 2


Figure 3