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

Allow to locate g-code origin (zero) to any place of model #28

Open
Harvie opened this issue Mar 27, 2018 · 8 comments
Open

Allow to locate g-code origin (zero) to any place of model #28

Harvie opened this issue Mar 27, 2018 · 8 comments
Labels
cnc CNC / CAM mode enhancement

Comments

@Harvie
Copy link

Harvie commented Mar 27, 2018

It's not possible to set g-code origin to selected feature of model. For example if i want to place the zero to the highlighted point:

image

This is useful as hell when milling new features on preexisting part (eg. "pocket only" operation). It's not always practical to use part corner or center as origin. This is very different from 3d printing, where you just need to hit somewhere on the heatbed and doesn't really matter if you are perfectly centered.

Let's break it down:

  • First useful step would be to indicate where the g-code zero point will be in arrange and preview modes. Origin point is alpha and omega of g-code, please display it.
  • Real killer feature would be to allow use coordinate origin of the STL model. Just simple checkbox ["preserve model origin"] that would take zero from STL file without moving it to corner or center like kiri does right now. This feature alone would allow me to set zero in CAD and don't have to move it in kiri:moto. This is how i usualy handle my origin in 2D CAD/CAM process. I already know where the origin is when i am making the drawing, so all i want from CAM is to leave it as it is. Only problematic part about this is how you will handle multiple imports or clones. You can use first imported origin, let user select one of the models to take origin from or even disable this feature completely in that case. (it's probably not that useful when milling multiple STL files at once...)
  • Next step would be to allow to move it to any corner or edge of bounding box
  • Then it would help to allow origin to be moved to any place by manualy entering/jogging the coordinate numbers (while having live preview). This is useful in cases when you want origin to lay far outside of the model.
  • Final step would be to allow moving origin by simply clicking on model feature. STLs are made of triangles, so it might make sense to show wireframe of these triangles and set the g-code origin by clicking on corner vertex of one of these triangles.
@pjz
Copy link

pjz commented Mar 29, 2018

From a 2.5D CAM perspective, I'd also like to be able to set the origin to 'front left' (meaning -x, -y), so if I build a cut sheet I can zero it at the front left corner.

@stewartoallen
Copy link
Contributor

If you uncheck "origin center" under "stock" or in the machine profile, front (toward you) left becomes 0,0. I think that's exactly what you want. When you do not define a stock size, it uses the front/lower left of the STL as origin.

@sloanthrasher
Copy link

Indicating the location of the starting position in the Preview view would be very useful as well, maybe as a red X or red vertical bar.

@stewartoallen
Copy link
Contributor

Good suggestion

@jsiddall
Copy link
Contributor

jsiddall commented Dec 8, 2020

Reviving this old issue: so if I understand it correctly, with "origin center" it makes the origin the center of the stock, and if you disable that you get the front/lower corner (presumably lowest X and Y values). That's great, but is there no way to use the origin in the CAD file? In general, I build my drawing with the origin where I want the CNC origin and my preference would just be for KM to just use that by default. I guess this is what Harvie said:

"Real killer feature would be to allow use coordinate origin of the STL model. Just simple checkbox ["preserve model origin"] that would take zero from STL file"

If that is not possible today then I want to vote for that option

The other comment about showing the origin would be nice but no a high priority item for me

@stewartoallen
Copy link
Contributor

I'll look into this. There are some subtle issues like multiple parts, rotation, and scaling. Also, it may be possible to preserve the X,Y origin but Z needs to float to accommodate stock and other settings that affect Z coordinates.

@jsiddall
Copy link
Contributor

jsiddall commented Dec 8, 2020

Thanks for looking into this. It sounds like a trivial thing, but it almost put me off using KM altogether the first time I tried it. Glad I didn't give up that easily!

There are some subtle issues like multiple parts, rotation, and scaling

Sure, that makes sense. Really, you could only preserve the model origin on the first part, but I am fine with that. I guess a better name for the feature would be "preserve model origin if possible". Regarding the Z, again, I usually put the Z0 at some place where I can readily home the tool. That is usually, but not always, the max Z. If there was some concern about collisions or other things that would make KM want to reset the Z origin to something else, I am actually OK with that. I would just like to have KM tell me somehow where it put the actual Z0 compared to the model so I could enter that value as the new origin in my controller after homing my CNC using the origin I chose for the model.

EDIT: one more thing, instead of having a checkbox like Harvie proposed to use model origin, I would rather have that be the default if something that moved the origin somewhere else (ex: origin center) wasn't selected

@stewartoallen stewartoallen added the cnc CNC / CAM mode label May 4, 2021
@stewartoallen
Copy link
Contributor

stewartoallen commented Jan 15, 2023

commit b657f66 allows manual entry of XYZ offsets. an upcoming feature will allow you to get coordinates off of model vertices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cnc CNC / CAM mode enhancement
Projects
None yet
Development

No branches or pull requests

5 participants