Part 1 of this project dealt with printing the model; Part 2 I made a stand for it, cause, ya know, why not? Part 3, well, I think it’s time to add electronics, lights, sound, the works to it. Now the original model was hollowed out for the purpose of adding electronics, but it needed some work; more space inside and it was missing mounting points for buttons, or heck, even a way to open it up to change the batteries after it was all closed up. Time to do some modification and design iteration!
Edit: Lately, I’ve received messages from people asking if I’d be willing to share the modified STL files I made while working on this project, and while I would love to share the files, due to Kirby Downey posting the original model on MyMiniFactory (and on PrusaPrinters) as a no-remix/no-derivative creative commons license, in respect of that license, I cannot in good conscience share the files. Sorry, and thank you for your understanding! Now, back to the original blog post.
After having printed and assembled the Portal Gun, and having some time to handle it, I found several things that I wanted to change with the design of the model. First, the inside cavity was not nearly large enough to provide space for the electronics and wiring I wanted to shove in there. Second, I wanted to mount switches and buttons on the back of the gun near the handle, so it needed holes for those. Third, I wanted a number of the parts to be able to assembled using hardware (screws, nuts, etc.) vice glue. And, last, the in-game model had a light on the top of the body of the gun, so I needed to be able to print that part separately so I could mount LEDs inside of it.

Modeling the negative space. 

Top light model with space for LEDs.
The challenge I faced now, was that the files for the Portal Gun were not easily editable. In STL file format they are considered meshes when imported into Fusion 360 (seen in pink in the above photos). I cannot take dimensions easily and sketch out new designs on the faces of the model for what I want to modify. Now, it might be possible to edit the mesh in Blender (or I guess Fusion 360 does have a basic mesh editor), but the mesh is usually of a higher resolution, so the number of triangles the mesh is made from is rather high and not necessarily uniform in any useful way for me to edit.
One thing I knew that I could do, and had played around with before editing other models, was doing a boolean operation with several 3D models in Netfabb. So, using what dimensions I could take and guessing the rest by lining up my sketches as close as I could with the mesh, I decided to model the negative space or rather all the parts of the 3D model that I wanted to remove.
Importing my negative models into Netfabb along with the original models, I was able to line them up and perform the boolean operations to subtract my model from the original model; performing all the edits I’d wanted to make, albeit in a rather roundabout way.
Changes I made to the model:
- Hollowed out the back half of the Portal Gun body to give more space for electronics.
- Added holes for buttons, an on/off switch, and battery charge port.
- Changed the handle mounting points to allow it to be attached with screws.
- Added set-screw holes in the side of the body near the seam in-line with the holes for the alignment pins (allows me to use set screws to hold the alignment pins in place and secure the body together without using glue).
- Extended the alignment rod holes for aligning the front half of the Portal Gun to the body into the body (allows me to use threaded rods and bolts to secure things together).
- Added a hole to route wiring from inside the body to the space in the barrel for adding LEDs and a speaker up front.
- Created a hole in the top of the body to mount my model for the top-light on the body.
- Moved where the front mated to the main body for a cleaner seam.
With all those edits done, it was time to head back to the printer and re-print some parts! Well, re-print most of the parts for the main body. Which was rather disheartening, having to redo that much of the build, but such is how the design process goes; especially if I want to make the best Portal Gun replica I can!
First print is a one layer print of the button layout on the body to make sure everything’s laid out correctly and feels right. At least as right as it can with my large hand awkwardly crammed up under the back part of the outer shell. One minor tweak to positioning and a 3D print later, and I was able to start mounting the buttons and charging cable plug.
Looking at the part from the back side, I realized after I’d finished printing it, I could have flipped the part upside down so it would have printed with less need for support material. Oh well, hind-sight and all that.
Time to install electronics! To add lights and sound to the Portal Gun, I made use of an Arduino nano and sound board from Adafruit. For programming the Arduino, I set it so that on startup, it would trigger the sound board to play the Portal Gun start-up noise. For the buttons, I programmed it to take input signal from each and depending on which was pressed, it would output 5 volts to the respective color of LEDs (either orange or blue) and cut voltage to the opposite color of LEDs. At the same time it was set up to trigger the sound board to play one of three portal gun firing noises, randomizing which one played each time.
While an Arduino was probably more powerful than what I probably needed for that simple set of code, it did the trick nicely without me having to design my own circuit and fiddle with a switching circuit. I did decide to add an additional feature to the code though, that when both buttons were pressed at the same time, for 10 seconds, it would set the Portal Gun to a display mode where it would have one set of the LEDs lit and then after a minute, would fade out and fade in the other set, changing from blue to orange and back again over time. A nice way to have it set up when it was on it’s display stand.
Finally to power this whole circuit, I picked a 4400 mAh Lipo battery so that it would hopefully last for at least 4 hours if I decided to carry it around as part of a cosplay. I also set it up with a charging circuit and a plug for a micro-usb cable to charge it with; which also doubled as a way for me to plug the whole thing in and have it powered continuously on it’s display stand.
With the electronics set up, now it was time to assemble the whole thing.
And to that end, with the modifications to the body I’d made, I was able to heat-sink some threaded nuts in the barrel of the Portal Gun so I could run threaded rods through the barrel into the body and use nuts and washers to hold the front-half together. This way I could disassemble the front-half and barrel for painting and detailing later. The main body was assembled in a similar way with alignment pins and set-screws to hold it together, hidden under the back shell.
Set on it’s display stand and powered it up, those lights were the extra touch it needed. The photos here don’t really do it justice here in the daylight, and I have yet to run LEDs to the front barrel for a better illumination when looking at it from the front. As it is though, I’m quite satisfied with how it’s turning out. And it’s a blast to handle and play with, shooting portals all over the apartment. All that’s left is to paint it and apply some decals. Maybe a touch of weathering too. And when I get around to that, there will definitely be a Part 4 to this build log.











