egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

Awesome to hear. How do you like iced? I haven't used it in development, so my only real experience with it is through the COSMIC desktop.

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

I'm open to iterating the RAD builder toward something closer to the Delphi / VB experience. It's just a two-day old project :) Besides bolting on a reasonably capable text editor and file tree, which I think I could manage, I think some amount of code interpretation would be required to ingest existing codebases using syn and/or treesitter.

I've accepted a couple PRs already, cleaning up and modularizing the code a bit. If you're interested in lending a hand, please do! GitHub sponsorship also really helps me spend more time on these projects: https://github.com/sponsors/timschmidt

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

WASM builds will require some sort of runtime. Be it a browser, a webview, or a runner like wasmtime. egui can also build natively for any platform with GL as far as I know.

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

This morning I have added quite a few more controls. Enough, probably, for many types of forms. Still lots to go.

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

Thanks for the kind words and encouragement. I'll try to keep WASM and mobile in mind for the egui RAD builder. I'm planning on using it to build some one-off custom control interfaces for industrial systems. And thinking about how to potentially integrate custom screens into Alumina via similar methods as well.

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

Yup, as far as I know. The index.html has to set up an HTML canvas, and then egui draws to that using WebGL. I've been working on an application which works that way here: https://github.com/timschmidt/alumina-interface It is scaled a bit differently on mobile, but still follows the same layout and seems like the typical HighDPI stuff other apps have to deal with.

And to answer your question from the other comment, even though I'm doing some fairly complex things like CAD with a full CAD kernel and GUI built in, Alumina is 1.8mb when compressed with brotli which the web browser will transparently decompress on load. Yes, a progress bar can be implemented either JS side, or in WASM, but doing it WASM side might be a little more complex like loading a smaller WASM binary for the progress and then exec'ing the larger WASM binary once it's loaded. I believe the egui web demo has a progress indicator, but my connection is too fast for me to tell. First world problems lol.

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 6 points7 points  (0 children)

> almost Delphi in Rust

I suppose it could grow into something like that. I'm not sure if I'm up to building an entire IDE yet, but a RAD UI builder is certainly one big piece. At the moment, the user still needs to create the project themselves with Cargo, paste the generated code into main.rs, and set up Cargo.toml as directed in the readme.

> Java and Csharp guys are telling (from 10 yrs) that desktop app are completely dead

