-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
feature: different travel color to distinguish air-cutting and actual-cutting in CNC #183
base: develop
Are you sure you want to change the base?
Conversation
…-cutting in CNC different travel color to distinguish air-cutting and actual-cutting in CNC.
Hello @xuzhen1994 ! Thanks for your PR! 😄 It's great to have better support for CNC! However, defining travel at z <= 0 as cutting is not true in general. Sometimes the z = 0 is defined at the bottom of the stock, sometimes at the top. And for true 3d milling cutting/not-cutting is totally different story. Have you looked at the Otherwise, maybe you can create a function parameter so that you can pass the logic that works for your case:
Here start and end would be the states (x,y,z etc) at the start and end of the line segment. |
Also, could you share a gcode snippet for your case please? |
add isActualCutting option to support user custom actual-cutting logic. add cutting distance calculation includes total-cutting, actual-cutting and air-cutting for a gcode file.
@remcoder Thanks for your suggestion! |
my gcode
|
Hi again! Thanks for the improvements. I think that for both the (non)-cutting color and distance I'm looking for a solution that isn't specific to cnc. At least the default will need to work where cutting doesn't work or is defined differently. Let us know if you can work it out. Also feel free to join the discord to discuss this 🙂 |
add travel duration calculate
hi @xuzhen1994! Nice proposal but we need to keep the library working for other (non-cnc) usecases too. For the color changing (z <= 0) I want to remind you of my proposal to define a function that will decide on the travel color using arbitrary logic. That would be a simple generic solution that I can merge. Furthermore, keeping the stats for cutting don't belong in the webglpreview class. (in fact the class already does too much so we're discussing on discord how to split it up) The best way would be to move the cutting stats to the parser:
Let's do the color change in 1 PR and the stats in another PR. That keeps it simple and moving. |
@xuzhen1994 I have to apologize. My proposal isn't as easy as I thought.. The reason is that the library groups lines into layers because that's useful for 3d printing. Lines within a layer a rendered in a single go and all consecutive travel lines will share a single color. To enable different travel colors, the lines will need to be ungrouped (or not grouped to begin with). I would like to help out with getting this solved. I cannot push to your fork however. Would you be ok with allowing me to do so? |
Thanks for the advice. Apologies, due to work and effort, I can't promise to finish your proposal by a certain time. I have invited you as collaborator, and let me know if you need anything else. |
# Conflicts: # demo/js/demo.js # src/webgl-preview.ts
@xuzhen1994 I added some commits and you can see the different travel colors working. Still very hacky and not mergable. I'll clean it up later to get it mergable but then I have to leave out the statistics part (for reasons mentioned above). |
btw, I already have push access to your branch so I don't need to be added to the repo. I'll decline that invite because it is not needed, thanks anyway. |
I just realized that there could be a 'cnc mode'. We're probably introducing modes for different views and a cnc mode could fit into that scheme. Let's wait far those modes to land first. |
different travel color to distinguish air-cutting and actual-cutting in CNC.