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
simplify the Graphics3d object of polyhedra #22144
Comments
New commits:
|
Branch: u/chapoton/22144 |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:9
could you please try
it works for me. The second line isolate the IndexFaceSet from other bells and whistles (plot of edges and vertices) useful: https://threejs.org/editor/ |
comment:10
I tried your example. For me, the second line still was a However,
And then, I can call the
It will again fail, but for a different reason - the faces are not triangles. [Edit] By the way, I was testing on the develop branch checked out from the github repository. |
comment:11
well, of course (but I should have said that), I meant "try with the branch applied" |
comment:12
Replying to @fchapoton:
Oh, my fault. OK, after switching branches it did worked. Coool!!! The text file looks fine and I verified that after import to Blender that there were not duplicated vertices and the normals are consistent. |
comment:13
Please, can you explain at what point the truncated octahedron faces are triangulated in this example? It seems to me that you do it very early in the workflow, somewhere inside the |
Blender screenshot showing inconsistent normals on the exported stl. |
comment:14
Attachment: blender_wrong_normals.png Sorry, it seems I overlooked some inconsistently oriented normals on the first test. You can see after importing the |
comment:15
sorry, I was not available this morning, I should be there after lunch yes, there is an issue about orientation of faces, that needs to be investigated. |
comment:17
could you please try again with the new branch ? |
Blender screenshot showing that normals are not yet consistently pointing outwards. |
comment:18
Attachment: blender-still-wrong-normals.png The export to |
Blender screenshot of consistent normals pointing outwards. |
comment:24
Attachment: blender-consistent-normals.png Ok, I see now that I was not looking at the good file. I looked at the old version of the The version generated with the new code has consistent normals pointing outwards. congrats, so how did you got it ? |
comment:25
ok, good. I just reversed the list the vertices when needed. You can look at my latest commit by clicking on the link "commits" besides the name of the branch near the top of this page |
This comment has been minimized.
This comment has been minimized.
comment:27
Oh, thank you ! Actually, the link (commits) disappear when the site auto-updates with new inputs to the ticket's discussion (at least on this computer). Updating the site in the browser solves this issue. |
comment:28
How do you know that the (cf. |
comment:29
Well, I assumed that the facet_equations are coming from the defining inequations of the polytope, so must be all coherent. It was either everybody inwards or everybody outwards, so I tried < 0 and it works. |
comment:30
So you think it will be always everybody outwards ? I was also thinking that this method will not translate easily to polyhedra that are not convex polytopes. But I am not even sure whether you can define those in Sage... and anyway, if it is possible to have, let say, a genus 1 polyhedron, it would be a different question and a different ticket. |
comment:31
Well, I have not checked this, really, I admit. The idea is that inequalities are always stored as "vector . (?,?,?) + scalar >= 0". So taking the vector part of a facet should give the same normal in a coherent way, unless somebody somewhere has decided to change signs for some strange reason. I have launched my patchbot to check that no doctest is broken anywhere else in sage. Maybe you should check that some of the examples in Polyhedron? still plot as expected. In particular for open polyhedra, cones, etc. A priori, there should be no problem, but it's better to check a little bit. |
comment:32
Ok, I'll do that. I have one more question, I cannot figure out in the code where do you actually triangulate the polyhedron's faces. I am worried about it because I am interested in both |
comment:33
the chopping into triangles is done in the commit trac 22144 enhance stl ouput (for polyhedra in particular) and happens inside the stl string method, so will not affect other file format exports. you can see the context by clicking on the commit and then enlarging the value of "context" in the little menu "diff options" on the right |
comment:34
by the way, the better normals for facets should also have enhanced the obj output.. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:36
I went trough all of the examples in None of those examples could export to
and many others. Those who do not work, have options added (other than
|
comment:37
No, I was just meaning to check the displayed plots. Thanks for doing that. Your job as a reviewer, if you accept it:
This should be an easy review, I think. If you have more questions or suggestions, I am all ears. Once you are satisfied, set to positive review and put your name in the reviewer field at top of the page. I also think one could keep further enhancements to later tickets. |
Changed keywords from none to days82 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:40
There is one test
that fails.
I looked through the example, and exported the stl in this precise example. It works, and normal are consistent, so maybe you should change the expected result accordingly in the doc. |
comment:41
yes, done already |
Reviewer: Alba Málaga |
comment:42
Good job! All tests passed on my computer and the documentation looks good. |
comment:43
a sequel in #22196, to use the much more efficient binary STL format instead |
Changed branch from u/chapoton/22144 to |
Currently, every face is in its own IndexFaceSet.
One can use one IndexFaceSet for all the faces together.
Also enhance the STL ouput by cutting no-triangular faces into triangles.
and make sure that all faces are oriented outwards.
This may also help simplify further the PLY export later.
CC: @ohanar @kcrisman @nilesjohnson @VivianePons @sagetrac-ams
Component: graphics
Keywords: days82
Author: Frédéric Chapoton
Branch/Commit:
ed1815a
Reviewer: Alba Málaga
Issue created by migration from https://trac.sagemath.org/ticket/22144
The text was updated successfully, but these errors were encountered: