<p>If your talking about a hollow object, such as a cube with a hollow center. The wall thickness is determined by the model.</p>

<p>If your talking about a solid object, the wall thickness is determined by your nozzle diameter multiplied by your # of walls. This is all adjusted by your splicing software. If you have a nozzle of 0.5mm and you print at 3 perimeters, your wall should be 1.5mm. If you want the wall to be 2mm, then you will adjust your perimeters to 4. Everything within those walls will be whatever you choose for infill.</p>

<p>I work with ASP.NET, Windows Forms, and Console Apps myself. I'm sure you can find libraries capable of taking 3D models but I don't think it would matter because the printed thickness is determined by your splicing settings. </p>

<p>Also for cost of printing, I recommend just using Cura which you just have to plug in some cost information about the filament and it will tell you estimated cost, mm of filament usage, and time.</p>

CC BY-SA 3.0
2017-11-08T16:28:47.800Z
That's not wholly true.  Most slicers allow for over- and under-extrusion for walls to allow walls that aren't bound specifically by the diameter of the nozzle you're using.  slic3r, Simplify3D and Cura, at least, all have these options.  I would imagine that you'd want to read the g-code to get specific details since how you slice a model varies, and the model itself is not always a good indicator.
Jesse Williams
CC BY-SA 3.0
2017-11-08T16:40:14.480Z
I use slic3r myself. For my case every wall printed is consistent. I've never noticed a thicker or thinner single wall. They tend to be slightly larger than my 0.4mm nozzle but that is because they get squished alittle. But at 3 perimeters I should get 1.2mm walls but I get about 1.3mm when I measure it.
Athanasios Karagiannis
CC BY-SA 3.0
2017-11-08T16:22:47.997Z
2017-11-08T16:22:47.997Z
Athanasios Karagiannis
<p>I'm not completely sure what you want to do but I will add some information that I think will help and then hopefully you can figure out what you need to know or ask another question.</p>

<p>When you are asking about wall thickness there are two different things you could be referring to. A wall in the model, so you could be talking about trying to print a thin wall coming out of the model. For analysis thin wall setting some slicers will change the extrusion amount to print thicker or thinner lines, and to find those settings you would need to look at the g-code.
Or you could be talking about the shell of the model, the outside surface, and for this you could also analysis in the slicer settings by looking at the number of perimeters the slicer will try and print. </p>

<p>For calculating the cost of the print you will want the amount of material used, this will also be in the g-code file. You can eather calculate this by going through each G1 command and finding out how much filament was extruded for each move the printer made. (Not some slicers reset this to zero after each layer and this gets tricky when the printer starts retracting the filament while traveling).
Or most slicers have a commented out line of g-code at the beginning or end of the file listing how much filament will be used.</p>

<p>If you do analysis the .stl file you also might find that you need to repair the model file as well, Because alot of .stl files are made for 3D graphics and not for printing and so they can have intersecting triangles and not be water tight. </p>

<p>Not all .stl files are the same they can be text or binary files, this is some c# code that will read both formats into a list of the triangles in the file for you.</p>

<pre><code>using System.Numerics.Vectors; 
void Main(){
var facets = readStl(@"C:\stls\teapot.stl");}

public class facet
{
    public Vector3 norm = new Vector3();
    public Vector3 vecA = new Vector3();
    public Vector3 vecB = new Vector3();
    public Vector3 vecC = new Vector3();
    public facet(Vector3 A, Vector3 B, Vector3 C, Vector3 N)
    {
        norm = N;
        vecA = A;
        vecB = B;
        vecC = C;
    }
}/* facet */


