Comments (5)
do you have a mesh you could share where this happens?
from boundary-first-flattening.
sure
https://dropmefiles.com/fkDFn
void Generators::buildPrimalSpanningTree(Mesh& mesh,
VertexData<VertexCIter>& primalParent)
{
// mark each vertex as its own parent
for (VertexCIter v = mesh.vertices.begin(); v != mesh.vertices.end(); v++) {
primalParent[v] = v;
}
// build primal spanning tree
VertexCIter root = mesh.vertices.begin();
std::queue<VertexCIter> q;
q.push(root);
int cnt = 0;
while (!q.empty()) {
VertexCIter u = q.front();
q.pop();
HalfEdgeCIter he = u->he;
do {
HalfEdgeCIter flip = he->flip;
EdgeCIter e = he->edge;
if (e->isCuttable) {
VertexCIter v = flip->vertex;
if (primalParent[v] == v && v != root) {
primalParent[v] = u;
q.push(v);
}
}
if (cnt == 4077)
{
std::cout << "he " << he->index << std::endl;
std::cout << "he->onBoundary " << he->onBoundary << std::endl;
std::cout << "he->face " << he->face->index << std::endl;
std::cout << "vertex idx " << he->vertex->index << std::endl;
std::cout << "vertex pos " << he->vertex->position.x << " " << he->vertex->position.y << " " << he->vertex->position.z << std::endl;
}
he = flip->next;
} while (he != u->he);
//std::cout << "iter " << cnt << std::endl;
cnt++;
}
}
from boundary-first-flattening.
in my case in function void HoleFiller::fill(FaceIter b, const std::vector& boundaryHalfEdges, Mesh& mesh)
int n = (int)boundaryHalfEdges.size();// n == 3
so, this
// inserting halfedges, edges, faces and corners *should* not invalidate iterators as
// extra space was reserved in the preallocateElements function in MeshIO
for (int i = 0; i < n - 3; i++) {
do nothing
and here
// update connectivity
VertexIter rootVertex = boundaryHalfEdges[0]->vertex;
for (int i = 0; i < (int)boundaryHalfEdges.size(); i++) {
HalfEdgeIter he = boundaryHalfEdges[i];
if (i == 0) {
HalfEdgeIter next = he->next;
HalfEdgeIter newHe = mesh.halfEdges.begin() + nHalfEdges; // <-- here
HalfEdgeIter newHe is iterator to unexisted half edge.
btw. i think you shoul use assert to check are we have enouh preserved memory in vector to do not trig reallocation.
from boundary-first-flattening.
Thanks @Lishen1, this bug will be fixed in the next release.
from boundary-first-flattening.
@rohan-sawhney this problem can be solved by handle special case like:
if (n == 3)
{
if (i == 0) {
HalfEdgeIter next = he->next;
FaceIter newF = mesh.faces.begin() + nFaces;
CornerIter newC1 = mesh.corners.begin() + nCorners;
CornerIter newC2 = mesh.corners.begin() + nCorners + 1;
CornerIter newC3 = mesh.corners.begin() + nCorners + 2;
he->onBoundary = false;
next->onBoundary = false;
next->next->onBoundary = false;
newF->he = he;
he->face = newF;
next->face = newF;
next->next->face = newF;
newC3->he = he;
newC1->he = next;
newC2->he = next->next;
he->corner = newC3;
next->corner = newC1;
next->next->corner = newC2;
}
}
but, what fillAll flag in HoleFiller::fill do ? if i set it to false, and commen if (loopLength < 0.5*mesh.diameter()) fillAll = true; i get inifinite loop in BFF procedure, even in on face.obj. for my mesh it looks like it close main border of my mesh and produce bad result.
from boundary-first-flattening.
Related Issues (20)
- Cannot open <cblas.h> HOT 4
- seeking surface model with holes HOT 3
- Port to wasm for web
- Mesh has isolated vertex HOT 1
- Include GLFW as Dependency HOT 2
- Concepts in the project HOT 1
- Compile with emscripten question HOT 2
- UV Overlapping problem? HOT 2
- AdjacencyTable uses a slow data structure HOT 1
- `std::vector<bool>` has unfortuante and unexpected implementation HOT 1
- Half edge mesh operations cannot be inlined HOT 1
- Mesh has non manifold vertices HOT 2
- Mac Command Line error - Access Denied HOT 2
- non-manifold edges warning when holes/multiple components HOT 1
- README needs an update for the C++ interface HOT 2
- Asymmetric result after flattening HOT 7
- Vector subscript is out of range exception. PolygonSoup.cpp. HOT 4
- About flattening to a rectangle with specified aspect ratio HOT 3
- How to output area distortion from an app HOT 2
- feat: Export error/quality measures
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boundary-first-flattening.