Space lling problem has been one of the most intriguing problems in the domain of manufacturing science and engineering. Several ap- proaches have been applied to solve the problem, ranging from in nite curves (Gospel Curve) to straight line approaches. This paper introduces a new approach of space lling using fractal curves. Fractal curves are de ned as mathematical curves whose shape retains the same general pat- tern of irregularity, regardless of how much magni ed the shape has been considered, basically the shape of a fractal. These curves are widespread in nature and hence using the same, a novel method has been prepared for generating a fractal curve to be implemented in the additive manufac- turing process. 1 Introduction Fractal curves are considered as natural curves and have been utilised till now as a method to understand the complex mechanism of nature. Historically, Benoit Mandelbrot rst introduced the concept of fractal, based on the de nition of Hausdro in 1919 [5]. He rst recognised that many phenomena in nature are not actually solved by Euclidean Geometry and hence require special sets of rules and dimensions to de ne them. Fractal curves also found its way into the computer graphics and image processing segment, where using the same, micro- processing are done and high-power computations are performed. The fractal theory has been employed in di erent manufacturing processes to either under- stand the structural growth/formation or to produce fractal-like components for enhanced product performance [1]. Hence fractal theory does give a greater edge and a di erent angle of perspective for the observation of space- lling as a potential problem to solve. There have been several instances of research *imtanmaydebnath@gmail.com 1 ideas present all over the internet claiming to solve the problem of space- lling in a novel way. Here only those are chosen which has a speci c central idea concerning the space- lling from fractal perspectives. 2 Literature Review In [2], Paul Bourke has developed a space lling algorithm for procedurally generating a range of digital assets including 2 dimensional textures and 2.5- dimensional texture roughness. Here, the authors have tried to present an algo- rithm for space lling and texture generation using fractals. The procedural and iterative properties of this algorithm make it ideal for creating textures and ge- ometry at sucient detail to meet frame rate dictated performance constraints within a gaming engine dependent on the players distance and viewing direction. The implementation of fractal curves has several advantages { the hypothesis has been con rmed by [3]. They have discussed three methods for the imple- mentation of FASS (Space- lling, self-avoiding, simple and self-similar) curve for arbitrary boundaries. They have trimmed the generated fractals along the boundary by CAM package. But the trimmed FASS path seems to be losing its features at those boundary points. They used HFM (Hybrid Fractal Toolpath) which generates the hybrid toolpath, combination of fractal and raster paths. In this paper, the problem has been addressed using similar process as de- scribed in [3]. But [3] proposed the usage of Gospel curve for the lling of the curves and in this paper, the Koch curve method has been used. Koch curve gave the exibility to extend the algorithm vertically and provided the exibility to decide the space to be kept in between, based on the lament material and thickness of the nozzle. This exibility would be advantageous for industries which keep on experimenting with various models of variant complexities. Be- ing of speci c dimension and scale the curve can be extended to any dimension, as per the wish of the user. This paper will show the implementation on 2D plane as well as when the model is considered in a 3D frame. As an extension, in the software produced, there is a section for the generation of G-Code. The program would automatically calculate the generated points in the space and would then convert into an editable code, which can be directly implemented into the 3D Printer or CNC Milling Centre Machine for the process to start. 3 Koch Curve Method The Concept of Koch Curve has been published back in 1904 by the famous Swedish mathematician Fabian Helge von Koch in his article `snow ake curve', generated from an equilateral triangle. Each side is trisected and the centre seg- ment replaced by two sides of a smaller equilateral triangle projecting outward. 2 Figure 1: Koch Snow ake Curve (for n=3) The process is repeated ad in nitum [4]. The method generated by him is based upon the concept of snow akes and they have been de ned mathematically as fractal curves. In this paper, the simplest version of the Koch curve has been used, in the form of a straight line. Figure 1, completely describes the used curve in modelling the implemented form of the curve. It has been observed that if the curve was programmed for higher number of generations then the nozzle of the 3D Printer considers the point to be too close to each other and hence doesn't di erentiate in between the points. This creates a problem in the accuracy of the to-be modelled part. Upon experimentation it has been observed that a generation of 2 (n=2) is sucient for modelling the entire part, of any desired dimension. Figure 1(a) shows the entire geometry of the snow ake that can be mathematically derived from the Koch equation. But it is not required in the following context because as the snow ake reduces in size the control points become inconsistent to the dimensions of the nozzle of the machine. Hence the line algorithm has been chosen here for the same purpose. 3 4 Algorithm In the Koch line algorithm, for 0th generation (n=0), a single line has been considered and using the same as the base all the further applications have been performed. Firstly, the line has been trisected, at points 1/3rd and 2/3rd of the total length of the arbitrary line. The dimension of the line is controllable via the program. In between the points 1/3 and 2/3, an equilateral triangle is placed of edge length 1/3 of the total length of the line. The height of the triangle in x-direction would move up to 0.5 of the total line segment. After the rst iteration, the total number of individual segments would count up to 4. After each generation the total number of individual line segments generated would be guided by the following equation: Where, x is the total number of segments and n is the number of generations we are considering. Computationally, the greater number of generations we are considering the program becomes more expensive. It might be un tting for sys- tems with low graphics and computation power. Hence considering generalised power of computation for all the systems, a generation of 2 has been considered. 4 Figure 2: Algorithm de ning the process of generating the Koch curve From the above algorithm de nition, it is clear that the space complexity of the program is O(n2). The MATLAB implementation of the same has been depicted afterwards. However, in the MATLAB algorithm, the matrix manipu- lation system has been used because of the extensive dimensionality expansion capacity and manipulability. Hence for the same, the matrix rotation and trans- lation methods have been implemented. 5 Figure 3: MATLAB implementation of the above stated algorithm The above code generates the Koch line curve for a given number of genera- tions. Here 2 generations have been considered. So, the total number of line segments that would make up a single Koch line would be 16 in number. 5 Implementation The single line of the Koch curve has been implemented into a space and has been extended till the breadth and height of the model segment in 2D shape. However, there would be chances of self-intersection and hence to stop the same from happening the line has been programmatically corrected where for each iteration in the height-wise direction the program would automatically detect the self-intersecting parts and would remove the extended parts and combine them as a single line. This reduces the obscurity of the nozzle to move in unprecedented directions, causing a hassle. 6 Figure 4: An arbitrary shape augmented into the range of the Koch line curve It is observable that after some point of time, in the extension phase, there has been a decline in the features of the Koch line curve. This causes to an advantage because this ensures the continuity of the product in its dimensions and also can be used to design intricate structures. The task would now be to cut the Koch line segments till the part of the arbitrary shape and align them accordingly such that the program data can be stored and hence can be implemented for the code generation process. As depicted, the model shown here is the intersection of the generated Koch curve and the drawn arbitrary shape. For clari cation the arbitrary shape has been shown in `blue' colour while the Koch curve has been depicted in `red' lines. The cut lines became somewhat discreet and hence needed to be processed. For the same, they were connected to the immediate next line end point thus making the process continuous for the nozzle or the machining centre drill-bit. 7 Figure 5: The 3D Printing stacked over a particular plane 6 G-Code Generation The main function of the program is to generate the printable or editable G- Code which would be available for the direct usage or as per the needs of the users. The G-Code generating segment takes the input of all the generated points in the plane, stored in the RAM of the system. Based on sequencing, the software has been designed to produce the G-Code for each operation precisely. Based on the similar design of the G-Code, a demo model has been prepared. The model contains the exact G-Code generated by the program. Based on the same, the GUI has been designed which would accumulate all the functionalities and would eventually control all the aspects of the program. 7 Output The GUI covers all the aspects of the program and hence adheres to the user e ectiveness. As depicted above, the GUI contains interactive buttons, working 8 Figure 6: The GUI of the depicted program as a control panel. The `Initialize' { button helps in the initialisation of the program. After initialisation, the user would be able to draw in the given space. Since this is the experimental version, hence there has not been any provisions made for the slicing of a 3D geometry for making the entire geometry. After the drawing has been made, the user is supposed to press the `Fractal View' button { which creates the fractal view of the created diagram in the space. After that, dual choice has been given, where the user can use the same program to gen- erate the Milling operations or Additive Manufacturing operations. Provisions have been made for the user to implement their own code and hence the code is stored in an XLS le. 8 Result The following framework has been generated using the CNC Simulator Pro soft- ware and hence using the same, a virtual prototype of the working frame has been prepared. 9 Figure 7: Prototyping in the designed framework 9 Con ict of Interest None Declared. 10