public static System.Collections.Generic.List&lt;facet&gt; readStl(string file)
{
    // check if binary or text fomat
    //Console.WriteLine("the middle");
    bool isText;
    System.Collections.Generic.List&lt;facet&gt; facets = new System.Collections.Generic.List&lt;facet&gt;();
    using (System.IO.BinaryReader reader = new System.IO.BinaryReader(System.IO.File.Open(file, System.IO.FileMode.Open)))
    {
        //Console.WriteLine("Checking if binary");
        string fileHeading;
        fileHeading = new string(reader.ReadChars(80));
        if (fileHeading.Contains(@"solid"))
        {
            isText = true;
            //Console.WriteLine("isText true");
        }
        else
        {
            isText = false;
            //Console.WriteLine("isText false");
        }
        if(!isText)
        {
            // process binary file
            Console.WriteLine("Is binary");
            uint numberOfTriangles = reader.ReadUInt32();
            //Debug.Log("Number of Triangles: " + numberOfTriangles.ToString());
            System.Console.WriteLine("Number of Triangles: " + numberOfTriangles.ToString());
            for(int i = 0; i &lt; numberOfTriangles - 1; i++)
            {
                Vector3 normals = new Vector3();
                Vector3 vecA = new Vector3();
                Vector3 vecB = new Vector3();
                Vector3 vecC = new Vector3();
                System.UInt16 byteCount = new System.UInt16();
                normals.X = reader.ReadSingle();
                normals.Y = reader.ReadSingle();
                normals.Z = reader.ReadSingle();
                vecA.X = reader.ReadSingle();
                vecA.Y = reader.ReadSingle();
                vecA.Z = reader.ReadSingle();
                vecB.X = reader.ReadSingle();
                vecB.Y = reader.ReadSingle();
                vecB.Z = reader.ReadSingle();
                vecC.X = reader.ReadSingle();
                vecC.Y = reader.ReadSingle();
                vecC.Z = reader.ReadSingle();
                byteCount = reader.ReadUInt16();
                facets.Add(new facet(vecA, vecB, vecC, normals));
            }
        }
    }
    if (isText)
    {
        // read text format file
        Console.WriteLine("Is text file");
        //Console.WriteLine("reading text file");
        using (System.IO.StreamReader reader = System.IO.File.OpenText(file))
        {
            string line = @"";
            string fileHeader = @"";
            line = reader.ReadLine();
            fileHeader = line.Substring(line.IndexOf("solid") + 5).Trim();
            line = "";
            System.Console.WriteLine(@"file header: " + fileHeader);
            bool endOfFile = true;
            while (endOfFile)
            {
                line = reader.ReadLine();
                if (!reader.EndOfStream)
                {
                    Vector3 normals = new Vector3();
                    Vector3 vecA = new Vector3();
                    Vector3 vecB = new Vector3();
                    Vector3 vecC = new Vector3();
                    string[] nums = line.Replace("facet", "").Replace("normal", "").Trim().Split(' ');
                    normals.X = (float)System.Double.Parse(nums[0], System.Globalization.NumberStyles.Float);
                    normals.Y = (float)System.Double.Parse(nums[1], System.Globalization.NumberStyles.Float);
                    normals.Z = (float)System.Double.Parse(nums[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // outer loop
                    line = reader.ReadLine(); // vertex 
                    string[] vecsA = line.Replace("vertex", "").Trim().Split(' ');
                    vecA.X = (float)System.Double.Parse(vecsA[0], System.Globalization.NumberStyles.Float);
                    vecA.Y = (float)System.Double.Parse(vecsA[1], System.Globalization.NumberStyles.Float);
                    vecA.Z = (float)System.Double.Parse(vecsA[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // vertex 
                    string[] vecsB = line.Replace("vertex", "").Trim().Split(' ');
                    vecB.X = (float)System.Double.Parse(vecsB[0], System.Globalization.NumberStyles.Float);
                    vecB.Y = (float)System.Double.Parse(vecsB[1], System.Globalization.NumberStyles.Float);
                    vecB.Z = (float)System.Double.Parse(vecsB[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // vertex 
                    string[] vecsC = line.Replace("vertex", "").Trim().Split(' ');
                    vecC.X = (float)System.Double.Parse(vecsC[0], System.Globalization.NumberStyles.Float);
                    vecC.Y = (float)System.Double.Parse(vecsC[1], System.Globalization.NumberStyles.Float);
                    vecC.Z = (float)System.Double.Parse(vecsC[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // endloop
                    line = reader.ReadLine(); // endfacet
                    facets.Add(new facet(vecA, vecB, vecC, normals));
                }
                else
                {
                    endOfFile = false;
                }
            }// while loop
            System.Console.WriteLine("finished reading file");
        }
    }
    return facets;
}/* readStl */
</code></pre>

CC BY-SA 3.0
2017-12-12T06:41:35.747Z
2017-12-12T06:41:35.747Z
user802599
<p>If your concern is that the stl file may have walls that are too thin to print on your printer, <a href="https://www.meshmixer.com/" rel="nofollow noreferrer">MeshMixer</a> is a great tool from <a href="https://www.autodesk.com" rel="nofollow noreferrer">Autodesk</a> to help check and fix mesh issues (including wall thickness).  It is free to Makers and Educators.</p>

<p>There are lots of helpful tutorials
Here is one <a href="https://all3dp.com/meshmixer-tutorial/" rel="nofollow noreferrer">https://all3dp.com/meshmixer-tutorial/</a></p>

CC BY-SA 3.0
2017-12-10T19:20:50.187Z
2017-12-10T19:20:50.187Z
markshancock
<p>I have .stl for the 3d printing. And I want to analysis wall thickness of this model before printing. I have no idea about any tools. Can I create any console or wpf app for calculating wall thickness and cost of the printing. 
Please help me.   </p>

CC BY-SA 3.0
2017-12-18T08:52:24.877Z
Hello, yes you can create an app to do wall thickness analysis but how to do it is a programming question not a 3d printing question
Nir
<3d-models>
How to implement wall thickness Analysis for my .net project
user4667380
# How to implement wall thickness Analysis for my .net project

(Asked by: username_0 on 2017-11-08)

I have .stl for the 3d printing. And I want to analysis wall thickness of this model before printing. I have no idea about any tools. Can I create any console or wpf app for calculating wall thickness and cost of the printing.
Please help me.

**Tags:** 3d-models
> **Comments:**
> **username_1**: Hello, yes you can create an app to do wall thickness analysis but how to do it is a programming question not a 3d printing question  

---

## 3 answers

### Answer by username_2 on 2017-11-08. Score: 2

If your talking about a hollow object, such as a cube with a hollow center. The wall thickness is determined by the model.

If your talking about a solid object, the wall thickness is determined by your nozzle diameter multiplied by your # of walls. This is all adjusted by your splicing software. If you have a nozzle of 0.5mm and you print at 3 perimeters, your wall should be 1.5mm. If you want the wall to be 2mm, then you will adjust your perimeters to 4. Everything within those walls will be whatever you choose for infill.

I work with ASP.NET, Windows Forms, and Console Apps myself. I'm sure you can find libraries capable of taking 3D models but I don't think it would matter because the printed thickness is determined by your splicing settings.

Also for cost of printing, I recommend just using Cura which you just have to plug in some cost information about the filament and it will tell you estimated cost, mm of filament usage, and time.

> **Comments:**
> **username_3**: That's not wholly true.  Most slicers allow for over- and under-extrusion for walls to allow walls that aren't bound specifically by the diameter of the nozzle you're using.  slic3r, Simplify3D and Cura, at least, all have these options.  I would imagine that you'd want to read the g-code to get specific details since how you slice a model varies, and the model itself is not always a good indicator.  
> **username_2**: I use slic3r myself. For my case every wall printed is consistent. I've never noticed a thicker or thinner single wall. They tend to be slightly larger than my 0.4mm nozzle but that is because they get squished alittle. But at 3 perimeters I should get 1.2mm walls but I get about 1.3mm when I measure it.  

---

### Answer by username_4 on 2017-12-12. Score: 1

I'm not completely sure what you want to do but I will add some information that I think will help and then hopefully you can figure out what you need to know or ask another question.
When you are asking about wall thickness there are two different things you could be referring to. A wall in the model, so you could be talking about trying to print a thin wall coming out of the model. For analysis thin wall setting some slicers will change the extrusion amount to print thicker or thinner lines, and to find those settings you would need to look at the g-code.
Or you could be talking about the shell of the model, the outside surface, and for this you could also analysis in the slicer settings by looking at the number of perimeters the slicer will try and print. 
For calculating the cost of the print you will want the amount of material used, this will also be in the g-code file. You can eather calculate this by going through each G1 command and finding out how much filament was extruded for each move the printer made. (Not some slicers reset this to zero after each layer and this gets tricky when the printer starts retracting the filament while traveling).
Or most slicers have a commented out line of g-code at the beginning or end of the file listing how much filament will be used.
If you do analysis the .stl file you also might find that you need to repair the model file as well, Because alot of .stl files are made for 3D graphics and not for printing and so they can have intersecting triangles and not be water tight. 
Not all .stl files are the same they can be text or binary files, this is some c# code that will read both formats into a list of the triangles in the file for you.
using System.Numerics.Vectors; 
void Main(){
var facets = readStl(@"C:\stls\teapot.stl");}

public class facet
{
    public Vector3 norm = new Vector3();
    public Vector3 vecA = new Vector3();
    public Vector3 vecB = new Vector3();
    public Vector3 vecC = new Vector3();
    public facet(Vector3 A, Vector3 B, Vector3 C, Vector3 N)
    {
        norm = N;
        vecA = A;
        vecB = B;
        vecC = C;
    }
}/* facet */


public static System.Collections.Generic.List readStl(string file)
{
    // check if binary or text fomat
    //Console.WriteLine("the middle");
    bool isText;
    System.Collections.Generic.List facets = new System.Collections.Generic.List();
    using (System.IO.BinaryReader reader = new System.IO.BinaryReader(System.IO.File.Open(file, System.IO.FileMode.Open)))
    {
        //Console.WriteLine("Checking if binary");
        string fileHeading;
        fileHeading = new string(reader.ReadChars(80));
        if (fileHeading.Contains(@"solid"))
        {
            isText = true;
            //Console.WriteLine("isText true");
        }
        else
        {
            isText = false;
            //Console.WriteLine("isText false");
        }
        if(!isText)
        {
            // process binary file
            Console.WriteLine("Is binary");
            uint numberOfTriangles = reader.ReadUInt32();
            //Debug.Log("Number of Triangles: " + numberOfTriangles.ToString());
            System.Console.WriteLine("Number of Triangles: " + numberOfTriangles.ToString());
            for(int i = 0; i < numberOfTriangles - 1; i++)
            {
                Vector3 normals = new Vector3();
                Vector3 vecA = new Vector3();
                Vector3 vecB = new Vector3();
                Vector3 vecC = new Vector3();
                System.UInt16 byteCount = new System.UInt16();
                normals.X = reader.ReadSingle();
                normals.Y = reader.ReadSingle();
                normals.Z = reader.ReadSingle();
                vecA.X = reader.ReadSingle();
                vecA.Y = reader.ReadSingle();
                vecA.Z = reader.ReadSingle();
                vecB.X = reader.ReadSingle();
                vecB.Y = reader.ReadSingle();
                vecB.Z = reader.ReadSingle();
                vecC.X = reader.ReadSingle();
                vecC.Y = reader.ReadSingle();
                vecC.Z = reader.ReadSingle();
                byteCount = reader.ReadUInt16();
                facets.Add(new facet(vecA, vecB, vecC, normals));
            }
        }
    }
    if (isText)
    {
        // read text format file
        Console.WriteLine("Is text file");
        //Console.WriteLine("reading text file");
        using (System.IO.StreamReader reader = System.IO.File.OpenText(file))
        {
            string line = @"";
            string fileHeader = @"";
            line = reader.ReadLine();
            fileHeader = line.Substring(line.IndexOf("solid") + 5).Trim();
            line = "";
            System.Console.WriteLine(@"file header: " + fileHeader);
            bool endOfFile = true;
            while (endOfFile)
            {
                line = reader.ReadLine();
                if (!reader.EndOfStream)
                {
                    Vector3 normals = new Vector3();
                    Vector3 vecA = new Vector3();
                    Vector3 vecB = new Vector3();
                    Vector3 vecC = new Vector3();
                    string[] nums = line.Replace("facet", "").Replace("normal", "").Trim().Split(' ');
                    normals.X = (float)System.Double.Parse(nums[0], System.Globalization.NumberStyles.Float);
                    normals.Y = (float)System.Double.Parse(nums[1], System.Globalization.NumberStyles.Float);
                    normals.Z = (float)System.Double.Parse(nums[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // outer loop
                    line = reader.ReadLine(); // vertex 
                    string[] vecsA = line.Replace("vertex", "").Trim().Split(' ');
                    vecA.X = (float)System.Double.Parse(vecsA[0], System.Globalization.NumberStyles.Float);
                    vecA.Y = (float)System.Double.Parse(vecsA[1], System.Globalization.NumberStyles.Float);
                    vecA.Z = (float)System.Double.Parse(vecsA[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // vertex 
                    string[] vecsB = line.Replace("vertex", "").Trim().Split(' ');
                    vecB.X = (float)System.Double.Parse(vecsB[0], System.Globalization.NumberStyles.Float);
                    vecB.Y = (float)System.Double.Parse(vecsB[1], System.Globalization.NumberStyles.Float);
                    vecB.Z = (float)System.Double.Parse(vecsB[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // vertex 
                    string[] vecsC = line.Replace("vertex", "").Trim().Split(' ');
                    vecC.X = (float)System.Double.Parse(vecsC[0], System.Globalization.NumberStyles.Float);
                    vecC.Y = (float)System.Double.Parse(vecsC[1], System.Globalization.NumberStyles.Float);
                    vecC.Z = (float)System.Double.Parse(vecsC[2], System.Globalization.NumberStyles.Float);
                    line = "";
                    line = reader.ReadLine(); // endloop
                    line = reader.ReadLine(); // endfacet
                    facets.Add(new facet(vecA, vecB, vecC, normals));
                }
                else
                {
                    endOfFile = false;
                }
            }// while loop
            System.Console.WriteLine("finished reading file");
        }
    }
    return facets;
}/* readStl */


---

### Answer by username_5 on 2017-12-10. Score: 1

If your concern is that the stl file may have walls that are too thin to print on your printer, [MeshMixer](https://www.meshmixer.com/) is a great tool from [Autodesk](https://www.autodesk.com) to help check and fix mesh issues (including wall thickness). It is free to Makers and Educators.

There are lots of helpful tutorials
Here is one <https://all3dp.com/meshmixer-tutorial/>


---