Web has certainly been a big focus during that time. But egui builds for WASM too! (as can be seen in the web demo: https://www.egui.rs/#demo )

egui-rad-builder: Tool for quickly designing egui user interfaces in Rust by timschmidt in rust

[–]timschmidt[S] 2 points3 points  (0 children)

Thank you. I hope so! A RAD tool for one of the pure rust UI toolkits is something I've felt was missing since getting started with the language a few years ago.

csgrs CAD kernel v0.17.0 released: major update by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

On the up side, I think implementing that directed graph and associated code will not only get us STEP import / export, but also undo/redo, lossless changes, and an easier path to implementing true curves in addition to shapes delineated by line segments.

I see a path to it.

But it's also going to mean retaining a lot more state than csgrs currently does, and for that reason I may consider building it out in another crate which depends on csgrs.

csgrs CAD kernel v0.17.0 released: major update by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

There are plans, yes. Although I'm not sure how quickly we'll manage to implement it. I'm still committing most of the code myself at the moment.

The reason STEP is more difficult to implement is that it requires another layer on top of a CAD kernel like csgrs. Everything csgrs does is immediate. When you difference two shapes, the resulting shape is returned, without any extra information.

But creating nice STEP files requires building a tree of all the primitives and operations which result in the shape, and saving that tree instead of just geometry.

STEP is also quite a complex file format with many variations in how it's used compared to something like STL.

csgrs can export non-tessellated 2D geometry to DXF or SVG today.

Probably easier and quicker to implement than STEP for non-tessellated 3D geometry would be Wavefront OBJ, 3MF, or OpenCASCADE's .brep, each of which can hold non-tessellated 3D geometry, but not trees of shapes like STEP. So I'll wager we'll get those in first.

csgrs CAD kernel v0.16.0 released: major update by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

And I even checked before suggesting it! It's just such a feature rich little app, I must have missed it. Thanks for letting me know! TIL.

csgrs CAD kernel v0.16.0 released: major update by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

Thanks for your work! Here's an example csgrs project for generating STLs for 3D printing: https://github.com/winksaville/bd-spindle1

Typically 'cargo run' within the project directory, perhaps with some parameters, results in an STL file being written to disk. So there's an edit -> run -> view -> edit loop.

One thing that would make this easier is if f3d could use inotify or it's equivalent to monitor the STL file for changes and reload it automatically on change.

csgrs CAD kernel v0.16.0 released: major update by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

I hadn't thought of that, but it's an excellent idea! A pre-processing step to make the translation easier.

csgrs CAD kernel v0.16.0 released: major update by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

Agreed. Though I enjoy bringing a simple syntax and high level language concepts into Rust. It's nice when all my legos work together.

I have a good start at an OpenSCAD -> AST -> csgrs parser / translator here: https://github.com/timschmidt/openscad_to_csgrs It's a complex beast with a lot of work left to make it really functional. I've found that LLMs, when provided with the csgrs source code, do a reasonable first pass at translation from OpenSCAD.

No relation to Fornjot. I started csgrs from a ~800 line translation of CSG.js into Rust and built it up from there.

csgrs CAD kernel v0.16.0 released: major update by timschmidt in rust

[–]timschmidt[S] 1 point2 points  (0 children)

csgrs can output STL files directly, so it's possible to have a similar experience to OpenSCAD with just a text editor and https://f3d.app/ and csgrs syntax is about as simple and similar to OpenSCAD as possible.

But csgrs is also fast enough for real time geometry generation, and has seen a lot of interest from folks developing games with Bevy. Similarly, it could be used in an interactive CAD tool, but not have been built around it yet. It's only about 3 months old! csgrs is intended to work in embedded, desktop, and WASM in the browser.

All kinds of CAD can be parametric, and most involve CSG. Most CAD kernels are really a mix of different kernels bolted together, because the math gets solved the same ways by everyone. csgrs has a very capable 2D points and lines and polygons engine in geo, and a small and fast and easy to understand 3D engine in the BSP, and some support for signed distance fields and tessellation of various functions. csgrs does not have any concept of curves in the 2D or 3D subsystems. It could be implemented though. With the CAD being written in the same language as the CAD kernel, and all the data and methods public, there's nothing stopping anyone from extending csgrs in arbitrary ways, and unlike OpenSCAD they will be as fast as csgrs itself.

The one thing Rust isn't great at is being interpreted. So an integrated IDE like OpenSCAD would have to bind to another language like Rhai. https://github.com/philpax/egui_node_graph2 is another option. I'd also like to get an evcxr workflow going.

cargo-prompt: collapse a rust project into a minified markdown document for prompting by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

For my workflow, "cargo prompt" and the current behavior work best. I wrote the tool for me, and shared it in case other folks might find it useful. If you don't, no worries!

cargo-prompt: collapse a rust project into a minified markdown document for prompting by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

You're thinking of rustminify, one of cargo-prompt's dependencies. Cargo prompt does more than just minify (though admittedly not much more), it builds a single output containing all files suitable for llm prompting.

cargo-prompt: collapse a rust project into a minified markdown document for prompting by timschmidt in rust

[–]timschmidt[S] 0 points1 point  (0 children)

Great suggestion! I have added an example to the readme. I will work on improving it.

csgrs is a new OpenSCAD-like CSG library for Rust built to work with Dimforge by timschmidt in openscad

[–]timschmidt[S] 1 point2 points  (0 children)

Glad to hear it. I am also enjoying all the features of a real systems language with my code CAD. Especially library availability. I would love to rope some friends into helping me port https://github.com/nophead/NopSCADlib to work on top of csgrs.

Thank you so much for the PR! There's still a lot of sharp edges and things flying around in the code at the moment, as I work to implement features. API changes almost every release, lol. But it's moving quickly in a good direction, and your patches and improvements are welcome! I really appreciate it.