My process for printing parts is to save my gcode files to an SD card and then insert the SD card into my printers SD card slot. This slicer software outputs a gcode file which is read by the 3D printer to perform the actions to print the model. Slicer software is used for “slicing” the model into the layers to be printed by a 3D printer. The slicer software that I use is called Simplif圓D. In this section I’m going to describe the process I used to print, touch-up, and paint the shape. dtype )) for i, f in enumerate ( faces ): for j in range ( 3 ): shape. Import numpy as np from stl import mesh vertices = np. The right-hand rule is used to define triangle faces for STL files.īelow is the faces array after repeating this process for every triangle making up the shape. From steps one and two I can conclude that the first face I need to add to the faces array is.In the vertices array, I can see that (0,0,1) is at index 0, (1,1,1) is at index 2, and (0,1,1) is at index 1.Looking at the image, I can see that the points are (0,0,1), (1,1,1), and (0,1,1) in counter-clockwise order.Now, let’s follow these steps to define the first face which is highlighted in blue in the image below: Add this list of vertex indices to the faces array.Translate the points into indices in the vertices array (defined above).Identify the points of the triangle and arrange them in a counter-clockwise order.Here are the steps for defining a triangle face in the model: This simply means that triangles should be defined with their coordinates ordered counter-clockwise to make sure that the face of the triangle is pointing outward. STL files require all faces to be defined as triangles using the right hand rule to define the normal. First I imported all of the necessary Python libraries. Now that I have confirmed the example worked, I can start trying to generate the figure from the paper. Importing the example cube into my slicer, Simplif圓D. In the gif below, I import the STL file into my slicer, and as you can see, it appears as expected. Running the file generates the STL file “cube.stl”. I saved this example code into a file called generate_cube.py. vectors = vertices ,:] # Write the mesh to file "cube.stl" dtype )) for i, f in enumerate ( faces ): for j in range ( 3 ): cube. ,, ,, ,, , ]) # Define the 12 triangles composing the cube Import numpy as np from stl import mesh # Define the 8 vertices of the cube To start off I installed numpy-stl globally on my computer using the following command. Sure enough, after a quick google search, I found a library called numpy-stl. If mathematicians can incorporate STL file generation algorithmically through code in their workflow, it would allow for them to much more easily get figures from their work 3D printed. I knew that it wouldn’t be very difficult or time consuming to derive the dimensions of the shape from the input data, but I knew that there must be a way to generate the STL file from the coordinates alone through code. Drawings in 3D CAD software are typically made using dimensions rather than coordinates. While this seems simple enough, I quickly realized that I had never created a model in 3D CAD from coordinates alone. The figure with its points labeled as x, y, z coordinates My sister gave me the figure from above with all of the points labeled with their x, y, z coordinates as shown in the image below. It is showing how the shape can be used to tile space. Īlex McDonough made the animation below in Blender. The figure used in Alex's research paper. The model is composed of three parallelepipeds, one large one in the back, a smaller one in the front, and a small cube on top. This led to challenges when she gave me the input information for the model she wanted me to fabricate. My sister who studies math, comes from a very different educational background, and as a result does not have experience using CAD software to provide me with an STL file. I can simply import this STL file into my slicer program, generate the code for the 3D printer, and start printing the part. These requests are usually made with them providing me an STL file of their model. In the past when I have been asked to print 3D parts, the requests have come from engineers and technologists with some experience using 3D CAD software such as Autodesk Inventor, Solidworks, FreeCAD, etc. This shape is from Alex McDonough’s research paper: “A Combinatorial Mapping For The Higher-Dimensional Matrix-Tree Theorem”. My sister recently commisioned me to make a 3D printed model of a mathematical shape.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |