CG_Tesselate — Perform surface Tessellation of a polygon or polyhedralsurface and returns as a TIN or collection of TINS
geometry CG_Tesselate(geometry geom);
Takes as input a surface such a MULTI(POLYGON) or POLYHEDRALSURFACE and returns a TIN representation via the process of tessellation using triangles.
                 
               | 
              |
| 
                 ST_TriangulatePolygon does similar to this function except that it returns a geometry collection of polygons instead of a TIN and also only works with 2D geometries.  | 
            
Availability: 3.5.0
            
 Questo metodo richiede il backend SFCGAL. 
            
 Questa funzione supporta il 3d e non distrugge gli z-index. 
            
 Questa funzione supporta le Polyhedral Surface. 
            
 Questa funzione supporta i Triangoli e le Triangulated Irregular Network Surfaces (TIN). 
 SELECT ST_GeomFromText('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
                                    ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),
                                    ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
                                    ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )');
 ![]() Original Cube  | 
                
 SELECT CG_Tesselate(ST_GeomFromText('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
                                ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),
                                ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
                                ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )'));
                        ST_AsText output: TIN Z (((0 0 0,0 0 1,0 1 1,0 0 0)),((0 1 0,0 0 0,0 1 1,0 1 0)),
                        ((0 0 0,0 1 0,1 1 0,0 0 0)),
                        ((1 0 0,0 0 0,1 1 0,1 0 0)),((0 0 1,1 0 0,1 0 1,0 0 1)),
                        ((0 0 1,0 0 0,1 0 0,0 0 1)),
                        ((1 1 0,1 1 1,1 0 1,1 1 0)),((1 0 0,1 1 0,1 0 1,1 0 0)),
                        ((0 1 0,0 1 1,1 1 1,0 1 0)),((1 1 0,0 1 0,1 1 1,1 1 0)),
                        ((0 1 1,1 0 1,1 1 1,0 1 1)),((0 1 1,0 0 1,1 0 1,0 1 1)))
                    
 ![]() Tessellated Cube with triangles colored  | 
              
 SELECT 'POLYGON (( 10 190, 10 70, 80 70, 80 130, 50 160, 120 160, 120 190, 10 190 ))'::geometry; 
 ![]() Original polygon  | 
                
 SELECT
                        CG_Tesselate('POLYGON (( 10 190, 10 70, 80 70, 80 130, 50 160, 120 160, 120 190, 10 190 ))'::geometry);
 ST_AsText output TIN(((80 130,50 160,80 70,80 130)),((50 160,10 190,10 70,50 160)),
                ((80 70,50 160,10 70,80 70)),((120 160,120 190,50 160,120 160)),
                ((120 190,10 190,50 160,120 190)))
            ![]() Tessellated Polygon  | 
              
CG_ConstrainedDelaunayTriangles, ST_DelaunayTriangles, ST_TriangulatePolygon