-
Notifications
You must be signed in to change notification settings - Fork 24
Obj format output in reconstruction, and normals outputting for obj format #29
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
Obj format output in reconstruction, and normals outputting for obj format #29
Conversation
and also outputs normals if they exist in the point attribute data
|
Thanks! I think I would prefer to put the match on the file extension somewhere else, similar to how the |
|
OK, I'll hopefully have a look at this tomorrow. I'd been coding for quite a bit by the time I needed to add this in, so didnt give too much thought the the architecture :D |
|
Small commit added to output normals indices on the face elements |
1863943 to
0eda4fb
Compare
|
If you have some time, I think this is the code structure you are looking for, but there is a problem with what write_vtk expects to be sent.... there may be some hackery to convert the MeshWithData into an Into<DataSet>, but I'm struggling with it. This latest commit doesnt compile, the error is here: Thanks |
|
Actually If you copy these trait bounds to the pub fn write_mesh<'a, R: Real, MeshT: Mesh3d<R>, P: AsRef<Path>>(
mesh: &'a MeshWithData<R, MeshT>,
output_file: P,
_format_params: &OutputFormatParameters,
) -> Result<(), anyhow::Error>
where
&'a MeshWithData<R, MeshT>: Into<DataSet>Did you check that the obj files with normals are correct and can be read by other tools? |
|
I have tested the normals (my code was originally broken, but it is fixed now, & I will double check) |
0f932c6 to
20e14d6
Compare
|
Thanks for the help. I have made those changes, they compiled fine. I have tested the output, but I shall do so again with an example from splashsurf (I was symlinking to the splashsurf binary, not 100% sure i was using the right binary). |
|
I am getting some corrupted files on large data sets, with many files. I think this is unrelated to this change (I believe the files were rsynced from the server before the files were fully written). I'll get to the bottom of it and let yout know. Would you accept some integration tests with obj-rs? |
|
OK, no more corrupted files, it was an rsync problem. I'll look into adding some tests to make sure the output is good. |
|
Sounds great! Not sure what your plan is, but maybe you can manually construct a simple mesh in the test for reference. This way we don't have to rely on a reconstruction giving identical results. |
|
Ah, missed your comment with obj-rs. Yeah, you can add it as a dev dependency. Do you want to make a round trip test, like storing with splashsurf, loading with obj-rs and then comparing? |
|
OK, I'll have a look at it. I was thinking to go through obj-rs, but perhaps just some simple tests running through the convert command to start with. |
|
OK, adding the tests is harder than I initially thought (unless I put it somewhere stupid). Makes sense to either: Which of these would you prefer? I also have a small update #30, to make it handle more formats a bit easier. If that looks ok to you, I will rebase off master when you merge it. |
|
Or perhaps merge this, and the io restructure, and I will add in the tests in a new PR. Cheers |
|
Yes, the current situation with the IO is a bit annoying for me as well for some tests in It would be possible to move the IO stuff to In any case this should be part of a different PR or I can take a look at this myself after deciding how to refactor this. However, for the current situation and this specific test couldn't you just put it somewhere in |
|
Sounds like a good idea. I'll put it in splashsurf for now. |
|
Hrm, this presents issues as well. It's not trivial ATM to pull in from an obj or ply file (it would be just as easy to add it to the convert command... I may perhaps just create the mesh entities directly, but that is not exactly trivial either. Gotta drop this today. If you have a better idea for this, let me know. Cheers |
|
I've added support for importing meshes from ply files, here: #31. This will make it possible to test outputting obj file from a simple ply file. I'll add tests once you've merged that PR (hopefully :D) |
|
I'll merge this for now, we can add tests a bit later. |
This adds obj files as a supported format from reconstruction, and enables normals output if requested.
Still need to add docs updates, and I have not tested this thoroughly, so apologies if there are mistakes.
Thanks