[postgis-tickets] [PostGIS] #3435: Unexpected output from ST_AsX3D with PolyhedralSurfaceZ
PostGIS
trac at osgeo.org
Wed Jan 20 00:18:45 PST 2016
#3435: Unexpected output from ST_AsX3D with PolyhedralSurfaceZ
----------------------------+---------------------------
Reporter: tomvantilburg | Owner: robe
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.2.2
Component: postgis | Version: 2.2.x
Resolution: | Keywords:
----------------------------+---------------------------
Comment (by robe):
tomvantilburg,
The problem seems to be that I need to specify if the polygon is convex or
not. Seems the spec assumes convex.
I redid mine using:
{{{
SELECT '<Shape><appearance>
<material ambientintensity="0.500" containerfield="material"
shininess="1" diffusecolor="0.8 0.3 0.4" /> </appearance>' ||
replace(ST_AsX3D(ST_Extrude(ST_GeometryFromText('Polygon((0 0, 0 10, 30
10, 30 0, 20 0, 20 5, 10 5, 10 0, 0 0))'),0,0,10)), 'IndexedFaceSet',
'IndexedFaceSet convex="false"') || '</Shape>'
}}}
so basically adding a convex="false" with
{{{
<IndexedFaceSet convex='false' coordIndex='0 1 2 3 4 5 6 7 -1 8 9 10 11
12 13 14 15 -1 16 17 18 19 -1 20 21 22 23 -1 24 25 26 27 -1 28 29 30 31 -1
32 33 34 35 -1 36 37 38 39 -1 40 41 42 43 -1 44 45 46 47'><Coordinate
point='0 0 0 0 10 0 30 10 0 30 0 0 20 0 0 20 5 0 10 5 0 10 0 0 0 0 10 10 0
10 10 5 10 20 5 10 20 0 10 30 0 10 30 10 10 0 10 10 0 0 0 0 0 10 0 10 10 0
10 0 0 10 0 0 10 10 30 10 10 30 10 0 30 10 0 30 10 10 30 0 10 30 0 0 30 0
0 30 0 10 20 0 10 20 0 0 20 0 0 20 0 10 20 5 10 20 5 0 20 5 0 20 5 10 10 5
10 10 5 0 10 5 0 10 5 10 10 0 10 10 0 0 10 0 0 10 0 10 0 0 10 0 0 0'
/></IndexedFaceSet>
}}}
and output then looks correct:
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3435#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list