[Shapelib] Multipatch creation error
Oscar Gomez Mateu
gomezmateu.oscar at gmail.com
Tue Sep 14 07:59:55 EST 2010
Hi,
I am new to ShapeLib. I am ussing the .net wrapper available at the project
webpage. I have extended the wrapper to include the SHPRewindObject() of
version 1.2.10. My objective is to create a simple multipatch building
representation. Having a 2D building shape with an elevation property,
create a real 3D block (with min 6 faces) imitating the building extrusion.
I am able to do this with many polygonZ, but then every building is composed
of N different polygons. I want the whole building to be a unique multipatch
feature.
I am having problems with the Multipatch creation. As an example, I create a
Multipatch composed of 2 triangles in a TriangleFan (a horizontal square
-4points-) and a Ring (a vertical square sharing on of the triangles lines
-5 points-).
NVERTICES = 9;
double[] bX = new double[NVERTICES] { 0, 10, 10, 0, 0, 0,
0, 0, 0 };
double[] bY = new double[NVERTICES] { 0, 0, 10, 10, 0, 10, 10,
0, 0 };
double[] bZ = new double[NVERTICES] { 10, 10, 10, 10, 10, 10, 0,
0, 10 };
double[] bM = new double[NVERTICES] { 5, 5, 5, 5, 5, 5, 5, 5, 5
};
ShapeLib.ShapeType shpType3 = ShapeLib.ShapeType.MultiPatch;
int[] apartStart2 = new int[2] { 0, 4};
ShapeLib.PartType[] apartType2 = new ShapeLib.PartType[2] {
ShapeLib.PartType.TriangleFan, ShapeLib.PartType.Ring};
pshpObj = ShapeLib.SHPCreateObject(shpType3, -1, 2, apartStart2,
apartType2, NVERTICES, bX, bY, bZ, bM);
int j = ShapeLib.SHPRewindObject(hShp, pshpObj);
iRet = ShapeLib.SHPWriteObject(hShp, -1, pshpObj);
ShapeLib.SHPDestroyObject(pshpObj);
The resulting file (the dbf is filled in a different part of the sample
application) is interpreted right by GlobalMapper (a simple GIS package) but
it is not rendered (even when the load launched no errors) by ArcScene.
Any idea why is this?
Thanks a lot
Oscar
PD: This time as subscribed member
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/shapelib/attachments/20100914/6612547a/attachment.htm
More information about the Shapelib
mailing list