GridSpace / grid-apps

Browser-based Slicer for 3D Printing, CAM, Laser (Kiri:Moto) and mesh editor (Mesh:Tool)
https://grid.space/
MIT License
456 stars 143 forks source link

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

Open Harvie opened 6 years ago

Harvie commented 6 years ago

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:

pjz commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

Good suggestion

jsiddall commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 1 year ago

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