How to Surface the Top of Stock - Meshcam Machining Margin

I have a strange issue with Meshcam. I am trying to just face a block to make the top flat. I haven’t really figured out a good way to just face without worrying about wasting time and machining the perimeter. I just want a flat top. I set my stock size taller and imported a model that is bigger in x and y than my work piece really is. I then tried setting machining margin to 0.

What happened is that when I do this and export my G-Code, meshcam gets the x and y backwards. I confirmed this by verifying my paths in CAMotics. I then set my Machining Margin to something greater than 0 and everything exports just fine. This sounds like a bug to me but perhaps there is a logical explanation?

Use inclusion and/or exclusion regions to ensure that MeshCAM only machines the top and not the sides.

To ensure you get a nice edge, define an area a bit bigger than the real thing. Then the machining will start off the stock and be consistent to the very edge.

I have a CAD model of something like this. I make a pocket that is right depth and define Z0 as the top of stock…

When Carbide Create comes out what you want to do will be trivial - a 2.5D job. According to @WillAdams we’ve only got a week or so to wait!

For the life of me I can’t imagine why the margin of 0 causes X and Y to every be switched. Use 0.000001 and move on. Let them know so it can get fixed.


@mbellon, thank you very much. I’ll let MC know. Thanks for the advice.

@pdg, MeshCAM doesn’t get axes crossed. I can assure you of that. Could you attach your block STL (zipped so the forum will accept it?) I’d like to take an independent look. You can also verify the orientation of the block in MeshCAM by selecting View Above in the View menu. You can also make a test block that is much wider than deep (or vice versa) to make the import orientation obvious.

It could be that your CAD program is exporting the block in a different orientation than you expect. I know that is the case with SolidWorks. X-Y plane is in the plane of the screen so if you make something “upright” in SW it comes out sideways when export as an STL, so I always need to define an export coordinate system so it exports with Z upwards.

But the way to face the top is to make your block the exact size of the stock and specify Machine whole stock with a margin of zero (since MeshCAM always deals with the cutter centerline/axis). I’ve done it more times than I can count… :slight_smile:


@Randy, Well I went back and tried to reproduce this and now it seems to function. I really wish I had not saved over my original files. I will say I am using the mac version and don’t know if that might have anything to do with it. I fought this for over an hour with the same STL model and was not getting it to work until I raised my machining margin…either that or I’m entirely nuts (which is quite possible).

I’ve attached the STL anyway (the short length is the x-axis).
Knife_Scale.stl (684 Bytes)

Learn something new every day! I use an inclusion region and restricted things to the top. Setting the margin is easier.

I loaded the STL in my CAD program and, sure enough, the top wasn’t the top I’m pretty sure you were expecting. I had to tell MeshCAM to select the appropriate face and then it worked as expected.

Mac version here.

Carbide Create will make this much easier and IMHO more obvious.


1 Like

@PDG, Robert has said he develops MeshCAM on a Mac, so I’ll trust that the Mac and Win versions behave the same.

I confirm what @mbellon said, the STL comes in “sideways”. Here is my MeshCAM screenshot of your raw imported STL.

The green vector is the Y axis, the blue vector is the Z axis, and the barely-visible red vector is the X axis.

Does your CAD program have the option for defining the axis orientation when you export an STL? Otherwise, do as Mark says–use the Geometry | Rotate Geometry command and click on the face you want facing upwards. I clicked the “rear” face and got this

which is what I think was your intention.


@Randy, Yes, I did have to rotate the model. I’m using Onshape and unfortunately they don’t allow you to define the axis orientation on export. I’m hoping it is something they add. I almost always have to manipulate my model if it is part of an assembly. If I design a single part then I can control the origin. A bit of a pain, but as of now I’m learning to deal with it.

1 Like

The good news is, you only have to climb the learning curve once for each software. Assuming you use it regularly enough not to forget in the meantime… (nothing that has ever happened to me, I assure you…) :smile:


1 Like