Noumenal, my 3D modeling app for iOS written in Rust, released on the App Store this week

161 points hackerfoo

What is Noumenal?

Noumenal is an elegant and fast 3D solid modeling app for iOS.

  • Inspired by VR, it's as if you can reach right through the glass.
  • Uses a solid modeling kernel designed from the ground up for high quality graphics, capable of updating 120 times per second.
  • Push 3D shapes into place as if they were real, solid objects using a custom, high performance physics engine.
  • Noumenal automatically texture maps exported shapes, so they are ready for texture painting.
  • Noumenal supports USDZ, glTF, and STL formats, in addition to its own lossless compact format (FCT).
  • Noumenal produces solid models, ready for 3D printing.

On the App Store

Website

​

Technology

Noumenal is written mostly in Rust, with a thin layer written in Swift to handle OS-specific APIs, such as the iOS UI (the color picker, sharing, settings) and StoreKit (to handle subscriptions.)

I used the Bevy game engine for rendering, ECS, sound, handling input, etc.

Geometry is generated real-time using my own solid geometry kernel (Facet.) I also wrote my own physics library (Impulse Drive) which works well with the geometry kernel and Bevy's ECS.

Rayon is used throughout Facet for parallelism.

There is currently about 30k lines of Rust not including dependencies.

​

Why Rust?

I wrote the first version of my geometry kernel years ago in Haskell, with the goal of writing a game engine in Haskell using it. I love Haskell, but I realized I couldn't reach the performance needed for interactive use with GHC, so I shelved it for a long time, and worked on my own programming language (Popr) instead.

When I decided to revive my geometry kernel last year, I needed to pick a different language to port to. I realized that what I really needed was Haskell's typeclasses. Rust traits are similar to Haskell's typeclasses, and the language offers much better control over memory allocation. I was able to port from Haskell to Rust in a couple months, with about the same performance. Then, in another month, I was able improve the performance of the Rust version about 20x, so the port paid off. (Now, the performance is high enough to run interactively on a 5 year old phone.)

​

Why Bevy?

Now that I had a usable kernel, I needed a way to put some shiny triangles on the screen (I had been just generating STLs.)

I spent some time learning Vulkan, and also tried Unity (it seemed like the responsible thing to do). Using Vulkan directly would have been a lot of work (compared to OpenGL which I've used in the past), and didn't make a lot of sense when targeting iOS. Using Metal would limit to just Apple devices. wgpu would have been a better choice, but was still a little to low level for what I needed. Unity didn't seem to be designed to work with dynamically generated meshes.

I was looking for something customizable and lightweight, while not having to implement everything myself. Bevy seemed to fit that well, because it had a lot of the basics and a very active community adding to it, and was highly modular and easy to understand.

The community is great, and I've learned a lot from them. Instead of just finding some code that I could mold into what I needed, I found a supportive community willing to work with me to get most of my changes upstream, and even improve on them. Sometimes it's like working in a team instead of developing solo. So I highly recommend Bevy, not just for the tech, but for the people.

​

Is Rust ready for Games/Apps/etc.?

It's ready when you are. Go out and make some cool stuff!