-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Support for color PLY format #412
Comments
Hi, |
Yes, absolutely! Take a look at VRMLVisitor (https://github.com/OpenChemistry/avogadrolibs/blob/master/avogadro/rendering/vrmlvisitor.cpp) And then the "extension" part that adds a command is here: https://github.com/OpenChemistry/avogadrolibs/tree/master/avogadro/qtplugins/vrml |
For spheres, I've found a couple of different methods for how they could be written as meshes. Obviously no methods will be 100% accurate, so I'm wondering what you all think the best option would be since I don't have the context of the rest of the project. I found this great website that gives visual demonstrations of the different types (https://www.danielsieger.com/blog/2021/03/27/generating-spheres.html), I'm thinking either the UV or the Icosphere? For cylinders, it's similar with multiple methods that can be used, although each method is more similar. Essentially the circumference of the cylinder is just divided into equal latitudes, and the top/bottom faces are either implemented radially or connecting the edges. I also can just implement multiple of these methods and just have a different visitor variable that chooses the methods/division amount/etc. |
For spheres, in Avo1 we used the icosphere (e.g., https://github.com/cryos/avogadro/blob/master/libavogadro/src/sphere_p.cpp) I've also seen use of the Fibonacci sphere method (e.g., in Python) I think either the icosphere or Fibonacci sphere would produce good results. I would suggest implementing one method first (maybe icosphere) and then if everything is working, you can add the visitor options for other methods. For what it's worth, the cylinder code for Avo1 is here: |
I have created a pull request with the completed functionality at #1177. I tested the build with these changes and it all seems to work! |
While Avo2 currently supports writing to POV-Ray and VRML formats, it would be great to support writing to the more common PLY format:
http://paulbourke.net/dataformats/ply/
The key component would be to enable writing spheres and cylinders as vertex / face meshes rather than a sphere or cylinder primitive.
The text was updated successfully, but these errors were encountered: