t-oster / VisiCut

A userfriendly tool to prepare, save and send Jobs to Lasercutters
https://visicut.org
Other
230 stars 114 forks source link

3D Engraving Overscan in Negative Coordinates Needed #628

Closed McNugget6750 closed 1 year ago

McNugget6750 commented 2 years ago

I'm using 3D engraving and noticed that overscanning does not allow moving into negative coordinate space. This causes issues when engraving close to X0. In many cases this is not an issue, I understand. But almost all machines use arbitrary coordinates that are not necessarily related to the physical limitations of the motion platform anyways. It should be an option to allow negative coordinate space padding / overscanning.

I can implement it but I'd like to as for a pointer to the right location. I assume, I have to go back to convertRasterizableToVectorPart() in LaserCutter.java and see how the min and max values are implemented. It wasn't obvious to me, yet.

McNugget6750 commented 2 years ago

I think I found it: LaserCutter.java 359: preStartX = Math.min(rightLimitPx, Math.max(leftLimitPx, preStartX)); LaserCutter.java 386: postEndX = Math.min(rightLimitPx, Math.max(leftLimitPx, postEndX));

I'll play with that a little bit.

mgmax commented 2 years ago

Currently, this is on purpose to allow for engraving close to the left edge of the laser bed without hitting some mechanical endstop. VisiCut assumes that the laser bed size is the limit of allowed coordinates. For relative positioning you can use right-click -> set start position. It is supported at least on Epilog Laser devices, but I'm not sure if anyone has ever used that feature in real life.

We'd need to add a parameter for the allowed overrun distance to the laser device and consider that in convertRasterizablePartToVectorPart. Feel free to just modify the constant inside the function for first experiments. Even then I'm not sure if some other checks in LibLaserCut will complain if a coordinate is outside of the laser bed.

McNugget6750 commented 2 years ago

If nothing else complains, I should be able to simply adjust the lines above and get into negative space. I thought the hardware limits might be the reason for this. My laser homes and moves a few mm away from home on purpose to allow for this kind of stuff. I also move the head around for different applications and redefine XY=0 there. In that specific case, having no access to negative coordinates is a completely arbitrary limitation.

Once I have it working, I'll add a configuration setting to the GenericGCodeDriver.java so that the allowable negative padding can be specified by the user.

mgmax commented 1 year ago

fixed by https://github.com/t-oster/LibLaserCut/commit/6b6c86d93925018f1d79432e06c5b0ff799a869f