What does HackerNews think of truck?

Truck is a Rust CAD Kernel.

Language: Rust

I agree 100%.

Truck[1] and Fornjot[2] are recent attempts in the Rust space, both are WIP.

But both seem to be going the traditional way. I.e. B-Rep that can be converted to (trimmed) NURBS.

I think if one wanted to incorporate the last 50 years of computer science, particularly computer graphics, one needed to broaden the feature set considerably.

You need support for precision subdivision surface modeling with variable radius creases (either via reverse subdivision where you make sure the limit surface pass through given constraints or using an interpolating subivision scheme that but has the same perks as e.g. Catmull-Clark).

Then you need to have SDF modeling ofc.

Possibly point based representations. If only as inputs.

And traditional B-Rep.

Finally, the kernel should be able to go back and forth lossless between these representations wherever possible.

And everything must be node-based, like e.g. Houdini. Completely non-destructive.

[1] https://github.com/ricosjp/truck

[2] https://github.com/hannobraun/fornjot

There are two Rust projects working on parametric kernels I'm aware of.

The first one, Truck[1] seems to have a company behind it, Ricos Ltd, that look like they to know what they're doing[2]. The tweet shows their product using functionality from Truck (the frontend is not OSS AFAIK).

Fornjot is an ambitious project IMHO. Their kernel is in a separate crate[3].

As for OSS code that could be a good base to either use (or port to something like Rust) for someone to write their own kernel is Ayam [4], the oldest OSS 3D NURBS modeler that is still being developed.

[1] https://github.com/ricosjp/truck

[2] https://twitter.com/RICOS_ltd/status/1550390552482693120

[3] https://crates.io/crates/fj-kernel

[4] https://ayam.sourceforge.net/

I think some interesting developments are made in that sector in the form of https://github.com/hannobraun/Fornjot and https://github.com/ricosjp/truck. Let's see whether one of those will actually get anywhere near a usable level. Fornjot in particular is shaping up really well.
I will definitely keep reading and learning, as well as gaining practical implementation experience. We'll have to see how that goes, and what the solution will end up being.

> Another direction you could take is to define just the API, and use the opencascade kernel (like FreeCAD) until the rest of your code is ready.

A CAD kernel is the central dependency for any CAD program, and I feel that it would be wrong to just use one and accept its limitations. I need to be able to take ownership, to work on it directly. OpenCASCADE is a huge pile of C++ code, which is the opposite of all that. (Not saying it's wrong to use in general, just that I'm the wrong guy to work on a huge pile of C++ code.)

I've considered using Truck[1], but decided not to do that for now. I really want to see what I can come up with. If that doesn't work out, at least I'll be in a much better decision to decide what other option would be best.

[1] https://github.com/ricosjp/truck

This one seems furthest along:

https://github.com/ricosjp/truck

And it has a long way to go. They are tackling some hard problems like dealing with STEP format already.

There is also a geometric constraint solver written in Rust. He's moved to (I think gitlab) but here's the old repo: https://github.com/phkahler/constraints

>> This looks super exciting, particularly the idea of building a new Open-source B-Rep CAD Kernel.

Yes, I think he's being rather naive about that. Starting with flat surfaces and straight lines is really ignoring the hard problems and will likely require a complete rewrite later. IMHO support for NURBS surfaces is a requirement for CAD and export/import of STEP files as well. Having said that, if he keeps going it will be a good thing. Some related efforts:

Another (stalled?) CAD kernel in Rust: https://github.com/ervanalb/arcade

Another one in Rust that can also read STEP: https://github.com/ricosjp/truck

That one reads STEP by using: https://github.com/ricosjp/ruststep

There is a geometric constraint solver written in Rust: https://github.com/Michael-F-Bryan/constraints to be used in another CAD: https://github.com/Michael-F-Bryan/arcs If I recall he moved all his work to gitlab. Here is arcs: https://gitlab.com/Michael-F-Bryan/arcs

All of this is very ambitious and I look forward to a day when a good CAD system written in Rust is readily available.

In the mean time I shall keep plugging away at the Solvespace C++ code: https://solvespace.com/index.pl