Esri / i3s-spec

This repository hosts the specification for Scene Layers which are containers for arbitrarily large amounts of geographic data. The delivery and persistence model for Scene Layers, referred to as Indexed 3d Scene Layer (I3S) and Scene Layer Package (SLPK) respectively, are specified.
Other
319 stars 85 forks source link

geometry.bin file struct #6

Closed kangweigang closed 7 years ago

kangweigang commented 7 years ago

hello! thans for the brief description of the geometry.bin file, can I know the detail information of the file ?e.g. struct?

chri7928 commented 7 years ago

Hello,

Does this help? https://github.com/Esri/i3s-spec/blob/master/format/Indexed%203d%20Scene%20Layer%20Format%20Specification.md#_6_7

Also, I would recommend downloading and inspecting a SLPK such as this one: https://www.arcgis.com/home/item.html?id=ecb909417e1e4b36b2db9c7de14f3575

Let us know if you need more information.

kangweigang commented 7 years ago

hello, I want to know the struct of the geometry.bin file in the slpk file . e.g.: 1-8 byte is count is a int32.

  header and body.

 thanks。
sreinhard commented 7 years ago

Hello

The layout of the binary format is defined by the defaultGeometrySchema on the service. For example, the default layout we are using is defined as follows:

"defaultGeometrySchema": {
  "geometryType": "triangles",
  "topology": "PerAttributeArray",
  "header": [
    {
      "property": "vertexCount",
      "type": "UInt32"
    },
    {
      "property": "featureCount",
      "type": "UInt32"
    }
  ],
  "ordering": [
    "position",
    "normal",
    "uv0",
    "color"
  ],
  "vertexAttributes": {
    "position": {
      "valueType": "Float32",
      "valuesPerElement": 3
    },
    "normal": {
      "valueType": "Float32",
      "valuesPerElement": 3
    },
    "uv0": {
      "valueType": "Float32",
      "valuesPerElement": 2
    },
    "color": {
      "valueType": "UInt8",
      "valuesPerElement": 4
    }
  },
  "featureAttributeOrder": [
    "id",
    "faceRange"
  ],
  "featureAttributes": {
    "id": {
      "valueType": "UInt64",
      "valuesPerElement": 1
    },
      "faceRange": {
      "valueType": "UInt32",
      "valuesPerElement": 2
    }
  }
}

this corresponds to the following binary layout (in c pseudo struct):

// header
uint32 vertexCount;
uint32 featureCount;

// vertex attributes
float32 position[3 * vertexCount];
float32 normal[3 * vertexCount];
float32 uv0[2 * vertexCount];
uint8 color[4 * vertexCount];

// feature attributes
uint64 id[featureCount];
uint32 faceRange[2 * featureCount];

Please let me know if you need more information.

kangweigang commented 7 years ago

@sreinhard
Thanks for your answer, now I know the struct of the .bin file. I can read it , convert to position and other infomations. Thanks everybody!

CrashedBboy commented 5 years ago

Hi,
I'm wondering those values in the binary file are little-endian or big-endian?

sreinhard commented 5 years ago

@CrashedBboy all binary data is little-endian.