[{"data":1,"prerenderedAt":357},["ShallowReactive",2],{"project-43435438":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":41,"post_text":43,"what":44,"said":87,"maker_in_thread":185,"shape":198,"grid":203,"attempts":319,"same_week":320,"maker_shows":32,"maker_hidden":349,"reader_version":350,"card":351},"43435438","Torch Lens Maker","Differentiable Geometric Optics in PyTorch","title","Show HN: Torch Lens Maker – Differentiable Geometric Optics in PyTorch","https:\u002F\u002Fvictorpoughon.github.io\u002Ftorchlensmaker\u002F","victorpoughon.github.io","fouronnes3",1742563751,2025,179,45,373,3837,10,"notable","languages","optics simulation library","library",[24,25,26,27,28],"differentiable optics","pytorch","lens design","ray tracing","optical design","curious",0.122,{"positive":32,"neutral":33,"mixed":34,"critical":35},3,15,0,1,19,{"idea":38,"performance":39,"execution":40},{"positive":32,"critical":34},{"positive":34,"critical":34},{"positive":34,"critical":35},[34,34,34,34,34,34,34,42,34,34,32,34,32,32,34,34,32,34,32,32,34,32,34,32,32,32,34,34,32,34,32,35,34,32,34,42,34,34,34,42],5,"Hello HN! For the past 6 months I've been working on an open source python library that implements differentiable geometric optics in PyTorch. It's very experimental still, but eventually the goal is to use it to design optical systems with a state of the art optimization framework and a beautiful code based API. Think OpenSCAD, but for optical systems.\n\nNot only is PyTorch's autograd an amazing general purpose optimizer, but torch.nn (the neural network building blocks) can be used pretty much out of the box to model an optical system. This is because there is a strong analogy to be made betw",{"problem":45,"audience":54,"pricing":66,"motivation":67,"time_to_build":71,"stack":75,"openness":84,"stage":85,"team_size":86},{"value":46,"source":47,"evidence":48},"Designing optical systems such as camera lenses by optimizing surface shapes with gradient descent","maker",[49,51],{"id":50},"post",{"id":52,"by":11,"text":53},"43438991","The main application is designing optical systems. Say you want to build a camera lens. Modern camera lenses are made of multiple individual lenses, sometimes up to 12 or more…",{"value":55,"source":56,"evidence":57},"Optical designers and researchers, hobbyists interested in lens design","inferred",[58,62],{"id":59,"by":60,"text":61},"43436439","cbarrick","Neat! I've been working off and on on a similar hobby project, working through the book _Computational Fourier Optics: A MATLAB Tutorial_, and implementing it in Jax. My main…",{"id":63,"by":64,"text":65},"43436529","etik","Great work! Here's some prior art in the (torch) space: https:\u002F\u002Fgithub.com\u002Fvccimaging\u002FDiffOptics A few notes, though paraxial approximations are \"dumb\", they are very useful…",null,{"value":68,"source":47,"evidence":69},"Build a tool to design optical systems with state of the art optimization, like OpenSCAD for optics",[70],{"id":50},{"value":72,"source":47,"evidence":73},"6 months of work, mostly full time during Recurse Center batch",[74],{"id":50},[76,80],{"value":77,"source":47,"evidence":78},"Python",[79],{"id":50},{"value":81,"source":47,"evidence":82},"PyTorch",[83],{"id":50},"open_source","beta","solo",{"praise":88,"objections":105,"requests":117,"questions":144,"alternatives":159},[89,101],{"value":90,"source":91,"evidence":92},"Innovative use of PyTorch autodiff for optics","commenter",[93,97],{"id":94,"by":95,"text":96},"43435991","mhalle","It's really awesome that you've taken a widely available tool like PyTorch and used it out of domain to provide a library like this, especially one focused on exact solutions and…",{"id":98,"by":99,"text":100},"43435772","mentalgear","Very innovative application of NN architecture in a different (physics\u002Foptics) domain ! > The key idea is that there is a strong analogy to be made between layers of a neural…",{"value":102,"source":91,"evidence":103},"Exact derivatives rather than approximations",[104],{"id":94,"by":95,"text":96},[106,110],{"value":107,"source":91,"evidence":108},"Paraxial approximations are limited for lens designers",[109],{"id":63,"by":64,"text":65},{"value":111,"source":91,"evidence":112},"Stair-step 3D printed lenses would hurt optical quality",[113],{"id":114,"by":115,"text":116},"43441626","meatmanek","Unless you can get your layer height height down to small fractions of a wavelength of light (so like 50nm or less), I suspect the stairstep shape of your 3d prints will throw…",[118,130,137],{"value":119,"source":91,"evidence":120},"Diffractive optics support",[121,122,126],{"id":94,"by":95,"text":96},{"id":123,"by":124,"text":125},"43440158","Evidlo","Very cool. Do you thinking supporting diffractive optics is possible, or too much of a deviation?",{"id":127,"by":128,"text":129},"43437200","GistNoesis","Will there be some diffraction optic in the future, can we just add some phase somewhere or will it need a complete rewrite ? I'd like to experiment with photon sieves and…",{"value":131,"source":91,"evidence":132},"Stock lens catalogue matching",[133],{"id":134,"by":135,"text":136},"43436537","RobotToaster","This looks really great. Do you have any plans to add stock lens catalogue matching? To make it easier for hobbyists to manufacture lens assemblies.",{"value":138,"source":91,"evidence":139},"Interactive focus and zoom simulation",[140],{"id":141,"by":142,"text":143},"43437859","isgb","Is there any way to simulate (maybe even interactively) things like focus and zoom? It would be cool to have some way to shift lenses (or lens groups) along the optical axis and…",[145,152],{"value":146,"source":91,"evidence":147},"How far from replacing Zemax",[148],{"id":149,"by":150,"text":151},"43437480","gtsnexp","How far are we from completely replacing Zemax?",{"value":153,"source":91,"evidence":154},"Main technical challenges",[155],{"id":156,"by":157,"text":158},"43445612","MITSardine","Looks very interesting. What would you say are the main technical challenges in the way of your development? By the way, the roadmap link on the Github repo page is broken…",[160,164,175,179],{"value":161,"source":91,"evidence":162},"DiffOptics",[163],{"id":63,"by":64,"text":65},{"value":165,"source":91,"evidence":166},"Mitsuba renderer",[167,171],{"id":168,"by":169,"text":170},"43437504","pixelpoet","Surprised no one has mentioned Mitsuba renderer, in particular the caustic design demo: https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=eTHL3W2NUn0&list=PLI9y-85z_Po6da-pyTNGTns2n4fhpbLe5&index=4",{"id":172,"by":173,"text":174},"43440224","num3ric","Potential similarities with Mitsuba's inverse rendering functionality?https:\u002F\u002Fmitsuba.readthedocs.io\u002Fen\u002Fstable\u002Fsrc\u002Finverse_rendering\u002Fcaustics_optimization.html",{"value":176,"source":91,"evidence":177},"Zemax",[178],{"id":149,"by":150,"text":151},{"value":180,"source":91,"evidence":181},"rayopt",[182],{"id":183,"by":135,"text":184},"43436694","The best option I'm aware of is used by a similar (but less advanced) python library called rayopt, it imports from the free version of zemax. https:\u002F\u002Fgithub.com\u002Fquartiq\u002Frayopt",{"comments":186,"answered":187,"key":188},12,8,[189,192,195],{"id":190,"text":191},"43436560","Yes, that DiffOptics paper was one of my main inspiration for this project. It's a very cool paper. > There's also a rich history in objective function definition and quadrature…",{"id":193,"text":194},"43436919","Would love to chat with you about your project! I'm very interested in jax also. You can find my email on my website if you wanna get in touch :)",{"id":196,"text":197},"43439002","Feel free to contact me! Love to chat :) My contact info is on my website.",{"commenters":199,"max_depth":200,"maker_replies":186,"first_comment_mins":201,"lifespan_hours":202},28,4,29,243,[204,206,208,210,214,216,218,220,225,226,230,231,235,237,239,241,244,247,249,254,256,259,262,263,267,268,269,271,275,277,279,280,283,285,287,291,293,296,298,300,304,309,312,315,317],[63,34,34,205,64,34],"commenter\u002Fneutral\u002Fidea",[190,34,34,207,11,35],"maker\u002Fpositive\u002Fidea",[209,34,34,205,64,34],"43437293",[211,34,34,212,213,34],"43537095","other\u002Fneutral\u002Fnone","barrenko",[59,35,34,215,60,34],"commenter\u002Fneutral\u002Fnone",[217,35,34,215,213,34],"43436579",[193,35,34,219,11,35],"maker\u002Fneutral\u002Fnone",[221,222,34,223,224,34],"43440771",2,"other\u002Fpositive\u002Fnone","skwb",[94,32,42,207,95,34],[227,200,34,228,229,34],"43438843","commenter\u002Fpositive\u002Fidea","aaclark",[196,200,34,219,11,35],[232,42,32,233,234,34],"43436834","maker\u002Fneutral\u002Fidea","Scipio_Afri",[236,42,34,233,11,35],"43436892",[238,42,32,233,157,34],"43445552",[156,240,32,233,157,34],6,[242,240,34,243,11,35],"43445959","maker\u002Fneutral\u002Fexecution",[245,240,34,246,157,34],"43446726","commenter\u002Fneutral\u002Fexecution",[248,240,34,243,11,35],"43448428",[250,251,32,252,253,34],"43436753",7,"maker\u002Fneutral\u002Fperformance","bee_rider",[255,251,34,233,11,35],"43436833",[257,187,32,233,258,34],"43436394","qoez",[172,260,32,261,173,34],9,"project\u002Fneutral\u002Fidea",[168,18,34,212,169,34],[264,265,32,233,266,34],"43438947",11,"makizar",[52,265,34,233,11,35],[141,186,32,261,142,34],[270,186,34,233,11,35],"43437928",[272,273,32,261,274,34],"43436593",13,"viraptor",[134,276,32,261,135,34],14,[278,276,34,219,11,35],"43436581",[183,276,34,215,135,34],[281,33,32,233,282,34],"43441125","turnsout",[284,33,34,233,11,35],"43441516",[123,286,32,233,124,34],16,[288,289,32,261,290,34],"43436573",17,"TeeMassive",[114,289,35,292,115,34],"project\u002Fcritical\u002Fexecution",[294,289,34,295,290,34],"43467185","other\u002Fneutral\u002Fexecution",[149,297,32,261,150,34],18,[299,297,34,233,11,35],"43437743",[301,36,42,302,303,34],"43440010","project\u002Fpositive\u002Fidea","stormfather",[305,306,34,307,308,34],"43435812",20,"other\u002Fneutral\u002Fidea","guy234",[310,306,34,212,311,34],"43435900","Bayes7",[313,306,34,212,314,34],"43436780","Xmd5a",[127,316,32,233,128,34],21,[98,318,42,302,99,34],22,[],[321,326,331,336,340,345],{"id":322,"name":323,"points":324,"category":325},"43452629","Drum Patterns",495,"creative",{"id":327,"name":328,"points":329,"category":330},"43454915","OpenSpot",470,"productivity",{"id":332,"name":333,"points":334,"category":335},"43456030","Notes - Sight Reading Trainer",313,"learning_science",{"id":337,"name":338,"points":339,"category":20},"43451141","SlideHero",260,{"id":341,"name":342,"points":343,"category":344},"43438797","Solo Screen",196,"dev_tools",{"id":346,"name":347,"points":348,"category":344},"43445720","FastOpenAPI",153,false,"v2",{"id":352,"name":5,"line":6,"ai":349,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":353,"top":18,"kw":354,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":355,"url":9,"mix":356,"praise":90,"objection":107,"sub":21},43435438,0.12,[24,25,26,27,28],"0000000500303300303303033300303103050005",[32,33,34,35],1793991115603]