Skip to content
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

Point ordering issue with plane_slicer #178

Open
InigoMoreno opened this issue Feb 16, 2023 · 9 comments · May be fixed by #215
Open

Point ordering issue with plane_slicer #178

InigoMoreno opened this issue Feb 16, 2023 · 9 comments · May be fixed by #215

Comments

@InigoMoreno
Copy link
Contributor

Hello. I am trying to use noether with complex geometry (such as a cylinder) and I am seeing some issues.

I am running the plane_slicer_rastering_generator_demo.launch with a cylindrical mesh (download link) and getting the following in noether.

image

As you can see, while the points seem to be correct, they seem to be ordered by the x coordinate instead of going around the cyllinder. Can someone help me figure out where to look to try and solve this?

@InigoMoreno
Copy link
Contributor Author

InigoMoreno commented Feb 16, 2023

I changed the parameters so that it only generates one raster to better show the issue.
image

@marip8
Copy link
Member

marip8 commented Feb 16, 2023

What is the behavior that you are expecting from this tool path planner? Are you wanting circular paths that traverse around the perimeter of the cylinder at different heights, or do you want the same type of coverage pattern shown above, just in a different orientation?

@InigoMoreno
Copy link
Contributor Author

I want circular paths that traverse around the perimeter. The piece is a cylinder, so trajectories shown above actually go through the inside of the piece.

@marip8
Copy link
Member

marip8 commented Feb 17, 2023

noether in general was not necessarily designed to handle closed or watertight shapes like this, so I'm not surprised you're seeing this error. Most of the planners are written with the assumption that you're working with a single open flat-ish surface. The reason the paths come out like this is due to the RasterOrganizationModifier which assumes that each line in the tool path segment has a relatively straight line direction (as in a regular planar raster) and attempts to sort the points by their projected distance along that average direction. This is not the case for the cylinder where each tool path segment in the "raster" is actually a circle, hence the behavior you see.

To fix this, we would need to create a new tool path modifier which sorts the points in a tool path segment in a circular fashion based on some criteria (e.g., choose points greedily by distance to previous point, etc.). Then you could apply this new modifier behind the plane slice planner in a tool path planner pipeline to produce the results you are looking for

@InigoMoreno
Copy link
Contributor Author

InigoMoreno commented Mar 6, 2023

@marip8 AFAIK the plane_slicer_rastering_generator_demo.launch does not use the RasterOrganizationModifier (see this section of code). That is why I was wondering were this sorting behaviour could be coming from.

@marip8
Copy link
Member

marip8 commented Mar 6, 2023

AFAIK the plane_slicer_rastering_generator_demo.launch does not use the RasterOrganizationModifier

It actually does. If you dig down deep enough:

This example is a bit convoluted, but that's why the reorganization is happening. Ultimately our goal is to replace tool_path_planner and some other packages with noether_tpp and simplify the examples, but we haven't had time to progress that far yet

@InigoMoreno
Copy link
Contributor Author

Okay, thanks I got a bit lost there. Now I can at least try to modify it myself to suit my needs.

@marip8
Copy link
Member

marip8 commented Mar 7, 2023

Let me know if you need any more clarification or help implementing my suggestion from above if you end up creating a new tool path modifier. I would be happy to review and accept it as a contribution to the repository if don't mind making it open-source

@InigoMoreno
Copy link
Contributor Author

Just commenting out the RasterOrganizationModifier seems to work fine for my use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants