Here is update on my “New Way of 3D Printing “ #1

Mehmet Nizam Saltan
4 min readNov 25, 2022

--

On the first episode, I did mentioned possible advantages of my own 3D printing method, the data needed to make it happen and a bit of G-Codes relatively ineffective working process, which is used by most of the other 3D printers and CNC machines. If you are new to this series, I would definitely recommend you to read that article first so that this article can be understood more clearly.

But you not going to do that, I know :) so I’ll quickly list the possible advantages of my method

  1. Multiple arms (lowers printing speed drastically)
  2. Multiple angle printing (no need for support meshes)
  3. Support wire printing
  4. No need for G-code (machine decides it self)
  5. No size problem, its just an arm and plate
  6. We could integrate machine learning technology in order to achieve maximum efficiency

Beginning of Project

In this process I will use C# and Python for programming and Unity 3D for visualization.

Now let’s list the problems and work on solutions.

  1. Let’s create our own Triangle list by using the vertex points and the triangle list from target mesh, so that we can more easily bridge between Python machine learning and C# and we could get a much cleaner working environment.
  2. Let’s take this data and visualize it, learn about possible problems and work on their solutions.

Getting Data

The first thing I did for these was to create my own Triangle class by taking the data of the target mesh, this class currently holds 4 data (actually10 for the machine), x, y, z positions of the vertices in the triangle as Vector3 and a boolean variable that specifies whether it will be filled or not (I will not work on filling topic yet, but I just wanted to add anyway).

[System.Serializable]
public class Triangle
{
public Vector3 p1;
public Vector3 p2;
public Vector3 p3;
public bool fill;

public Triangle(Vector3 p1, Vector3 p2, Vector3 p3, bool fill)
{
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
this.fill = fill;
}
}

Then I visualized this data with the Debug.Drawline() method in Unity 3D, so we can see a mesh as a vireframe (what a progress ha!).

Now we need to tell the printer the points that need to go, for this I prepared a simple algorithm that states that it should go to 3 points in order from the Triangle list that I created and when finished, should move on to the next element in the list. However, when I visualized this algorithm with the Trail Renderer component, I saw that the printer was constantly printing and therefore outputting a broken product. To solve this, I changed it so that it shouldn’t print when switching to between elements in the list.

private void HandleAnimation()
{
if (!isAnimPlaying || triangles == null) return;

// Stop animation if --
if (_animTriangleIndex == triangles.Count)
{
_animTriangleIndex = 0;
_animPointIndex = 0;
isAnimPlaying = false;
isPrinting = false;
return;
}

// Move to next Triangle element if --
if (_animPointIndex > 3)
{
_animPointIndex = 0;
_animTriangleIndex++;
isPrinting = false;
}

if (_animTriangleIndex == triangles.Count)
{
Debug.Log("Animation finished");
return;
}

var targetPos = _animPointIndex switch
{
0 => triangles[_animTriangleIndex].p1,
1 => triangles[_animTriangleIndex].p2,
2 => triangles[_animTriangleIndex].p3,
3 => triangles[_animTriangleIndex].p1, // First point of new Triangle element
_ => triangles[_animTriangleIndex].p1
};

_animPos = Vector3.MoveTowards(_animPos, targetPos, animSpeed);
if (_animPos == targetPos)
{
if (_animPointIndex == 0) isPrinting = true;

_animPointIndex++;
}

_trailRenderer.emitting = isPrinting;
_trailRenderer.transform.position = _animPos;
Gizmos.DrawSphere(_animPos, .05f);
}

and I got this as a result.

Yes, there are still some problems, for example, because it goes by the order of the Triangle list, many errors can occur. For example, it prints randomly when it should start from the lowest point on the y-axis, and the fill feature is still non-functional, but so far so good.

if you would like to give advise or cover my mistake we could discuss in the comment section (or if you prefer directly via e-mail nizamsaltan@protonmail.com). I’d be happy to answer and get new ideas. Also here is my social media accounts, you could follow for getting updates! Instagram | Youtube

Disclaimer: The code blocks shown here are only added to strength the narration. There is much more code running in the background. The project is currently kept as a Private Repo on Github. To find out the latest status please visit github.com/nizamsaltan

Tschüss!

--

--

Mehmet Nizam Saltan

Hi! I am prep student who have passion about programming, especially in 3D