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

[bug] correct errors in mmc2json.m #96

Closed
wants to merge 1 commit into from

Conversation

andreafarina
Copy link
Contributor

Fixes an error in creating the json file when the mesh files (faces_, nodes_, etc) are not in the folder.
Fixes a typo in copying cfg.isnormalized to json.

@@ -96,7 +97,6 @@
Mesh = copycfg(cfg, 'e0', Mesh, 'InitElem');

else
Mesh.MeshID = fname;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreafarina, sorry for the delay. I am at fNIRS conference, and was not able to review this timely.

can you let me know what was the issue when the MeshID is defined here?

when one defines MeshNode and MeshElem, as in the other if-branch, then MeshID is not needed.

here is the source code parsing this part of the JSON input file, specifically, you can see it test if MeshID exists or not in a if() condition, which allows it to be missing

https://github.com/fangq/mmc/blob/v2024.2/src/mmc_utils.c#L1267-L1279

@andreafarina
Copy link
Contributor Author

andreafarina commented Sep 16, 2024 via email

@fangq fangq closed this in 73926c8 Sep 18, 2024
@fangq
Copy link
Owner

fangq commented Sep 18, 2024

@andreafarina, I see the problem. When you call mmc2json(cfg, 'meshid') without .json suffix, the MeshID field is missing. If your meshid ends with '.json', then it stores everything, including node/elem, in a single .json file. In this case, MeshID is not needed.

I committed the updated change in this one: 73926c8

@andreafarina andreafarina deleted the fix-mmc2json branch September 19, 2024 13:59
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.

2 participants