Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JMesh sample files, parsers, fix timing functions, and update benchmark results #1

Merged
merged 6 commits into from Mar 28, 2022

Conversation

fangq
Copy link
Contributor

@fangq fangq commented Mar 28, 2022

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; both MeshVertex3/MeshTri3 are binary data compressed with zlib(zip) compression, then base64 encoded
  • zlib.bmsh : binary JSON (BJData) based JMesh file, like zlib.jmsh, except that data are not base64 encoded
  • raw.min.json : minimized pure JSON file with array-shaped MeshVertex3 and MeshTri3
  • raw.bmsh : same as zlib.bmsh, except that the binary node/face data are not compressed

I also found that the previous elapse time estimation approach (d.getMilliseconds) produces wildly varying results from each run. I changed it to d=Date.now() and Date.now() - d. This gives stable timing results, and also matches the timing based on console.time('mytimer') and console.timeEnd('mytimer')

I added two lightweight parsers

  • lib/jdata.js to parse JData annotations in the JSON, and
  • lib/bjdata.js to parse BJData files

Neither of these have been optimized. jdata.js converts an ND array to a numjs object, although I disabled the conversion, so the output are TypedArray 1D vectors

I 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.

-rw-rw-r-- 1 fangq fangq  2295259 Mar 27 22:34 lzma.bmsh
-rw-rw-r-- 1 fangq fangq  3102700 Mar 27 22:33 lzma.jmsh

@neurolabusc neurolabusc merged commit 51e1e27 into neurolabusc:main Mar 28, 2022
neurolabusc pushed a commit that referenced this pull request Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants