Giter Site home page Giter Site logo

Comments (10)

MattFerraro avatar MattFerraro commented on August 15, 2024 1

I think it would be best to do a completely clean break here rather than keeping it inside the CADmium repo, so I've created https://github.com/CADmium-Co/ISOtope

I picked "ISOtope" because it's an Iterative SOlver and because it sorta fits the naming scheme of elemental things. Also "tope" like topography, and how it's all based on gradient descent? IDK, we'll workshop it.

Don't worry about matching the existing API too much--it was whipped up super fast as a proof of concept and it may well be bad. Build the right API for a standalone 2D Sketch Solver and CADmium will adapt to meet it.

from cadmium.

TobiasJacob avatar TobiasJacob commented on August 15, 2024 1

I was able to make some progress in the repo https://github.com/CADmium-Co/ISOtope.

There is still room for improvement, but I think we can start working on integrating it into the software before the codebases diverge too far.

from cadmium.

TobiasJacob avatar TobiasJacob commented on August 15, 2024 1

Yeah, you can open up an issue for this in the new isotope repo

from cadmium.

MattFerraro avatar MattFerraro commented on August 15, 2024

Thank you Tobias, what a great writeup!

I have no attachment to the second-order nature of the current approach--it was just easy to think about during prototyping. I think the first order formulation is likely to be much better!

I strongly support the idea of breaking out the 2D constraint solver into its own standalone crate and giving it as few dependencies as possible. I also love the idea of trying out a few different approaches to the gradient descent step so we can weigh the pros and cons.

If you feel confident to lead this effort, I will support you however I can!

from cadmium.

TobiasJacob avatar TobiasJacob commented on August 15, 2024

Hi @MattFerraro ,

Thanks, great to hear. I think I can start working on refactoring the code to use gradient descent. I can also document the maths behind it in a readme. This shouldnt be too much of a change.

Refactoring the code into a separate crate will probably be a big pullrequest leading to merge conflicts with other braches, so I'm not sure how to deal with this.

You wrote on Discord that you are working on settigung up a Github Organization anyways, which would make it easier to move the code around.

I guess suddenly coordinating 800+ people puts a bit of unexpected stress on you 😅 so yeah, just let me know what you think a good way forward

from cadmium.

MattFerraro avatar MattFerraro commented on August 15, 2024

This is fantastic work, Tobias! Unbelievable job

I pulled it locally and ran cargo test. On my m1 mac I'm seeing:

point_a: Point2 { data: [[0.5700834586643445, -0.06745530512562747]], gradient: [[-25.709630952671287, -3.5250742668599533]] }
point_b: Point2 { data: [[-1.3913236621093832, -0.33256804099923265]], gradient: [[-0.03432845891903502, -0.13300160678809736]] }
point_c: Point2 { data: [[-1.7858823110455389, 2.616758693265621]], gradient: [[0.04124606881310794, -0.04022156009781125]] }
point_d: Point2 { data: [[0.17054457073731163, 2.8818523972647134]], gradient: [[0.02043760840499649, -0.022759707622775023]] }
point_reference: Point2 { data: [[0.5592929825521086, -0.06193753782611579]], gradient: [[25.811662378731278, 3.5916709580860164]] }
thread 'examples::test_rectangle_rotated::tests::test_rectangle_rotated' panicked at src/examples/test_rectangle_rotated.rs:113:9:
assertion failed: (point_a.as_ref().borrow().data() - Vector2::new(0.0, 0.0)).norm() < 0.001


failures:
    examples::test_rectangle_rotated::tests::test_rectangle_rotated

test result: FAILED. 17 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.30s

Do you get the same?

from cadmium.

TobiasJacob avatar TobiasJacob commented on August 15, 2024

Yes, one test case is not yet working, its written down in the Todos of the Readme.

from cadmium.

TobiasJacob avatar TobiasJacob commented on August 15, 2024

PS: Some of the constraints could be improved still, but I think the overall structure shouldnt change too much anymore.
Also having UI would help a lot for debugging, thats why integrating it into the code base would be helpful.

from cadmium.

hrgdavor avatar hrgdavor commented on August 15, 2024

have you considered a wasm build aswell ? for folks that would like to use this directly ?

from cadmium.

MattFerraro avatar MattFerraro commented on August 15, 2024

Excellent work @TobiasJacob! I'm marking this done and we can have other tickets for integrating into the UI more fully

from cadmium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.