LiMeshingInsertBridge

FunctionLtPoly

LiMeshingInsertBridge( LtPrim prim
LtPoly poly
LtVref from
LtVref to
)
Synopsis The default LtFuncMeshingInsertBridge callback, used inside LiPrimitiveTriangulate.
Locationligeops
Parameters
prim The primitive being triangulated.
poly The polygon being split into 2.
from This defines the `from' end of the new edge.
to This defines the `to' end of the new edge.
Return Value A new polygon, created by joining two vertices of an existing polygon.

Description LiMeshingInsertBridge is the default LtFuncMeshingInsertBridge ( LI_MESH_CALLBACK_INSERT_BRIDGE) callback.

\begin{figure}[hb] \vspace* \special{psfile=api/figures/insbridge.ps hoffset=40} Application of LtFuncMeshingInsertBridge callback \end{figure}

An edge is created that joins the two LtVrefs to one another; thereby splitting the polygon in two. The input polygon is changed so that it represents the area to the `right' of the new edge. The resultant polygon represents the area to the `left' of the new edge.

This function is called from LiPrimitiveTriangulate, during further triangulation, when the primitive's longest polygon edge is repeatedly split, and any resultant quadrilaterals are re-triangulated (by joining the midpoint of the longest edge, to the opposite vertex)

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

For example, if the caller had a database where every polygon had a unique ID, which needed to be inherited by its children triangles, then the caller would have to provide an LtFuncMeshingInsertBridge function that managed this ID.

Example
/*
 * writing my own LtFuncMeshingInsertBridge
 */
LtPoly
my_insert_bridge_func (
      LtPrim   prim, 
      LtPoly   poly, 
      LtVref   from, 
      LtVref   to
)
{
   LtPoly   result;

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

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

   return ( result );
}

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


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