Enable three nodes branch on gridded part
parent
4f6c82d825
commit
40a6968599
|
@ -421,14 +421,17 @@ void GridMeshBuilder::setSubdived(bool subdived)
|
|||
m_subdived = subdived;
|
||||
}
|
||||
|
||||
void GridMeshBuilder::build()
|
||||
bool GridMeshBuilder::build()
|
||||
{
|
||||
if (m_subdived)
|
||||
applyModifiers();
|
||||
prepareNodeVertices();
|
||||
findCycles();
|
||||
if (m_cycles.empty())
|
||||
return false;
|
||||
generateFaces();
|
||||
extrude();
|
||||
return true;
|
||||
}
|
||||
|
||||
void GridMeshBuilder::findCycles()
|
||||
|
@ -442,3 +445,4 @@ void GridMeshBuilder::findCycles()
|
|||
cycleFinder.find();
|
||||
m_cycles = cycleFinder.getCycles();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
size_t addNode(const QVector3D &position, float radius);
|
||||
size_t addEdge(size_t firstNodeIndex, size_t secondNodeIndex);
|
||||
void setSubdived(bool subdived);
|
||||
void build();
|
||||
bool build();
|
||||
const std::vector<QVector3D> &getGeneratedPositions();
|
||||
const std::vector<size_t> &getGeneratedSources();
|
||||
const std::vector<std::vector<size_t>> &getGeneratedFaces();
|
||||
|
|
|
@ -580,8 +580,7 @@ MeshCombiner::Mesh *MeshGenerator::combinePartMesh(const QString &partIdString,
|
|||
|
||||
if (subdived)
|
||||
gridMeshBuilder->setSubdived(true);
|
||||
gridMeshBuilder->build();
|
||||
buildSucceed = true;
|
||||
buildSucceed = gridMeshBuilder->build();
|
||||
|
||||
partCache.vertices = gridMeshBuilder->getGeneratedPositions();
|
||||
partCache.faces = gridMeshBuilder->getGeneratedFaces();
|
||||
|
|
|
@ -73,5 +73,13 @@ void SkeletonDocument::findAllNeighbors(QUuid nodeId, std::set<QUuid> &neighbors
|
|||
|
||||
bool SkeletonDocument::isNodeConnectable(QUuid nodeId) const
|
||||
{
|
||||
const auto &node = findNode(nodeId);
|
||||
if (nullptr == node)
|
||||
return false;
|
||||
if (node->edgeIds.size() < 2)
|
||||
return true;
|
||||
const SkeletonPart *part = findPart(node->partId);
|
||||
if (nullptr == part)
|
||||
return false;
|
||||
return part->gridded;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue