ricosjp / truck

Truck is a Rust CAD Kernel.
Apache License 2.0
1.03k stars 53 forks source link

Support for 2D sketching/constraint solving #37

Open MattFerraro opened 1 year ago

MattFerraro commented 1 year ago

Hello,

I'm very excited about this project! Do you plan to implement your own 2D sketching and constraint solving? This is on its own quite a difficult thing to get right, judging by the review papers I've seen.

One possibility could be to use Solvespace as a library, but it's written in C not Rust.

I'd be interested in collaborating with you on this, if you decide to write your own!

ytanimura commented 1 year ago

Thank you for your issue.

We have actually created a tool using truck that draws a simple region in 2D and extrudes it out as a STEP. (Introducing tweet (Japanese)) However, the source code for this one is not open to the public. Solvers at intersections are indeed difficult and have not yet been created. We have to admit that it is a lower priority than STEP for the time being. I will take a look at the materials you provided sometime.

twitchyliquid64 commented 11 months ago

On the note of 2d drawing / constraint solving, I've been working on my own in Rust / egui and came across this issue! I'm hoping to use truck to generate STL's, if I can figure out how to get the library to consume an outer and many inner polygons and tessellate + export to STL.

https://github.com/ricosjp/truck/assets/6328589/de11d42d-a733-409e-a4bf-0e6cd77f1629

This is what I've made so far, I hope to open source soon: https://liquid-cad.twitchyliquid.net/

happydpc commented 11 months ago

On the note of 2d drawing / constraint solving, I've been working on my own in Rust / egui and came across this issue! I'm hoping to use truck to generate STL's, if I can figure out how to get the library to consume an outer and many inner polygons and tessellate + export to STL.

recording.mp4 This is what I've made so far, I hope to open source soon: liquid-cad.twitchyliquid.net

That's cool, can't wait to have a try.

emfax commented 2 months ago

If people are interested in working on a 2D constraint solver, I would be keen to help. I’ve also read some of the recent papers and it does seem difficult, but doable. Maybe some of the authors of those papers could provide some guidance.

Something that might need to be looked at in parallel would be some sort of lightweight computer algebra system that could support basic mathematical expressions.

I’ve been looking at this for a while, would be great to work on something with others.

twitchyliquid64 commented 2 months ago

@emfax If you want to collab I would recommend talking with @MattFerraro who is actively working on https://github.com/CADmium-Co/CADmium.

As for my foray into this space, i made and have now put into maintenance mode https://github.com/twitchyliquid64/liquid-cad

emfax commented 2 months ago

@MattFerraro I’d interested in working on a 2D constraint solver. I’ve been through a bit of the recently published literature as well and I’ve contacted some authors. I think it could be worthwhile trying to get something rudimentary working at the very least.