9 ms·
Truck: CAD Kernel in Rust
- KRAKRISMOTT 4y agoHappy to see an open source alternative to KittyCAD
- nullstyle 4y agohttps://github.com/hannobraun/Fornjot https://github.com/hannobraun/Fornjot is another option in the space of early stage CAD kernel development.
- app4soft 4y agoFrom its "Advantages of Code-CAD" page:[0] > There are other disadvantages to Code-CAD, of course. Making a sketch and applying some constraints can be very easy with a nice GUI, while having to type it all out would be very tedious. > For that reason, I think the ideal CAD program would use a hybrid approach: Being code-first for all the reasons presented above, but letting you edit that code through graphical tools, where it makes sense. I'm not aware of any system that works like that, at least to the extent that is possible in principle. I believe that creating such a system would be a worthwhile effort. As for 2D CAD apps, such feature already exists since 1980s when AutoLISP created for AutoCAD (opensource apps with similar scripting: QCAD, LibreCAD). As for 3D CAD apps, and especially opensource, FreeCAD has ability to generate shapes or sketches with script and it would be possible to edit resulted geometry manually with GUI tools. [0] https://www.fornjot.app/blog/code-cad-advantages/ https://www.fornjot.app/blog/code-cad-advantages/
- hobofan 4y agoAs far as I understand, neither of the examples you mention allow for proper bi-directional editing. > FreeCAD has ability to generate shapes or sketches with script and it would be possible to edit resulted geometry manually with GUI tools. That sounds like the "normal" flow, where the first GUI editing action is destructive (= requires you to "emit" the parameterized geometry). I think what is alluded to there, is something more akin to a visual Markdown editor, or newer visual React editors like Utopia[0], which are a departure from the old generation of WYSIWYG editors like Dreamweaver, where an edition action in either the code or the visual mode wreaked havoc on the state of the other mode. [0]: https://utopia.app/ https://utopia.app/
- app4soft 4y ago> As far as I understand, neither of the examples you mention allow for proper bi-directional editing. See "Modify" commands in LibreCAD.[0] [0] https://wiki.librecad.org/index.php?title=Commands_and_tools_-_using_the_command_line#Modify https://wiki.librecad.org/index.php?title=Commands_and_tools...
- virtualritz 4y agoLibreCAD is 2D.
- app4soft 4y agoI said that. Reread my comment above.[0] [0] https://news.ycombinator.com/item?id=35071317#35073677 https://news.ycombinator.com/item?id=35071317#35073677
- virtualritz 4y agoConsider that if you do not like or miss something from the available OSS solutions that are or could be made scriptable (FreeCAD or others, e.g. SolveSpace), you need to touch source. FreeCAD & SolveSpace are C++. After 30+ years of that language and four years of Rust I won't touch the former with a ten foot pole unless it's an extraordinarily well paid gig. I wouldn't be suprised if the author of fornjot had similar feelings if they ever considered that approach. fornjot is a hobby project. So the fact that they start from scratch and may take years is not a deterrent. Rather its part of the appeal, I would assume. ;)
- hannobraun 4y ago(I'm the author of Fornjot.) > I wouldn't be suprised if the author of fornjot had similar feelings if they ever considered that approach. Yeah, I don't think I have it in me to work on a non-trivial project in C++ :) (Not saying that's the wrong thing to do, in general. I'm not the one to do it, is all.) > fornjot is a hobby project. This is not correct! Fornjot started as a hobby, but it has been my main focus since the start of 2022. I rely on my sponsors to support that work. Since around March/April 2022 I've been earning enough from sponsorships to cover my costs. > So the fact that they start from scratch and may take years is not a deterrent. Rather its part of the appeal, I would assume. ;) It's true that Fornjot is enormously ambitious. But I also think lots of people (chiefly those from the professional CAD world) are kind of missing the point on what it would take for the project to be successful. OpenSCAD exists and has a user base. Roughly matching its feature set and incrementally improving from there, could already make Fornjot useful to a lot of people. I certainly don't plan to stop there, but I'm just saying, there's an incremental path here. It's not just "100 man-years for an industrial-grade CAD kernel or bust".
- gjsman-1000 4y ago> Trendy Tools We can debate the merits of tools... but deliberately selecting any tool because it is "trendy" seems like a bad idea to openly state. Writing a CAD Kernel is extremely difficult (thus why there are, like, 3-4 in use in all CAD packages right now, Parasolid is everywhere)... so the last thing we need is a trendy tool over a pragmatic one.
- Brian_K_White 4y agoYou don't think rust will help with errors? Maybe "trendy" is a bad way to express it but I like the idea that 'yeah, we know it's a huge job to start from scratch, but so what? in 20 years it won't be starting from scratch any more, and should we just accept that the last cad kernel in history has already been written and a company owns it, and surely there are things that would be good, that can only be decided on day one and can't be retroactively decided in any existing kernel.' etc etc I know rust isn't magic or anything but I also know that paradigms and frameworks matter, and starting from scratch in a strict environment like rust where there is just a lot of pain in the neck rigor in every molecule, seems like it could have a great effect on something that needs to eventually grow into a huge and complex thing where the higher levels really really need to trust the lower levels to always be bulletproof correct. Rust's concerns were originally security, but security is just correctness, and correctness is valuable everywhere. And even the "trendy" aspect... I'm fine with it if it's consciously expressed up front like that. Rust plus webgpu? ok, sounds like a reasonable starting premis. Why not?
- delfinom 4y agoSecurity is correctness but correctness is not just security. CAD kernels being complex beasts want correctness algorithmically and that is the biggest most difficult part. If anything you want a formal verification language.
- imtringued 4y agoHonestly, FreeCAD crashes that happen in the geometry kernel are hilariously bad. I could do without them.
- meindnoch 4y agoNot trying to discourage you, but a reliable geometric kernel takes around a decade of work to develop, for a team of PhDs. Based on the docs, you've only implemented some very basic topological operations (and rendering, for some reason). The hard part is going to be implementing the rest: boolean operations, offset surfaces, lofted surfaces, blended surfaces, etc. and then there's the problem of version control / edit history. Efficiently and accurately implementing each of these can be a year-long research project in itself... You need a solid understanding of 3D topology, numerical methods, 3D differential geometry, etc. Nevertheless, I wish you luck! I will check back in a year or so.
- gjsman-1000 4y agoI absolutely wish the same... I am just not hoping for anything anytime soon, and that's OK. It's like asking a person to swallow a whale. Theoretically possible but it will take a while. It's also tricky to implement a kernel in a good, modular, well-designed manner. Take a look at OpenCASCADE, the kernel used by FreeCAD. And holding back FreeCAD. It's been in development for 24 years and it hasn't hit anywhere close to Parasolid yet.
- fallat 4y agoIt could very well be a company in disguise writing this (or the author being paid to work on it full time but we're not aware of the company behind it, because they will be doing offerings later based on it). But yeah, 100% this. Anyone familiar with the space knows these programs are massively complex and require years of work and knowledge - at least the polygonal approach :) Implicit surfaces / f-rep on the other hand... <3 Edit: Durr: 株式会社RICOS / RICOS Co. Ltd.
- gjsman-1000 4y agoI think there would absolutely be a market for a CAD program that was made specifically, and only for, hobbyists. Same for CAM. Right now... almost all CAD programs are designed for professionals, and the hobbyist versions are just cut-down professional CAD programs. The biggest exception I see is SketchUp, which has a very simple and direct way of drawing directly on objects, and it's very easy to pick up, but it has no understanding of solids, parametric measurements, assemblies, or any of that. And so SketchUp is super popular with woodworkers, home remodeling agencies, small businesses, all these people we wouldn't normally think of as "big professional CAD users" even if that means they lose out on some of the improvements that professional CAD packages have (especially because SketchUp really hasn't changed much in over a decade). A 3D solid parametric modeler with the ease of use of getting started with SketchUp. SketchUp with solids. I can dream.
- shash 4y agoNice to see another kernel for sure. Haven’t read much, but it sounds intriguing…
- Brian_K_White 4y agoAbout the scope of the job, remember that that which took 10 years 10 years ago, often does not take 10 years today. And there is nothing wrong with starting a 10 year project anyway, any day. They all have to start some time.
- virtualritz 4y agoI think it is great we get another OSS B-Rep kernel, even more so in Rust. Who cares how long it takes? I can assure the naysayers it will take forever if you never start. Some slightly condescending sounding comments here seem to assume that whoever posted this on HN is the author. And/or that there is a single author. There is a Japanese company behid this[1]. Having worked in Japan my assumption would be there is a team of developers behind this with a single person doing the public facing commits/GH repo stuff. [1] https://www.ricos.ltd/ https://www.ricos.ltd/
- meindnoch 4y agoWell, for one, having a renderer mixed into a geometry kernel is already a red flag for me. It's like starting to write an OS by deciding what the mascot should be... A geometry kernel shouldn't be concerned with rendering at all. 75% of the documentation is about managing the camera, the lights, the materials, etc. This isn't what a kernel should do.
- virtualritz 4y agoThere is no renderer mixed into anything. I would suggest you look at the actual crates. There is the truck-rendimpl crate and that is not relied on by any other truck-* crate that does actual B-Rep stuff. I also think you confuse the book/tutorial with the documentation on docs.rs. My impression is that the former is very much a work in progress. I never looked at it until now. The latter (and the examples in the resp. crates) is what you want to check out to see the kernel being used. E.g. https://github.com/ricosjp/truck/blob/master/truck-modeling/examples/bottle.rs https://github.com/ricosjp/truck/blob/master/truck-modeling/... The main README has links to all the documentation of the crates.
- deleted 4y ago[deleted]
- CuriousCosmic 4y ago> It's like starting to write an OS by deciding what the mascot should be... Honestly this isn't a great comparison. Plenty of projects decide branding early on. Deciding on a logo or mascot isn't really too different than picking a name. It's probably going to be one of the first three or so things you do when starting a project if someone on the project is at least moderately graphically inclined. A better comparison to what you described would be someone starting to write an OS from scratch by writing the desktop environment first.
- FpUser 4y ago-"Rust and WebGPU. Advanced optimizations using Rust ..." -"Safe implementation using Rust to eliminate core dumped ..." My take - I do not give a flying hoot what it is written in. When / if I see end result that actually matters to users: say a tool competitive with something like Solidworks wake me up. And just for perspective - I do not remember SW ever core dumping on me even though it is written in "unsafe" C++.
- CuriousCosmic 4y ago> I do not remember SW ever core dumping on me even though it is written in "unsafe" C++. The save-spamming impulse that I've developed from SW or AutoCAD just outright crashing on me (back when I used it regularly) makes me feel like I've had an entirely different experience from you.
- FpUser 4y agoNo idea about AutoCAD. SW - I used it to create complete 3D model of fitness equipment approximately of high end treadmill complexity. The resulting model went to 2 factories to produce all the parts (except fasteners obviously). Haven't had single crash but of course I can bet that I did not use all the functionality. So maybe there are parts of SW that are less "stellar" but I did not encounter those.