An impossible request
PACCAR wanted to create a digital sales brochure that they could use at their next convention to
highlight how they design cabs using AR. They asked us to create a lightweight app that could
do two simple things: display a model of a truck cab with a wiring harness on the web, and,
display the same model in AR mode on a phone or tablet. We kindly asked if they had a model
for us. They did. The problem? It was a full resolution output from a
CAD system in which the model had 7.7 million tris (triangles) and the file size was over
660MB. Even when converted to a gltf format with maximum compression the file was still 56MB,
far too large to be quickly downloaded on a phone in a convention hall with spotty wifi.
That’s a lot of triangles
It couldn’t get worse...
The problem was the CAD system didn’t output a nice, clean mesh. It was a mess. In addition, the model
was WAY too detailed. It was so detailed you could even read the connector numbers inside each and
every connector. There was no need to have all that detail for a simple AR brochure.
This is just the left quarter panel
Way out of my league
I’d done some 3D modeling but not enough to be considered an expert by any means. I knew the model
needed to be decimated to remove parts of the mesh but still retaining its shape. But to edit
the entire mesh by hand would have taken me FOREVER. With only a week a deliver a working
solution, I was in panic mode, downloading and trying every decimator I could find. Some of
them wouldn’t even run at all because of the size of the model. Some would run but would give
out garbage.
Blender to the rescue
After extensive trial and error, I finally found a reasonable pattern of repeatedly converting to tris
to quads, decimating, doing degenerative and limited dissolves, then deleting loose ends. Eventually,
I was able to get it down to 1.1M tris, which gave an output file that was about 15MB and loaded in
about 4 seconds. Success!! Or was it?
USDZ and iOS
While the model loaded fine in the web and on Android, in order to use the iOS built-in AR Quicklook
viewer, it needed to be converted to USDZ format, which is less compact than GLTF. The AR
viewer on iOS kept crashing due to memory constraints. I had already reduced the model size
by 86% but it still wasn’t small enough. Our dev estimated that it would need to be a file
size of 10 MB or less before it would work. The USDZ file was currently at about
40MB. But i had already reduced the mesh so much it was starting to have noticeable
artifacts.
Over decimated
The final cut
Eventually I realized that I would need to be more surgical in my approach. I found out I was able to
decimate the wires much more than the connectors before they would lose cohesion. When I had it all
decimated as much as possible, then I started selectively removing parts of the wiring harness like
clips, fasteners, and wire guides without losing the overall aesthetic. After 5 long days of trial and
error, I finally had a USDZ file that was 8.8 MB which was only 430K tris, a 96% reduction from the
original file!
Lessons learned
The client was thrilled we were able to take their model and create a working AR experience in just over
a week and I learned that just because someone says they “have the model” doesn’t mean the work is done
:) Also, dialing in the correct level of opacity was not
straightforward. What looked good in the web view looked bad in AR mode. And this
should be no surprise, but testing on device is the only way to know for sure. Reality
composer on the iPad would work with much larger files than the AR quicklook would.
Demo