View Single Post
Old 16th January 2004, 12:27 PM   #1
Thaellin
Senior Member
Professional user
 
Join Date: Jun 2003
Location: British Columbia, Canada
Posts: 255
Default ac_object_get_triangle_surfaces vs ac_object_get_surfacelist

Hi,

I'm working on a modification to my boolean plugin and notice that, for some tests, I am getting different results when fetching all triangulated surfaces from an object versus getting all surfaces then iterating them and triangulating as I go.

Example:
Code:
List * pObjectSurfaces = ac_object_get_surfacelist( (ACObject *)pSource );
List *pObjectTriangles = ac_object_get_triangle_surfaces((ACObject *)pSource );

List * pSingleSurface = 0;
list_for_each( pObjectSurfaces, pSingleSurface ) {
   List *pTriangulatedSurfaces = surface_get_triangulations( (Surface *)pSingleSurface->data );            

   for ( List *pTriListIterator = pTriangulatedSurfaces; 
          pTriListIterator; 
          pTriListIterator = pTriListIterator->next) 
   {
      // DO "SOMETHING"
   }
   ac_surfacelist_free(&pTriangulatedSurfaces);
}
Now, as presented, I'm triangulating each surface as it comes through. This is causing slightly different results that if I were to use "pObjectTriangles" in place of "pObjectSurfaces". Using the whole object triangulation output causes the correct result - using the per-surface triangulation causes a couple of my test cases to incorrectly classify some surfaces (in/out) later in the logic.

I don't understand why this is happenning, and am pretty much out of ideas. Any information or theories would be welcome.

Thanks,
-- Jeff
Thaellin is offline   Reply With Quote