Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vertProperties behavior #536

Closed
pca006132 opened this issue Aug 25, 2023 · 3 comments · Fixed by #755
Closed

vertProperties behavior #536

pca006132 opened this issue Aug 25, 2023 · 3 comments · Fixed by #755
Assignees

Comments

@pca006132
Copy link
Collaborator

  1. We should definitely document them better.
  2. Should we interpolate them according to barycentric coordinate after subdivide? It seems that we forgot to implement it.
    // Make original since the subdivided faces are intended to be warped into
    // being non-coplanar, and hence not being related to the original faces.
    meshRelation_.originalID = ReserveIDs(1);
    InitializeOriginal();
    if (meshRelation_.numProp > 0) {
    meshRelation_.properties.resize(meshRelation_.numProp * numVert);
    meshRelation_.triProperties.resize(meshRelation_.triRef.size());
    // Fill properties according to barycentric.
    // Set triProp to share properties on continuous edges.
    // Duplicate properties will be removed during sorting.
    }
    return vertBary;
    }
  3. Should the decimator update copy vertex properties after duplicating the vertices?
    void Manifold::Impl::FormLoop(int current, int end) {
    int startVert = vertPos_.size();
    vertPos_.push_back(vertPos_[halfedge_[current].startVert]);
    int endVert = vertPos_.size();
    vertPos_.push_back(vertPos_[halfedge_[current].endVert]);
    int oldMatch = halfedge_[current].pairedHalfedge;
    int newMatch = halfedge_[end].pairedHalfedge;
    UpdateVert(startVert, oldMatch, newMatch);
    UpdateVert(endVert, end, current);
    halfedge_[current].pairedHalfedge = newMatch;
    halfedge_[newMatch].pairedHalfedge = current;
    halfedge_[end].pairedHalfedge = oldMatch;
    halfedge_[oldMatch].pairedHalfedge = end;
    RemoveIfFolded(end);
    }
@elalish
Copy link
Owner

elalish commented Aug 25, 2023

Ah yes, indeed I haven't gotten around to 2 yet. There's a bunch of stuff I want to do to improve smoothing as well.

For 3, no it should not copy the properties because they're identical. Better to reference them and keep the memory down. I don't think we make any assumptions about how verts and property verts relate to each other.

Agreed, regarding the need for better docs.

@pca006132
Copy link
Collaborator Author

oh ok, for 3 I think I mixed up the MeshGL interface and our internal representation a bit, I thought we have properties for each vertex.

@elalish
Copy link
Owner

elalish commented Mar 3, 2024

2 is fixed by #741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants