LiMeshingEdgeSplit

FunctionLtVert
LiMeshingEdgeSplit( LtPrim prim
LtPoly poly1
LtVref vref1
LtPoly poly2
LtVref vref2
LtDouble alpha
)
Synopsis The default LtFuncMeshingEdgeSplit callback, used inside LiPrimitiveTriangulate.
Locationligeops
Parameters
prim The primitive being triangulated.
poly1 The polygon on one side of the edge.
vref1 The LtVref of poly1; this defines the edge.
poly2 (possibly NULL) polygon on other side of edge.
vref2 The LtVref of poly2; defining the other end of the edge from vref1 --- only valid if poly2 is non- NULL
alpha Lies in range (0, 1); used to define how far along the edge, we wish to split it ... 0.5 being the midpoint.
Return Value A new vertex, created alpha of the way along the specified edge.

Description LiMeshingEdgeSplit is the default LtFuncMeshingEdgeSplit ( LI_MESH_CALLBACK_EDGE_SPLIT) callback.

\begin{figure}[hb] \vspace* \special{psfile=api/figures/edgesplit.ps hoffset=80} Application of LtFuncMeshingEdgeSplit callback \end{figure}

This function is called from LiPrimitiveTriangulate, when edge splitting, before triangulation, in response to a LI_MESH_CRIT_MAX_EDGE_VERTS criterion begin set to ` TRUE'. It is also called during further triangulation, when the primitive's longest polygon edge is repeatedly split in order to create more triangles than a straighforward triangulation of the input polygons, has produced.

The edge which is split is denoted by the LtVref pair \newline next> of the polygon poly1, and \newline next> of the polygon poly2, if it exists.

If users find that the default callback, LiMeshingEdgeSplit, is not handling some aspect of edge splitting (possibly relating to user-specified properties) then they can write their own callback (perhaps utilising LiMeshingEdgeSplit).

Example
/*
 * writing my own LtFuncMeshingEdgeSplit
 */
LtVert
my_edge_split_func (
      LtPrim   prim, 
      LtPoly   pol1, 
      LtVref   v1, 
      LtPoly   pol2, 
      LtVref   v2, 
      LtDouble alpha
)
{
   LtVert   result;

   /* 1: sort the basics */
   result = LiMeshingEdgeSplit(...);

   /* 2: sort my specifics */
   ...

   return ( result );
}

See Also LiMeshingInsertBridge
LiMeshingEdgeSwap
LiMeshingTriProperties
LiPrimitiveTriangulate
LiPrimitiveHierarchicalTriangulate
LiMeshingCallBacksSetCall
LiMeshingCallBacksGetCall
LiMeshingCallBacksCallState
LiMeshingCallBacksCreate
LiMeshingCallBacksCopy
LiMeshingCallBacksDestroy
LiMeshingCallBacksDebug


Copyright © 1990-1998, 1999 LightWork Design Limited. All rights reserved