Add JMesh sample files, parsers, fix timing functions, and update benchmark results #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hi @neurolabusc, I added a few mesh files stored in the NeuroJSON/JMesh format, these files are
zlib.jmsh
: JSON/JMesh based mesh file;MeshVertex3
stored in single-precision; bothMeshVertex3
/MeshTri3
are binary data compressed withzlib
(zip) compression, then base64 encodedzlib.bmsh
: binary JSON (BJData) based JMesh file, likezlib.jmsh
, except that data are not base64 encodedraw.min.json
: minimized pure JSON file with array-shapedMeshVertex3
andMeshTri3
raw.bmsh
: same aszlib.bmsh
, except that the binary node/face data are not compressedI also found that the previous elapse time estimation approach (
d.getMilliseconds
) produces wildly varying results from each run. I changed it tod=Date.now()
andDate.now() - d
. This gives stable timing results, and also matches the timing based onconsole.time('mytimer')
andconsole.timeEnd('mytimer')
I added two lightweight parsers
lib/jdata.js
to parse JData annotations in the JSON, andlib/bjdata.js
to parse BJData filesNeither of these have been optimized.
jdata.js
converts an ND array to a numjs object, although I disabled the conversion, so the output areTypedArray
1D vectorsI also produced lzma (ALONE) based JMesh files, although I am not yet able to add the lzma inflation/deflation support in the parser. But you can see from below that the lzma.bmsh can be quite small.