Watch on YouTube
We’ve been wondering lately about how to create computer-generated 3D models. Not just with shape primitives, but also adding other models into the mix.
If we can do this maybe we can make generated robot parts, make things stronger (or weaker), or maybe even use physical computing to ‘sculpt’ a new model.
Two sources of inspiration of these thoughts originates from pieces by Nervous System and Neri Oxman. They both have this skill of making their models seem as if they were literally grown from a 3D printer.
As mentioned above, for our project we’re interested in using existing models in our mix. The amount of things uploaded on Thingiverse and their API makes it a good place to experiment with.
Thingiverse does not have a way to recommend things to a certain user— if it would tailor to their likes or not. It also doesn’t have a way to compare two things together.
Let’s get started with the making! We created four Python programs:
• Thingiverse, a wrapper for the Thingiverse API
• Thinginew, which watches the new feed on Thingiverse and tweets some of the data
• Thingiscore, takes a thing ID and calculates its score (also explores random thing IDs)
• Thingisimilar, compares two things to see if they are similar
You can view the source for these on Github.
Here is the flowchart overview of Thinginew. It has two main routines, Refresh Things and Send Update.
–> Check it out: #thinginew
Here is the flowchart overview of Thingiscore. Three main routines, Trigger Tweet, Random Routine, and Tweet Routine.
Here is the table detailing how each score is calculated.
–> Check it out: #thingiscore
–> Try it in action: @RobotGrrlDev thingiscore: 279864
Here is the flowchart overview of Thingisimilar at the moment. It will be changed and improved upon…
Making Thingisimilar work better is proving to be challenging. It will be interesting to see if we can make it work.
There were some interesting snags during development.
Authentication with Thingiverse
For desktop applications, the Thingiverse auth is a little peculiar. You have to go to a website to get the auth key.
Through a little trickery, you can ‘sort of’ automate this. Not sure if they have any future plans to improve this.
This was a tricky bug (not really a bug) to figure out. We could not get our bio on Thingiverse to be updated from the API. It was always resulting in a 400 error.
After trying to fix this after many hours, we asked James from WaterColorBot and Eric from Pinoccio for help. They lead me to some webpages to learn more about it, and some documentation. Quite helpful, thanks.
Eventually the solution was to use json.dumps(data), so it would send the data raw. It was very sweet to see the HTTP status 200.
Things Disappearing from Newest
The most bizarre bug goes to this one. It would only happen sometimes, not all the time, and hardly any of the time. But enough to mess up the flow of the program.
Sometimes when refreshing the newest feed, we would see a ‘bulk’ of new things. They were not new, and they were already added to the list of seen things. Why would this be happening?
We concluded that sometimes things are deleted from the new things feed. Even though this should not happen. If a user did delete their newly created thing, trying to access the thing would result in an error. But it should still be listed on the newest feed.
Here is a screenshot of our console log, showing the disappearance of 275902.
We adjusted our code to account for this, and have not had a problem with it since.
Thingiscore Without Downloads
This flaw in our program was noticed thanks to MakerBlock. He decided to compare two of his things, Customizable Ring and Pirate Ship.
The pirate ship did not receive a very high score, even though it has more downloads than the ring.
It should have received a higher score. Aha! We were not including file download count!
We wrote a test script to see if it was possible to access this variable from the Thingiverse API, and it was. Now, it is included into the Thingiscore calculation.
Thingisimilar has to be improved. We think this will be a challenging one to make it work with good results. ‘Good’ results meaning, the two things that are reported to be similar do actually seem similar from our point of view.
Creating a program that analyzes a user on Thingiverse for their apparent favourite category and types of things would be useful for when a person wants to create a mashup of things based on their own likes.
…And getting started with mashing up the things. OpenSCAD appears to be well suited for this, there is a Python package SolidPython and a command line tool. It will be fun to get started with this.
While we have been making ThingiMix, we have been learning Python. So if the code seems relatively ‘n00bish’ in some areas, this is why It will be improving as we learn more.
If you want to support the development of this project, please consider backing us on Patreon.
You will be helping us monetarily with getting a metal Printrbot Simple kit. We just need a bit more to cover shipping and taxes, most of it is covered thanks to the Make Connected Home prize.
As well as saving up to go to Maker Faire New York. Hopefully by the end of the summer we will have enough to go. It would be amazing to show off this project.
A cool moment of the project so far- a web engineer at Makerbot tried Thingiscore! Sweet!
Hope some people out there are interested in this project. We’re pretty excited about it. If you have any crazy weird ideas please let us know, maybe it is so crazy or weird we haven’t thought of it yet.
Now it is time to work on improving Thingisimilar. Until next time, make weird things!
Aside: Although the entire post is written with ‘we’, it is just me working on the project.