-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Facet Subdivision #20
Comments
If I understand correctly, you are trying to calculate the convex hull, right? Just note that it is a very heavy operation and could take a long time. Alternatively, you can get a pretty nice approximation using an octree or kd-tree |
Not the Convex Hull no, I will be passing the facet vertices to a ray
|
Ah, yes... I see your point. It's more like a ray tracer in that case... I would recommend the octree/kd-tree approach in that case, I've written something like that before in C++ https://github.com/WoLpH/computer_graphics It's not too difficult to write but it takes quite a bit of time. (oops, wrong button there) |
I think i'm going about this the wrong way. I can access the facet points through either mesh.mesh.vectors or mesh.mesh.points, but when I have calculated the six new triangles to replace the single facet which is to large, how do I remove the existing facet, then add new ones on? I assumed that pop() would work but it isn't an included method. Is the most robust way to alter the facets of an object to take the mesh.Mesh.vectors, and alter that array and add the new vertices to that, then pass it back in as data['vectors'] as shown in your modifying mesh objects example? |
The basic data store within the mesh objects is the |
Ok thank you, I had come to that to conclusion, will it calculate the normals and areas for the new mesh object automatically? |
When you create a mesh object it automatically takes care of the normals: https://github.com/WoLpH/numpy-stl/blob/master/stl/base.py#L154-L155 The areas isn't updated automatically but can be updated through the update_areas function: https://github.com/WoLpH/numpy-stl/blob/master/stl/base.py#L204 |
Well, that indeed looks a tad broken, I can't really tell you what the problem is straight up but I see at least 1 small error in the code. You're not calling |
I have found the problem with the code, the algorithm I was using for generating the central point was returning NaN instead of the coordinates in many circumstances, and this has been fixed now. |
Hello, I am looking at numpy-stl to use in to import stl files for a python based geometrical optics model and I need a way to set a maximum facet area. I had assumed a median subdivision algorithm was the best way to go but do you have any advice on the most efficient way to implement it? I'm still working out the structure for adding and removing facets.
The text was updated successfully, but these errors were encountered: