-
Notifications
You must be signed in to change notification settings - Fork 49
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
Unable to generate half edge for simple example #150
Comments
Can you verify that your mesh doesn't have duplicate vertices as the error suggests? |
Hey, Can confirm that there are no duplicate vertices or faces
I used the following code to generate the mesh message / check for duplicates, where
I'm also getting the same error when the list of faces passed is a subset (see #149) therefore I think the issues are one and the same |
Comparing floats for equality is generally not a good idea because the last few decimal places of two floats that should be the same are usually slightly different. Instead you should check that the difference between the two floating point numbers is less than the machine epsilon: if(abs(p1.x - p2.x) < std::numeric_limits<float>::epsilon() ... ) Give this change a try and share the result. I'm not sure you'll necessarily see anything different, but we can make sure we're doing the correct check. I looked at your meshes (half sphere and selection from #149), and they don't seem to have any visible issues. I'm not sure this is the same issue as #149 because you've encountered two different issues with two different planners. The issue here is that the planner was not able to identify any edges in the mesh that was provided and therefore unable to generate a tool path. The issue in #149 is that it cannot find/generate vertex normals for the mesh that was provided in order to generate a tool path |
@marip8 asked me to take a look at this issue. I'll inspect the mesh to see if I can determine a direct answer to your problem. However, your code to check for duplicate faces is not quite correct, at least in terms of a half-edge mesh. In a half-edge mesh, an edge is a half-edge if there is only one triangle that connects two points. i.e. points A and B may each individually be part of several triangles, but there is only one triangle which contains both of them. If two (or more) triangles contain both A and B, then that is now a full edge.
This code checks for completely identical triangles (1-2-3 and 1-2-3), but fails to check for permutations (1-2-3 and 2-1-3). Since any two faces that both contain two vertices will prevent a half-edge from forming and being returned, you should check for all six permutations: 1-2-3, 2-3-1, 3-1-2, 3-2-1, 2-1-3, 1-3-2. I will download and inspect your mesh. |
Thanks both. I'll make the changes to the duplicate checking code and let you know the results. |
Same results after making the above changes to the code
@marip8 I still think #149 may be the same issue as, although the output warns about the normals, it still manages to generate the surface paths fine. It's when running the edge path generator afterwards (as that code uses both planners in sequence) that the code fails. i.e.
|
Hey both. Any progress with this? As a workaround I'm planning to implement a custom edge finder using straight lines between the ends of a plane slicer output, which should work fine for our use case. It'd be nice to have something more robust working though! |
@marip8 @DavidMerzJr |
Something that helped me is changing the min_num_points on the config. If you run the halfedge demo, it will use the default values from the HalgEdgeGenerator::Config noether/tool_path_planner/include/tool_path_planner/halfedge_edge_generator.h Lines 48 to 69 in e0b5b17
You can change this by updating the code of the demo: Change theese lines) to noether_msgs::ToolPathConfig config_msg;
config_msg.type = noether_msgs::ToolPathConfig::HALFEDGE_EDGE_GENERATOR;
tool_path_planner::HalfedgeEdgeGenerator::Config config;
config.min_num_points = 0;
tool_path_planner::toHalfedgeConfigMsg(config_msg.halfedge_generator, config);
goal.path_configs.push_back(config_msg); |
Hi,
I'm trying to run the halfedge demo over a custom half-sphere mesh. Below is the output I'm receiving:
The mesh in question can be found here: https://filebin.net/tkj0q0tni9oc0gpt
I'd much appreciate any help!
The text was updated successfully, but these errors were encountered: