Skip to content

Split edges not identifying as boundary (inconsistently) #37

@camnewnham

Description

@camnewnham

Hi,
Thankyou for this fantastic library - it has been a pleasure to use and appears simple but powerful.

I ran into some issue splitting boundary edges - whereas the vertices are not correctly returning whether they are boundary or not. It seems to be inconsistent (does not apply to all boundary edges on a mesh).

It seems to be that the AdjacentFace() of a split edge may be incorrectly stored after a SplitEdge() - however as I am still learning the HE structure I can not confirm. The outgoing edge structure appears correct (pictured).

Note that not all boundary vertices are marked (black dots), but the outgoing HE structure appears correct - hence the suspicion of adjacentfaces being stored incorrectly.
However as SplitEdge() appears to copy the required integer with the below, I was unsure where this occurred.
this[new_halfedge2].AdjacentFace = this[pair].AdjacentFace;

For my purposes I have been able to solve this by changing the VertexList.IsBoundary function to:

public bool IsBoundary(int index)
{
            int h = this[index].OutgoingHalfedge;

            int hp = _mesh.Halfedges.GetPairHalfedge(h);

            return (h <= -1 || _mesh.Halfedges[h].AdjacentFace == -1) || (hp < -1 || _mesh.Halfedges[hp].AdjacentFace == -1);
        }

This solves my immediate issue, as pictured here (note correctly identified boundary vertices:

Anyhow - just thought I would let you know - perhaps you can shed more light on this for me :)

Thanks
CN

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions