# Synopsis

PDX_MSGT gdx_SolidToPolyShell2(long option, MDA_PTR gdx_solid_ptr, double approx_tol, int model, long *num_gdx_ps_ptrs, MDA_PTR **gdx_ps_ptrs, OTM_TREE *gdx_ps_surf_tree)

# Purpose

Convert (tessellate) GDX Solid to GDX Polyshell(s)

# Description

This function tessellates a GDX Solid to one or more GDX Polyshell entities. The resulting polyshell consists of counter-clockwise polygons (sometimes referred to as facets or tessellants). Each of the polygons will be within approx_tol of the Solid.

For the best results, incoming solids should not contain loops which are open, self-intersecting or intersect other loops, and incoming solids must contain faces with single outer loops. This can be taken care of by calling the following function with this option: gdx_SolidProcessAll with the GDX_PREP_POLYSHELL By default the input GDX Solid will be exactly the same as the output GDX Solid. If the option GDX_NO_COPY, is used, the UV points that are returned in the tessalation were calculated on the returned GDX Solids re-parameterized surfaces. When the option GDX_POLYSHELL_PER_FACE, is used, and the binding OTM_TREE @d gdx_ps_surf_tree is passed in, then each polyshell will be directly associated with its corresponding re-parameterized surface in the tree. If this is not wanted, pass in NULL instead of the OTM_TREE. The tree will be populated by the object: typedef struct gdx_solid_ps_surf { MDA_PTR gdx_ps_ptr; GDX polyshell MDA_PTR gdx_surf_ptr; Associated re-parameterized surface } GDX_SOLID_PS_SURF; The tree should be allocated with the form: OTM_TREE *gdx_ps_surf_tree; gdx_ps_surf_tree = otm_CreateTree (OTM_NOOPT, sizeof (GDX_SOLID_PS_SURF), gdx__PSSurfCompareObject, NULL)

# Input

## option

### GDX_NOOPT

(default) Solid is converted to a single polyshell. Each segment of the polyshell is used in exactly two polygons

### GDX_NO_COPY

The output Solid may have new UV points based on the new re-parameterized surfaces

### GDX_POLYSHELL_PER_FACE

Solid is converted to multiple polyshells, one per each face of solid

### GDX_POLYSHELL_FAST

By default the tesselation merges all duplicate edges and points. However, when this option is specified, the duplicates are not removed.

## gdx_solid_ptr

GDX Solid data base pointer

## approx_tol

Approximation tolerance

## model

Destination model

# Output

## num_gdx_ps_ptrs

Number of GDX Polyshell entities returned

## gdx_ps_ptrs

GDX Polyshell data base pointers

## gdx_ps_surf_tree

OTM tree that associates polyshells to their surfaces

# Return

          GEA_NOERR
          .fi