Organizing hundreds of .stl files for 3D printing

by: Anthony Garland

I currently teach SOLIDWORKS at Clemson University while working on my Ph.D. in mechanical engineering. Each semester I train about 100 students in two sections of the SOLIDWORKS class how to model 3D parts and assemblies, how to make engineering drawings, and how to use the animation, simulation, and PhotoView 360 tools within SOLIDWORKS. 300 to 500 students take the course each semester. The course requires students to complete ten homework assignments, daily quizzes (we call them "In Class Assignments" (ICAS)), take the SOLIDWORKS Associates Test (CSWA), and complete three projects. For the first project, students design a simple bottle and lid which screw together. We encourage the student to be creative and make interesting designs. I've seen students make their bottle look like things ranging from famous buildings to a miniature Darth Vader. The bottle and lid must fit inside a 3.0 x 1.5 x 1.5-inch bounding box.  Also, we 3D print all the bottles and caps of each student and return the printed model to each student. Because I setup the 3D printers in the general engineering department, I was tasked with printing all the bottles and lids. Given that about 500 students were taking the class during the Spring 2016 semester, this task was a bit overwhelming at first. 

Students taking the CSWA exam

 

Objective: 3D Print several hundred .stl files in the shortest time possible using two or more 3D printers. 

Other information

  1. I only visit the 3D printer lab once a day. I would prefer going at the same time every day (i.e., 8:30 am). 
  2. Must be able to identify which bottle and cap belongs to which student. 
  3. Use Simplify3D to slice the bottles.
  4. We use a Makergear M2 and Luzbot Taz 5 as the two 3D printers.
  5. Print each section of the SOLIDWORKS class together (i.e. there are five teachers. Print each teacher's sections all at once so we can return the 3D models to the students in each section all at once). 
  6. Clemson currently uses Blackboard as the course management system. The students will submit a .zip file containing the two .stl files, two .sldpart files and one assembly file .sldasm. Blackboard will rename each student's .zip file to have their username between underscores, for example, project1_anthonygarland_myproject1.zip. 
  7. We use Graderworks to check for cheating.

LuzBot Taz5 3D Printer

Makergear M2 3D Printer with bottles and caps on the build plate

Solution

The code used in this solution is found on GitHub as release 1.1

  1. The first task was to run all of the student's files through graderworks. Graderworks was helpful in that it will unzip all the files and put them into a folder with the student's username (*). So, project1_anthonygarland_myproject1.zip becomes a folder called anthonygarland. Also, we always check everything student's turn in for cheating using Graderworks.
  2. Second, I need to find all the .stl files that were submitted. To find all the .stl files, I wrote a Matlab script (because my colleagues are more familiar with Matlab and VBA than say Python) to loop over the folders and find all the .stl files. The function is called 'GetListOfStlFiles'. The output of this function is a list of 'stlFile' objects. These objects are defined in the 'stlFile.m' file.
  3. Third, I want to sort the list of .stl files by the student's class section number. To do this, I use the 'SortFilesBySection' function. This function first reads a .csv file which has four columns (last name, first name, username, section number). The function assigns each stlFile object a section number, student's first name, and student's last name, and then sorts the list by section number. 
  4. Next, the list is passed to the 'ExportStlFilesInFolderGroupsWithImages' function. This function does several things
    1. Puts the .stl files into groups of 18. In my experience I can print 18 .stl files ** all at once, and this print job will take about 24 hours. I only want to visit the 3D printing lab once a day at the same time, so making print jobs that take slightly less than 24 hours is crucial. 
    2. Renames each .stl file to have the student's username. Typically, students submit files with names like bottle.stl, cap.stl, container.stl, and lid.stl which is not helpful in identifying the creator of the file. The Matlab code will rename each file to have the username-FileNumber.stl. So, my bottle.stl will become anthonygarland-file1.stl. 
    3. It records who's 3D model is in which group by populating a CSV file (3dprint.csv). The column headings are group number, file number, group's folder path, file's new absolute path, username, section number, first name, and last name. Later, I save this as an excel spreadsheet and use it to keep track of which bottles I'm printing and have printed. 

3dprint.xlsx (made from the 3dprint.csv generated by the script) used to keep track of which bottles are printed.

  1. Saves an image of each .stl file's three orthogonal views and an isometric view. Saving an image of each .stl file is helpful because then we can quickly identify which bottle and cap belong to which student when each 3D printed group is finished. 

Example bottle with three orthogonal views and the isometric view. Username and file number are in the title of each image. 

Result

Using this script saved me tons of time by putting all the .stl files needed for a 24-hour print into a single folder so that I didn't have to search through the student's file submissions to find their .stl files. Also, I can select all the file's at once when importing them into Simplify3D for slicing. After each print is finished, it is a relatively simple task to look at the images of the .stl  files in each folder to identify which physical 3D model belongs to which username. 

Simplify3D slicer with bottles and caps for a single group

Toolpath Preview in Simplify3D for bottles and caps for a single group

 

Acknowledgement

I used the following existing Matlab projects from the Matlab file exchange when putting together my script. 

* If you don't have Graderworks, then you could write a Matlab script that unzips all the folders using the unzip function 

** 18 files means 9 complete bottle and caps. Remember, they must fit inside a 3.0 x 1.5 x 1.5-inch bounding box.


Join our free mailing list!

Join our free mailing list!


Graderworks

  • Grade student's SOLIDWORKS files quickly
  • Catch Plagiarism
  • Export SOLIDWORKS files to another format in bulk
View Software

Recent Articles

Graderworks: SW 2017, Config files, Command line args

Graderworks 2.36 and higher is compatible with SOLIDWORKS 2017. Graderworks now


Graderworks: An Official SOLIDWORKS Solution Partner

Garland Industries is happy to announce that Graderworks is now an official SOL


Graderworks 2.35

Several more improvements have been made to Graderworks in version 2.35.


Graderworks 2.32 Release

Graderworks 2.32 represents continued incremental improvement in the overall qua


ROI of Graderworks

Graderworks saves educational institutions $625 per semester for a Solidworks en


Design Automation Example

A design automation example is given showing topology optimization coupled with


Graderworks 2.31

Graderworks 2.31 includes the following updates. 1. When analyzing .stl files th


Graderworks 2.3 Update

Update on Graderworks 2.3 Several major bugs were fixed.


Graderworks 2.3 Release

Graderworks 2.3 allows you to compare the geometric similarity of .stl files wit


Turnitin vs. Graderworks

Graderworks is the Turnitin of 3D models. Not using a plagiarism checker in a So


Getting Started with Graderworks

This tutorial shows how to get started analyzing and grading Solidworks part fil


The Making of Graderworks Video

As an engineering entrepreneur, marketing is not my strength. To make high-quali


Organizing hundreds of .stl files for 3D printing

How would you 3D print hundreds of .stl files in the shortest time possible usin


What is unique about 3D printing?

3D Printing offers many new exciting possibilities, but why is it unique? Three


How 3D printing works

3D Printing requires three steps. 1. Getting a 3D model. 2. Slicing the model to


Preprocessing files for Graderworks: Converting .rar to .zip

Solidworks students submit .rar files instead of .zip. Graderworks requires .zip


Windows Smart Screen and Code Signing

A short tutorial on how to sign a Windows installer and what the smart screen fi


What should we 3D print?

3D Printing opens the possibility of mass customization of consumer products. Ma


How did Graderworks Evolve?

How would you grade 1000s of Solidworks file? This article is the story of how I


Software, dying on the journey from academic project to commercial tool. 

Does software make it from academic research to useful commercial tools? Ignoran