Using Python + Optimization to help my wife's sewing problem

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2024
  • In this video I go over a 2D nesting project I did for my wife involving sewing patterns.
    How the Nelder-Mead algorithm works:
    • Stats 102A Lesson 8-2 ...
    Github repository:
    github.com/MatanPazi/opt_fabr...
    Music by: www.bensound.com/free-music-f...
    License code: PCL0LB3HDJI543CA
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 5

  • @danielkruyt9475
    @danielkruyt9475 10 หลายเดือนก่อน

    Good job, I hope she's finding this useful!
    I imagine that for the optimization part, a physics-based simulation might work decently and quite quickly as well: place the objects on the quarter-plane (x,y >= 0) randomly but with the appropriate constraints on angle, apply force toward the origin on the objects + maybe some noise. Run a rigid-body physics simulation until net absolute velocity magnitudes are sufficiently small. Do simulation 10k times and pick the best final solution?

    • @matanpazi3777
      @matanpazi3777  10 หลายเดือนก่อน

      Thanks :)
      Huh, that's an interesting approach!
      I wonder how it would perform.
      You think it might even run faster compared to the optimization I used?

    • @danielkruyt9475
      @danielkruyt9475 10 หลายเดือนก่อน

      @@matanpazi3777 Due to the need for video games to run in real-time, there's been a lot of work into making (specifically 2D rigid-body) physics engines extremely fast. I believe their computational complexity per simulation step could be like O( n log m) if you've got n polygonal object with m vertices....
      I should mention that I'm guestimating this by the way, using:
      1. the fact that the graph which indicates two objects are "touching" is planar, and planar graphs have at most 3n+4 edges in an n-vertex graph, contributing the N of that product, and
      2. the fact that the algorithm (typically a modification of the GJK algorithm) for finding the "seperating vector" of two objects ie. the shortest vector such that moving two intersecting objects away from eachother along that vector seperates them, is both an optimization algorithm AND is temporally stable/continuous, so you can start with the last answer for shortest vector as a good guess and optimize rapidly, which is contributing the very-guestimated log m of that product.
      But, yeah, still guessing here. I *think* I'm close though. 2D rigid-body physics engines are very quick, the first one I can think of is Box2D, it's got constraints that can be programmed in absolutely trivially and is written in either C or C++. I don't mean to come across as uh, telling you what to do lol, sorry if that's what it seems like. So many ways to solve a problem, especially when we don't have any strong constraints to deal with, and the solution already functioning is infinitely more valuable than a theoretical one.
      Again good job! :D Looking forward to your next videos.
      Also i strongly doubt that the complexity of intersecting rasterized images would be anywhere NEAR the speed of polygonal stuff lol.

  • @anoopd512
    @anoopd512 8 หลายเดือนก่อน +1

    Sir help me❤