Fix build
parent
edff9b0b35
commit
0f7735e93a
|
@ -471,8 +471,8 @@ HEADERS += src/boxmesh.h
|
|||
SOURCES += src/meshrecombiner.cpp
|
||||
HEADERS += src/meshrecombiner.h
|
||||
|
||||
SOURCES += src/triangulate.cpp
|
||||
HEADERS += src/triangulate.h
|
||||
SOURCES += src/triangulatefaces.cpp
|
||||
HEADERS += src/triangulatefaces.h
|
||||
|
||||
SOURCES += src/booleanmesh.cpp
|
||||
HEADERS += src/booleanmesh.h
|
||||
|
|
|
@ -1,34 +1,32 @@
|
|||
#include "boxmesh.h"
|
||||
#include "strokemeshbuilder.h"
|
||||
#include "triangulate.h"
|
||||
|
||||
static const std::vector<QVector3D> subdivedBoxObjVertices = {
|
||||
{-0.025357, -0.025357, 0.025357},
|
||||
{-0.025357, 0.025357, 0.025357},
|
||||
{-0.025357, 0.025357, -0.025357},
|
||||
{-0.025357, -0.025357, -0.025357},
|
||||
{0.025357, -0.025357, 0.025357},
|
||||
{0.025357, -0.025357, -0.025357},
|
||||
{0.025357, 0.025357, 0.025357},
|
||||
{0.025357, 0.025357, -0.025357},
|
||||
{-0.030913, -0.030913, -0.000000},
|
||||
{-0.030913, -0.000000, 0.030913},
|
||||
{-0.030913, 0.030913, 0.000000},
|
||||
{-0.030913, 0.000000, -0.030913},
|
||||
{0.030913, -0.030913, -0.000000},
|
||||
{0.000000, -0.030913, 0.030913},
|
||||
{-0.000000, -0.030913, -0.030913},
|
||||
{0.030913, -0.000000, 0.030913},
|
||||
{-0.000000, 0.030913, 0.030913},
|
||||
{0.030913, 0.030913, 0.000000},
|
||||
{0.030913, 0.000000, -0.030913},
|
||||
{-0.000000, 0.030913, -0.030913},
|
||||
{-0.042574, 0.000000, -0.000000},
|
||||
{-0.000000, -0.042574, -0.000000},
|
||||
{0.000000, -0.000000, 0.042574},
|
||||
{0.042574, -0.000000, -0.000000},
|
||||
{-0.000000, 0.000000, -0.042574},
|
||||
{0.000000, 0.042574, 0.000000},
|
||||
{-0.025357f, -0.025357f, 0.025357f},
|
||||
{-0.025357f, 0.025357f, 0.025357f},
|
||||
{-0.025357f, 0.025357f, -0.025357f},
|
||||
{-0.025357f, -0.025357f, -0.025357f},
|
||||
{0.025357f, -0.025357f, 0.025357f},
|
||||
{0.025357f, -0.025357f, -0.025357f},
|
||||
{0.025357f, 0.025357f, 0.025357f},
|
||||
{0.025357f, 0.025357f, -0.025357f},
|
||||
{-0.030913f, -0.030913f, -0.000000f},
|
||||
{-0.030913f, -0.000000f, 0.030913f},
|
||||
{-0.030913f, 0.030913f, 0.000000f},
|
||||
{-0.030913f, 0.000000f, -0.030913f},
|
||||
{0.030913f, -0.030913f, -0.000000f},
|
||||
{0.000000f, -0.030913f, 0.030913f},
|
||||
{-0.000000f, -0.030913f, -0.030913f},
|
||||
{0.030913f, -0.000000f, 0.030913f},
|
||||
{-0.000000f, 0.030913f, 0.030913f},
|
||||
{0.030913f, 0.030913f, 0.000000f},
|
||||
{0.030913f, 0.000000f, -0.030913f},
|
||||
{-0.000000f, 0.030913f, -0.030913f},
|
||||
{-0.042574f, 0.000000f, -0.000000f},
|
||||
{-0.000000f, -0.042574f, -0.000000f},
|
||||
{0.000000f, -0.000000f, 0.042574f},
|
||||
{0.042574f, -0.000000f, -0.000000f},
|
||||
{-0.000000f, 0.000000f, -0.042574f},
|
||||
{0.000000f, 0.042574f, 0.000000f},
|
||||
};
|
||||
|
||||
static const std::vector<std::vector<size_t>> subdivedBoxObjFaces = {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "partbase.h"
|
||||
#include "imageforever.h"
|
||||
#include "gridmeshbuilder.h"
|
||||
#include "triangulate.h"
|
||||
#include "triangulatefaces.h"
|
||||
|
||||
MeshGenerator::MeshGenerator(Snapshot *snapshot) :
|
||||
m_snapshot(snapshot)
|
||||
|
@ -770,7 +770,7 @@ MeshCombiner::Mesh *MeshGenerator::combinePartMesh(const QString &partIdString,
|
|||
}
|
||||
if (partCache.previewTriangles.empty()) {
|
||||
partPreviewVertices = partCache.vertices;
|
||||
triangulate(partPreviewVertices, partCache.faces, partCache.previewTriangles);
|
||||
triangulateFacesWithoutKeepVertices(partPreviewVertices, partCache.faces, partCache.previewTriangles);
|
||||
#ifdef IN_DEVELOPMENT
|
||||
{
|
||||
QFile file("/Users/jeremy/Desktop/dust3d_debug.obj");
|
||||
|
|
|
@ -123,16 +123,16 @@ private:
|
|||
std::map<size_t, size_t> m_weldMap;
|
||||
std::set<size_t> m_swallowedEdges;
|
||||
std::set<size_t> m_swallowedNodes;
|
||||
float m_deformThickness = 1.0;
|
||||
float m_deformWidth = 1.0;
|
||||
float m_cutRotation = 0.0;
|
||||
float m_deformThickness = 1.0f;
|
||||
float m_deformWidth = 1.0f;
|
||||
float m_cutRotation = 0.0f;
|
||||
bool m_baseNormalOnX = true;
|
||||
bool m_baseNormalOnY = true;
|
||||
bool m_baseNormalOnZ = true;
|
||||
bool m_baseNormalAverageEnabled = false;
|
||||
const QImage *m_deformMapImage = nullptr;
|
||||
float m_deformMapScale = 0.0;
|
||||
float m_hollowThickness = 0.2;
|
||||
float m_deformMapScale = 0.0f;
|
||||
float m_hollowThickness = 0.2f;
|
||||
std::vector<std::vector<size_t>> m_endCuts;
|
||||
|
||||
void sortNodeIndices();
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef DUST3D_TRIANGULATE_H
|
||||
#define DUST3D_TRIANGULATE_H
|
||||
#include <QVector3D>
|
||||
#include <vector>
|
||||
|
||||
bool triangulate(std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &faces, std::vector<std::vector<size_t>> &triangles);
|
||||
|
||||
#endif
|
|
@ -4,13 +4,13 @@
|
|||
#include <QVector2D>
|
||||
#include <QVector3D>
|
||||
#include "booleanmesh.h"
|
||||
#include "triangulate.h"
|
||||
#include "triangulatefaces.h"
|
||||
#include "util.h"
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel InexactKernel;
|
||||
typedef CGAL::Surface_mesh<InexactKernel::Point_3> InexactMesh;
|
||||
|
||||
bool triangulate(std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &faces, std::vector<std::vector<size_t>> &triangles)
|
||||
bool triangulateFacesWithoutKeepVertices(std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &faces, std::vector<std::vector<size_t>> &triangles)
|
||||
{
|
||||
auto cgalMesh = buildCgalMesh<InexactKernel>(vertices, faces);
|
||||
bool isSucceed = CGAL::Polygon_mesh_processing::triangulate_faces(*cgalMesh);
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef DUST3D_TRIANGULATE_FACES_H
|
||||
#define DUST3D_TRIANGULATE_FACES_H
|
||||
#include <QVector3D>
|
||||
#include <vector>
|
||||
|
||||
bool triangulateFacesWithoutKeepVertices(std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &faces, std::vector<std::vector<size_t>> &triangles);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue