From: Regina Obe Date: Sun, 6 Mar 2016 00:43:07 +0000 (+0000) Subject: Use Tomvantilburg suggestion and just hard-code convex='false' for all IndexedFaceSets. X-Git-Tag: 2.3.0beta1~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c50653ead16a7702907352843b6687268cce3ce;p=postgis Use Tomvantilburg suggestion and just hard-code convex='false' for all IndexedFaceSets. Corrects the output of wrongly rendered without affecting true convex Closes #3435 for PostGIS 2.3 (trunk). Update Copyright info git-svn-id: http://svn.osgeo.org/postgis/trunk@14757 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/cunit/cu_out_x3d.c b/liblwgeom/cunit/cu_out_x3d.c index b130cc506..c94da4a54 100644 --- a/liblwgeom/cunit/cu_out_x3d.c +++ b/liblwgeom/cunit/cu_out_x3d.c @@ -1,8 +1,8 @@ /********************************************************************** * * PostGIS - Spatial Types for PostgreSQL - * http://www.postgis.org - * Copyright 2011 Regina Obe + * http://postgis.net + * Copyright 2011-2016 Regina Obe * * This is free software; you can redistribute and/or modify it under * the terms of the GNU General Public Licence. See the COPYING file. @@ -94,7 +94,7 @@ static void out_x3d3_test_geoms(void) /* Polygon **/ do_x3d3_test( "POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))", - "", + "", NULL, 3, 0); /* TODO: Polygon - with internal ring - the answer is clearly wrong */ @@ -123,13 +123,13 @@ static void out_x3d3_test_geoms(void) /* MultiPolygon */ do_x3d3_test( "MULTIPOLYGON(((0 1 1,2 3 1,4 5 1,0 1 1)),((6 7 1,8 9 1,10 11 1,6 7 1)))", - "", + "", NULL, 0, 0); /* PolyhedralSurface */ do_x3d3_test( "POLYHEDRALSURFACE( ((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)) )", - "", + "", NULL, 0, 0); /* TODO: returns garbage at moment correctly implement GeometryCollection -- */ @@ -167,13 +167,13 @@ static void out_x3d3_test_option(void) /* geocoordinate long,lat*/ do_x3d3_test( "SRID=4326;POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))", - "", + "", NULL, 3, 2); /* geocoordinate lat long*/ do_x3d3_test( "SRID=4326;POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))", - "", + "", NULL, 3, 3); diff --git a/liblwgeom/lwout_x3d.c b/liblwgeom/lwout_x3d.c index 6e603209c..b9735a78f 100644 --- a/liblwgeom/lwout_x3d.c +++ b/liblwgeom/lwout_x3d.c @@ -1,8 +1,7 @@ -/********************************************************************** +********************************************************************** * * PostGIS - Spatial Types for PostgreSQL * http://postgis.net - * * PostGIS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or @@ -18,7 +17,7 @@ * ********************************************************************** * - * Copyright 2011-2015 Arrival 3D + * Copyright 2011-2016 Arrival 3D, Regina Obe * **********************************************************************/ @@ -457,7 +456,7 @@ asx3d3_multi_buf(const LWCOLLECTION *col, char *srs, char *output, int precision break; case MULTIPOLYGONTYPE: x3dtype = "IndexedFaceSet"; - ptr += sprintf(ptr, "<%s %s coordIndex='", x3dtype, defid); + ptr += sprintf(ptr, "<%s %s convex='false' coordIndex='", x3dtype, defid); ptr += asx3d3_mpoly_coordindex((const LWMPOLY *)col, ptr); ptr += sprintf(ptr, "'>"); break; @@ -523,8 +522,8 @@ asx3d3_psurface_size(const LWPSURFACE *psur, char *srs, int precision, int opts, size_t size; size_t defidlen = strlen(defid); - if ( X3D_USE_GEOCOORDS(opts) ) size = sizeof("") + defidlen; - else size = sizeof("") + defidlen; + if ( X3D_USE_GEOCOORDS(opts) ) size = sizeof("") + defidlen; + else size = sizeof("") + defidlen; for (i=0; ingeoms; i++) @@ -552,7 +551,7 @@ asx3d3_psurface_buf(const LWPSURFACE *psur, char *srs, char *output, int precisi ptr = output; /* Open outmost tag */ - ptr += sprintf(ptr, "