Open Freecad. Upon opening, Freecad will put you in the ‘Start' workspace
First, we will create our variables. All variables I used are in the image located above.
Switch to the ‘Spreadsheet’ workspace, and create a new spreadsheet
Create variables for:
The Length, Width, and Thickness of the name tag, as well as the layer thickness you will be 3D printing it with.
The Diameter, and thickness of the magnet, as well as the tolerance to allow it to fit in the pocket we will create for it.
The border height, border thickness, and fillet radius.
Creating the base of our name tag:
Switch to the ‘Part Design’ workspace and create a new body.
Create a new sketch, along the XY plane.
Within that sketch, draw a rounded rectangle around the origin point. To find this tool click and hold on the rectangle tool to bring up more options. Make sure your rectangle encompasses your origin point.
Next, we want to make our rectangle symmetric around the origin. Since there are no corner points, click on two of the diagonal points in the center of each corner fillet. Next click the origin point, then select the ‘symmetry’ constraint.
To constrain our horizontal distance, click on one endpoint for the vertical lines on each side of the rectangle, then click the ‘constrain horizontal distance’ constraint.
select the ‘Formula Editor’ button (small blue circle) and input [Spreadsheet.Width] to pull our dimensions from our spreadsheet.
Repeat this for the ‘constrain vertical distance’ constraint, using endpoints of the horizontal lines at the top and bottom of the rectangle. input [Spreadsheet.Length] into the ‘Formula Editor’.
To constrain the corner fillets, click on any fillet, and select the ‘Constrain radius’ constraint, using your variable [Spreadsheet.Fillets].
Press the escape key, or click ‘Close’ in the sketch tasks window to return to the ‘part design’ workspace.
With the sketch selected, click the ‘Pad’ button.
In the tasks window, change the pad type to ‘Two dimensions’.
In the ‘length’ box, click on the ‘Formula Editor’ button, and input [Spreadsheet.Thickness - Spreadsheet.LayerHeight].
In the ‘2nd length’ box, enter the ‘Formula Editor’, and input [Spreadsheet.LayerHeight]. Doing it this way will maintain your overall thickness while extending your pad one layer below the XY Plane.
Creating the pocket for the magnet:
First, create a new sketch on the XY Plane.
Since this sketch will be “inside” our current body, to better see where what we are doing you can either:
hide it by clicking on the Pad feature in the Model window and pressing the spacebar (You can make it visible again by repeating this) OR
change the way Freecad renders your objects by going to View → Draw style → Wireframe (You will need to change it back to the ‘As is’ style if you wish to see your model normally.)
Create a circle in your sketch, and use either the ‘Constrain diameter’, or ‘Constrain radius’ constraint. In the formula editor, we will enter:
[Spreadsheet.MagDiameter + Spreadsheet.Tolerance] OR
[(Spreadsheet.MagDiameter + Spreadsheet.Tolerance) / 2] if we use the radius constraint. We want to include our tolerance, as this is a location where a physical part is interacting with our 3D-printed model. Without this, it may not fit.
Exit out of this sketch, and with it selected, click on the ‘Pocket’ tool. (If you hid your Pad feature, now is the time to unhide it).
Enter [Spreadsheet.MagThickness + Spreadsheet.Tolerance] into the ‘Length’ box.
By default, pockets will extend downward. Click the ‘Reversed’ checkbox to extend upward. You will know you did this correctly if the pocket is not extending out the bottom of our name tag.
Creating the border:
Since these features aren't sitting on any of the ‘Origin Planes’ we will use the top face of our body as the sketch plane.
With the top face selected, create a new sketch.
Create a rounded rectangle, and make it symmetrical around the origin.
To get the correct border width, we will have to subtract the border width from each dimension.
for the width, use [Spreadsheet.Width - Spreadsheet.BorderWidth * 2].
for the Length, use [Spreadsheet.Length - Spreadsheet.BorderWidth * 2]. (We need to multiply by 2, to remove that thickness from both sides of the rectangle)
for the Fillets, use [Spreadsheet.Fillet - Spreadsheet.BorderWidth]. (We don't need to multiply it, since we are only constraining a single fillet on a single side)
Use the pocket tool to indent the center section by entering [Spreadsheet.BorderHeight].
Creating the text:
To add the text, switch to the ‘Draft’ workbench.
Here, use the ‘Shape from text’ tool. For now, don't worry about where it's placed.
Enter your name into the ‘String’ box.
Enter [7mm] into the ‘Height’ box. (this may change depending on your font)
Click the […] in ‘Font file’ to select your font from your computer.
Once that is done, click ‘OK’ to finish your ShapeString.
With your ShapeString selected, in the 'Properties' window, click the […] for ‘Map mode’, to change its placement.
Click on the front face of your name tag. This will change the ‘Attachment mode’ to ‘Plane face’ and attach it to that face.
Use the attachment offset below that to reposition your text roughly in the center of the name tag. Then click ‘OK’ to set its placement.
In the model window, drag your ShapeString into your body. Without this, you won't be able to use the Pad tool on it.
Switch back to the ‘Part design’ workspace.
With your ShapeString selected, use the Pad tool, and enter [Spreadsheet.BorderHeight] to make it the same height as the border.
Export and print!
Export your file from Freecad, and select the .stl format.
Open it in PrusaSlicer.
Pick your print settings, material and machine. In this case, we chose to use .2mm layers in our design, so I will select a profile with that layer height.
We now need to tell the printer where to pause for us to drop in the magnet, and swap the material for our text to pop!
Press ‘Slice’ and use the layer slider on the right.
As you drag the slider down, you should see the pocket for the magnet inside our nametag.
Drag the slider to the first layer after the pocket. You should see in the preview that the printer will start to fill in/bridge over the pocket.
In the case of my model, I'll drag the slider down to the 3mm mark/layer #15.
Just to the right of the slider, click the small + button to insert a pause.
Next, drag the slider further up to the first layer where the text is visible, and again, press the + to insert a pause.
These pauses are using the "M600" Gcode. This code is used as a colour change function.
For our first pause, we will just reload the same plastic we're already using.
For the second pause, we will change to another colour so the text stands out.
Some 3D printers do have alternative scripts that will pause the printer without initiating material unloading.