Fix union mesh, add missing files.
parent
982ee45a16
commit
c9efa79ddb
|
@ -225,6 +225,8 @@ void MeshGenerator::process()
|
||||||
bmeshNodeMap[nodeIt.first] = bmeshNodeId;
|
bmeshNodeMap[nodeIt.first] = bmeshNodeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool broken = false;
|
||||||
|
|
||||||
std::vector<int> meshIds;
|
std::vector<int> meshIds;
|
||||||
std::vector<int> subdivMeshIds;
|
std::vector<int> subdivMeshIds;
|
||||||
for (const auto &partIdIt: m_snapshot->partIdList) {
|
for (const auto &partIdIt: m_snapshot->partIdList) {
|
||||||
|
@ -237,6 +239,8 @@ void MeshGenerator::process()
|
||||||
continue;
|
continue;
|
||||||
int bmeshId = partBmeshMap[partIdIt];
|
int bmeshId = partBmeshMap[partIdIt];
|
||||||
int meshId = meshlite_bmesh_generate_mesh(meshliteContext, bmeshId);
|
int meshId = meshlite_bmesh_generate_mesh(meshliteContext, bmeshId);
|
||||||
|
if (meshlite_bmesh_error_count(meshliteContext, bmeshId) != 0)
|
||||||
|
broken = true;
|
||||||
bool subdived = isTrueValueString(part->second["subdived"]);
|
bool subdived = isTrueValueString(part->second["subdived"]);
|
||||||
if (m_requirePartPreviewMap.find(partIdIt) != m_requirePartPreviewMap.end()) {
|
if (m_requirePartPreviewMap.find(partIdIt) != m_requirePartPreviewMap.end()) {
|
||||||
ModelOfflineRender *render = m_partPreviewRenderMap[partIdIt];
|
ModelOfflineRender *render = m_partPreviewRenderMap[partIdIt];
|
||||||
|
@ -257,14 +261,17 @@ void MeshGenerator::process()
|
||||||
meshIds.push_back(meshId);
|
meshIds.push_back(meshId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool broken = false;
|
|
||||||
if (!subdivMeshIds.empty()) {
|
if (!subdivMeshIds.empty()) {
|
||||||
int mergedMeshId = 0;
|
int mergedMeshId = 0;
|
||||||
|
if (subdivMeshIds.size() > 1) {
|
||||||
int errorCount = 0;
|
int errorCount = 0;
|
||||||
mergedMeshId = unionMeshs(meshliteContext, subdivMeshIds, &errorCount);
|
mergedMeshId = unionMeshs(meshliteContext, subdivMeshIds, &errorCount);
|
||||||
if (errorCount)
|
if (errorCount)
|
||||||
broken = true;
|
broken = true;
|
||||||
else if (mergedMeshId > 0)
|
} else {
|
||||||
|
mergedMeshId = subdivMeshIds[0];
|
||||||
|
}
|
||||||
|
if (mergedMeshId > 0)
|
||||||
mergedMeshId = meshlite_combine_coplanar_faces(meshliteContext, mergedMeshId);
|
mergedMeshId = meshlite_combine_coplanar_faces(meshliteContext, mergedMeshId);
|
||||||
if (mergedMeshId > 0) {
|
if (mergedMeshId > 0) {
|
||||||
int subdivedMeshId = subdivMesh(meshliteContext, mergedMeshId);
|
int subdivedMeshId = subdivMesh(meshliteContext, mergedMeshId);
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef VERSION_H
|
||||||
|
#define VERSION_H
|
||||||
|
|
||||||
|
#define APP_NAME PROJECT_DEFINED_APP_NAME
|
||||||
|
#define APP_VER PROJECT_DEFINED_APP_VER
|
||||||
|
#define APP_HUMAN_VER PROJECT_DEFINED_APP_HUMAN_VER
|
||||||
|
#define APP_REPOSITORY_URL PROJECT_DEFINED_APP_REPOSITORY_URL
|
||||||
|
#define APP_ISSUES_URL PROJECT_DEFINED_APP_ISSUES_URL
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue