Hi,
I tried to create .SCS file by following the sample code in “authoring_samples”, but in this sample project I didn’t find any example that shows how to create a surface with a inner hole.
Sample code is as below:
static void
AddSquareFace(
SC::Store::Mesh& mesh,
uint32_t const* point_indices,
uint32_t normal_index,
uint32_t rgba_index)
{
mesh.face_elements.emplace_back();
SC::Store::MeshElement& face = mesh.face_elements.back();
// Add first face triangle
for (size_t i = 0; i < 3; ++i) {
face.indices.push_back(point_indices[i]);
face.indices.push_back(normal_index);
face.indices.push_back(rgba_index);
}
// Add second face triangle
for (size_t i = 0; i < 3; ++i) {
face.indices.push_back(point_indices[(i + 2) % 4]);
face.indices.push_back(normal_index);
face.indices.push_back(rgba_index);
}
// Add face edges
for (size_t i = 0; i < 4; ++i) {
mesh.polyline_elements.emplace_back();
SC::Store::MeshElement& edges = mesh.polyline_elements.back();
edges.indices.push_back(point_indices[i % 4]);
edges.indices.push_back(rgba_index);
edges.indices.push_back(point_indices[(i + 1) % 4]);
edges.indices.push_back(rgba_index);
// Set bits on edges so that they are selectable for measurement
mesh.polyline_elements_bits.push_back(SC::Store::SelectionBitsEdgeHasMeasurementData);
}
// Set bits on faces so that they are selectable for measurement
mesh.face_elements_bits.push_back(
SC::Store::SelectionBitsFaceHasMeasurementData | SC::Store::SelectionBitsFacePlanar);
}
If I want to add an inner hole into this square face, what should I do?
Thanks.