#ifndef DUST3D_MESH_STROKETIFIER_H #define DUST3D_MESH_STROKETIFIER_H #include #include #include #include class MeshStroketifier : public QObject { Q_OBJECT public: struct Node { QVector3D position; float radius; }; void setCutRotation(float cutRotation); bool prepare(const std::vector &strokeNodes, const std::vector &vertices); void stroketify(std::vector *vertices); void stroketify(std::vector *nodes); private: float m_cutRotation = 0.0; QVector3D m_modelOrigin; float m_modelLength = 0.0; float m_scaleAmount = 1.0; QVector3D m_modelAlignDirection; std::vector m_modelJointPositions; std::vector m_modelTransforms; static float calculateStrokeLengths(const std::vector &strokeNodes, std::vector *lengths); static void calculateBoundingBox(const std::vector &vertices, float *minX, float *maxX, float *minY, float *maxY, float *minZ, float *maxZ); void translate(std::vector *vertices); void scale(std::vector *vertices); void deform(std::vector *vertices); }; #endif