The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)

HowTo:Determine whether a VERTEX is non-manifold?

From DocR19

Jump to: navigation, search
Solids joined at a non-manifold vertex
Solids joined at a non-manifold vertex
Mixed dimension non-manifold vertex
Mixed dimension non-manifold vertex

Contents

Background

The answer to this question may depend on the context. Bodies in ACIS can be non-manifold because they represent non-manifold objects (see manifold and non-manifold objects), and we wish to know whether a vertex represents a non-manifold condition in a body. On the other hand, we may wish to know whether edges or faces are connected to a vertex in a particular configuration.

When can a vertex be regarded as non-manifold? There are several situations:

  • One of the edges incident with the vertex is non-manifold
  • There are both wire edges and faces at the vertex
  • All the edges incident with the vertex are wire and there are more than two of them
  • The vertex is a local "cut-point" of the body

This last configuration is probably the most common and can arise when combining solid objects.

Counting edges at a VERTEX

Suppose we are trying to navigate amongst the edges of a vertex. If a vertex is on a manifold solid body with no internal faces, then the VERTEX actually contains the pointer to one of its EDGEs. The rest of the EDGEs can be obtained by collecting all the COEDGEs which are connected nose-to-tail at the vertex. Any collection of edges which are related in this way is called an "edge group". If more than one edge group is present at a vertex, then the vertex must be connected to all of them, so an array of edges, one for each edge group, is stored at the vertex. This is achieved by setting the edge pointer in the VERTEX to NULL, and attaching an attribute which points to the array (and knows how many there are). Fortunately, it is not necessary to manipulate the data structure in this way, the methods on VERTEX do it all for you.

Example

As an example, we will show how to count the edges in each edge group at a vertex.

#include "alltop.hxx"
#include "lists.hxx"
 
VERTEX  *vtx = something;
 
if ( vtx->count_edges() > 1 )
   printf("Non-manifold vertex!");
else
   printf("Vertex points to single edge group");
 
for (int i = 0; i < vtx->count_edges(); i++)
{
    ENTITY_LIST   edges, coedges;
    coedges.add(vtx->edge(i)->coedge());        
    for (COEDGE  *ce = (COEDGE *) coedges.first(); ce != NULL; ce = (COEDGE *) coedges.next())
    {
        // Add any new edges to our collection.
        edges.add(ce->edge());
 
        // Propagate to other coedges at the vertex.
        if (ce->start() == vtx)
            coedges.add(ce->previous());
        if (ce->end() == vtx)
            coedges.add(ce->next());
        coedges.add(ce->partner());
    }
    printf("There are %d edges in edge group number %d\n", edges.count(), i);
}

Note that this code fragment will work even if there is a mixture of wire edges and faces at the vertex.

Scheme Commands

Scheme could be used to make these inquiries, but there is nothing easy. The quickest way from Scheme is to look at the output of entity:debug for the vertex.

Personal tools