version=11.5.2 # new feature: pmesh BINARY "filename" # BINARY keyword is optional, but recommended for efficiency # # * 4 bytes: P M \1 \0 # * 1 byte: \0 for bigEndian # * 3 bytes: reserved # * 4 bytes: (int) vertexCount # * 4 bytes: (int) polygonCount # * 64 bytes: reserved # * ------------------------------ # * float[vertexCount*3]vertices {x,y,z} # * [polygonCount] polygons # * --each polygon-- # * 4 bytes: (int)nVertices (1,2,3, or 4) # * [4 bytes * nVertices] int[nVertices] # * # * note that there is NO redundant extra vertex in this format # # see little-endian example at http://chemapps.stolaf.edu/jmol/docs/misc/pmesh.bin # and http://chemapps.stolaf.edu/jmol/docs/misc/pmesh.bin.txt for example: a little-endian 000001: <50> <4D> <01> <00> <20> <20> <20> <20> 000009: <03> <00> <00> <00> <01> <00> <00> <00> 000017: <00> <00> <00> <00> <00> <00> <00> <00> 000025: <00> <00> <00> <00> <00> <00> <00> <00> 000033: <00> <00> <00> <00> <00> <00> <00> <00> 000041: <00> <00> <00> <00> <00> <00> <00> <00> 000049: <00> <00> <00> <00> <00> <00> <00> <00> 000057: <00> <00> <00> <00> <00> <00> <00> <00> 000065: <00> <00> <00> <00> <00> <00> <00> <00> 000073: <00> <00> <00> <00> <00> <00> <00> <00> 000081: <00> <00> <80> <3F> <00> <00> <00> <40> 000089: <00> <00> <40> <40> <00> <00> <40> <40> 000097: <00> <00> <00> <40> <00> <00> <80> <3F> 000105: <00> <00> <00> <00> <00> <00> <00> <00> 000113: <00> <00> <80> <3F> <03> <00> <00> <00> 000121: <00> <00> <00> <00> <01> <00> <00> <00> 000129: <02> <00> <00> <00> from VB6: Open "c:\temp\t.bin" For Binary As #1 Dim s64 As String * 64 Dim s8 As String * 8 Dim i As Long Dim f As Single s8 = "PM" & Chr(1) & Chr(0) Put #1, , s8 i = 3: Put #1, , i i = 1: Put #1, , i Put #1, , s64 f = 1: Put #1, , f f = 2: Put #1, , f f = 3: Put #1, , f f = 3: Put #1, , f f = 2: Put #1, , f f = 1: Put #1, , f f = 0: Put #1, , f f = 0: Put #1, , f f = 1: Put #1, , f i = 3: Put #1, , i i = 0: Put #1, , i i = 1: Put #1, , i i = 2: Put #1, , i Close #1