From 358f08d59367391f50dcdb2bf52f6254ddfaccec Mon Sep 17 00:00:00 2001 From: Jeremy HU Date: Fri, 4 Nov 2022 22:41:57 +1100 Subject: [PATCH] Update section preview --- application/sources/document_window.cc | 5 ++++- dust3d/mesh/section_preview_mesh_builder.cc | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/sources/document_window.cc b/application/sources/document_window.cc index ce77d8cc..4179be80 100644 --- a/application/sources/document_window.cc +++ b/application/sources/document_window.cc @@ -1161,9 +1161,12 @@ void DocumentWindow::generateComponentPreviewImages() continue; component.second.isPreviewMeshObsolete = false; auto previewMesh = std::unique_ptr(component.second.takePreviewMesh()); + bool useFrontView = false; if (!component.second.linkToPartId.isNull()) { const auto& part = m_document->findPart(component.second.linkToPartId); if (nullptr != part) { + if (dust3d::PartTarget::CutFace == part->target) + useFrontView = true; if (!part->colorImageId.isNull()) { const auto& colorImage = ImageForever::get(part->colorImageId); if (nullptr != colorImage) { @@ -1172,7 +1175,7 @@ void DocumentWindow::generateComponentPreviewImages() } } } - m_componentPreviewImagesGenerator->addInput(component.first, std::move(previewMesh)); + m_componentPreviewImagesGenerator->addInput(component.first, std::move(previewMesh), useFrontView); } m_componentPreviewImagesGenerator->moveToThread(thread); connect(thread, &QThread::started, m_componentPreviewImagesGenerator, &MeshPreviewImagesGenerator::process); diff --git a/dust3d/mesh/section_preview_mesh_builder.cc b/dust3d/mesh/section_preview_mesh_builder.cc index 741eb307..83387503 100644 --- a/dust3d/mesh/section_preview_mesh_builder.cc +++ b/dust3d/mesh/section_preview_mesh_builder.cc @@ -83,9 +83,6 @@ void SectionPreviewMeshBuilder::build() ropeParameters.defaultRadius = 0.075; RopeMesh ropeMesh(ropeParameters); ropeMesh.addRope(cutFaceVertices, true); - for (size_t i = 0; i < cutFaceVertices.size(); ++i) { - ropeMesh.addRope({ cutFaceVertices[i], cutFaceVertices[i] - Vector3(0.0, 0.0, 1.5) }, false); - } for (const auto& it : ropeMesh.resultVertices()) { m_resultVertices.push_back(it); m_resultVertexProperties.emplace_back(frameVertexProperty);