# Subtract of two STL files in Slic3r software

I have a question about Slic3r software.

I would like to subtract two parts. For example, I have an STL model, when I right click on the part, I can select Settings..., and in the Settings window, I can select modifier and I can select slab.with selecting proper thickness. Now we have two parts where one of them is inside of another. My problem is subtracting those two parts.

How can I subtract this part from another?

• I'm not sure what are you asking about. Processing 3d model or positioning it on the build plate. A picture will help us to understand. Jun 18 '18 at 6:35
• If you are asking how to create a new STL which is the union (or intersection) of two items, you probably need to use MeshLab or MeshMixer or other CAD tools. Jun 18 '18 at 15:12
• you can actually do this with tinkercad, by turning one of the imports into a hole. Jun 19 '18 at 7:13
• Slabs are not for subtracting - they allow you to apply different print settings to different parts of a model. If you would like to print only part of your model you need to cut the model in a CAD program. What are you trying to do? Jun 19 '18 at 18:09
• Hi @Mahdi Shakeri. Your question sounds like how do I use cad question. Though you have some specific questions intermixed. I see others are struggling understanding as well. It would help us if you separate out the questions into bullet points, and to show us images of what you are struggling with. Every cad program is different, so the software you are using will help. Also make sure to check out stackoverflow.com/help/how-to-ask as you have some formatting issues as well. Jun 19 '18 at 19:33

Given my limited familiarity with all the CAD tools that exist, I would fall back to something that I know does binary operations on volumes -- openScad.

One can create two objects, one from each of the two STL files, and subtract one from the other. One can also compute intersections, unions, and other operations.

There are probably other programs that also do this, but openScad allows for doing in programmatically, so that once you have it right, you can update the objects without needing to redo the finicky part of the operations.

slic3r may do this, but I haven't seen such features in my multi-year use of slic3r for slicing.

When in doubt, IMO it is better to script something. It is virtually never that I do something only once, especially in 3D printing where rapid prototype leads to rapid change and improvement.

• +1 for OpenSCAD it is definitely the tool to do this; may want to put some example code showing how to load STLs and difference them. Jun 18 '18 at 20:47
• Thank you for your time and detailed explanations.its long time that i know cad and use it every day.my problem with cad is importing and editing STL files.some times you find very good STL files or even OBJ files, but you going to edit it, cad cannot import stl file. i am trying to find another software to edit stl file.for example creating a candle mold from stl file.anyway thanks for your efforts. Jun 23 '18 at 7:01
• With openScad, i do not exit stl files. The stl file defines the object in operScan. Then i add features to the object... drill holes... scale it... add a base... cut out parts i dont want. Editing STL directly is difficult. Adding to and changing a body is openscad is much easier.
– cmm
Jun 24 '18 at 3:16
• This is definitely the way to go. OpenSCAD produces perfect cuts with no guesswork. Meshmixer struggles. High learning curve but perfect results once you figure it out. Simple example: // difference of two STLs in openSCAD\ difference(){\ translate ([-140,-100,0]) //move to position\ import("/path/to/your/stl/file.stl");\ translate ([0,-0.5,52.85]) //move to position\ rotate(a=90, v=[0,1,0]) // rotate around y for example\ import("/path/to/your/cut/cut.stl");\ } Nov 18 '18 at 2:23

I am assuming your trying to perforate, hollow or cut your design in a specific shape that is the same as the inner 3D object or vice versa?

Do this with 3Ds max its just really easy there for such operations.

This is the link on how to use the Boolean tool, Boolean Compound Object

There are other software like magics where this can be done but as you seem to be trying this for the first time. I will suggest only 3Ds max.

• Thank you for your time and detailed explanations.its long time that i know cad and use it every day.my problem with cad is importing and editing STL files.some times you find very good STL files or even OBJ files, but you going to edit it, cad cannot import stl file. i am trying to find another software to edit stl file.for example creating a candle mold from stl file.anyway thanks for your efforts Jun 23 '18 at 7:05
• @MahdiShakeri as much as i know editing STL files is a pain . Please do-not try it as a beginner ever . Its so much easier to just redesign . But if you really want to go down that lane please get a hang of Autodesk 3Ds max its the only software I would vouch for that can even attempt to edit .stl files . Jun 23 '18 at 7:14

Don't try to do it in the slicing program, instead create a new STL that is the difference. The slicing program shouldn't be used to modify STLs.

Plus, this is a pretty quick and easy thing to do. You can do a difference operation using OpenSCAD (as mentioned above) or atomiccompiler.com if you don't want to install new software just for one operation.

If the objects are manifold and has no issues, Blender can perform boolean operations. I would prefer blender over OpenSCAD as OpenSCAD crashes (at least for me) if there are issues with the mesh; over 3DMax because it is free, fast, and smaller to download and works in my choice of operating system.

Import STL files by File, Import, STL. If that option is not enabled: File, User Preferences, Add-ons, search for STL and enable that option.

Simply select the main object with right click, on the right panel find modifiers with wrench icon, click add modifier and select the operation (difference) and the other object. If the result is not satisfying, try Carve in the solver options. If there are problems in the result it is generally because of issues with the STL files. Use a tool fix those issues and try again.

Once you are happy with the result, you can export by selecting your object, going into File, export, STL and select Selected only option so that the negative object will not be merged with the carved result while exporting.

Meshmixer will perform boolean operations between two STL objects faster than OpenSCAD.

Import the primary .stl, append the second .stl: the one you want to take away from the primary. In the Object Browser window select the primary and then hold the Ctrl key down and left click on the second, a window pops up giving you a boolean difference option.