[HN Gopher] Inkscape Ray Tracing - an extension for Inkscape to ...
       ___________________________________________________________________
        
       Inkscape Ray Tracing - an extension for Inkscape to draw optical
       diagrams
        
       Author : app4soft
       Score  : 217 points
       Date   : 2021-02-05 12:53 UTC (1 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | dekhn wrote:
       | Could you use this to rough out a Koehler illumination? I'm
       | playing with UC2 (https://github.com/bionanoimaging/UC2-GIT) and
       | one of the projects is to build a KI scope
       | (https://github.com/bionanoimaging/UC2-GIT/tree/master/TheBOX...)
       | leading up to abbe experiment.
       | 
       | I mainly want to be able to plug in different objective lens
       | strengths and experiment with the overall system geometry.
        
         | damienbloch wrote:
         | I'd like to to add simple tools someday (like ABCD matrices
         | along a beam). But at some point it's probably better to switch
         | to more evolved softwares, like the ones mentioned in the
         | thread
        
           | app4soft wrote:
           | JFTR, A simple ray tracing showing the concept of Koehler
           | illumination.[0]
           | 
           | [0] https://www.researchgate.net/figure/A-simple-ray-tracing-
           | sho...
        
         | app4soft wrote:
         | > _Could you use this to rough out a Koehler illumination?_
         | 
         | Please, ask extension dev via issues tracker.[0]
         | 
         | UPD: Dev is here now![1]
         | 
         | [0] https://github.com/damienBloch/inkscape-raytracing/issues
         | 
         | [1] https://news.ycombinator.com/user?id=damienbloch
        
       | daniellarusso wrote:
       | So, I do not personally have a use for this, but I have always
       | wanted to see how to make an Inkscape plugin and this is an
       | excellent example.
       | 
       | Thank you!
        
       | Terretta wrote:
       | Not adding anything to _this_ conversation, but...
       | 
       | Such a delightful find, thank you for sharing!
        
       | prennert wrote:
       | Wow this is very cool.
       | 
       | I am sorry to hijack this thread to ask a related question. Does
       | anyone know if libraries or programs exist that can model light
       | rays in 3D for objects without circular base, for instance for
       | modelling head lamps on cars and such?
        
         | danioli wrote:
         | I vaguely remember reading about a job that required Open
         | Cascade, to do this (designing optics for automotive
         | applications), if that's what you're seeking. Company was
         | called DBM Reflex in Laval, QC I'm sure other tools (ie. game
         | engines) will also allow you to model all types of optical
         | effects.
        
         | app4soft wrote:
         | > _Does anyone know if libraries or programs exist that can
         | model light rays in 3D for objects without circular base, for
         | instance for modelling head lamps on cars and such?_
         | 
         | I guess there are already such addons for _Blender_ app, but I
         | 'm not sure what exactly you need, so it would be better to ask
         | such question in _Blender Community places_ [0].
         | 
         | Take a look on those two.[1,2]
         | 
         | [0] https://www.blender.org/community/
         | 
         | [1] https://github.com/CodeFHD/OptiCore
         | 
         | [2] https://github.com/TobiasNils/Ray-Optics-Analyzer
        
       | Farfignoggen wrote:
       | That's not actually Ray Tracing as that supports only a single
       | ray sample that's not used to produce a rasterized realistic
       | Image but is instead for creating a diagram of a Ray Path on a 2D
       | simulated Optical experiment Table.
       | 
       | It's only tracing a Path in 2D and for visualizing the ray path
       | and not really using that for actual AO, Shadow, Ambient
       | Occlusion, etc on a 3D Image for realistic image production.
       | 
       | It's a nice tool for the Optical Experimenters out there to
       | Produce SVG based Graphical representations for Publishing their
       | works in Optics/Related fields but that's not Ray Tracing in the
       | way that's used in say Blender 3D's Cycles Rendering(On CPU core
       | or GPU Shader Cores) where photo realistic Images are Produced
       | Using Simulated Rays in a simulated 3D environment/Scene.
        
         | jazzyjackson wrote:
         | Perhaps it is the 3D artists that are using the term
         | incorrectly. Or maybe the term can have more than one meaning.
        
         | Keyframe wrote:
         | That's exactly ray tracing in original and all-purpose meaning
         | and sense what this is about.
        
         | analog31 wrote:
         | I do optics design, and use "ray tracing" to analyze optical
         | systems -- lenses, mirrors, etc. So imagine my surprise when I
         | see a link for "ray tracing," and it's some graphical rendering
         | that I can't fathom or use.
         | 
         | It is actually the same thing, but applied to different areas
         | of interest. In both cases it uses equations from physics to
         | form a simulation of light propagation that is accurate enough
         | under certain conditions.
         | 
         | Optical ray tracing predates the computer age, so people
         | learned analysis techniques that required tracing a bare
         | minimum number of rays. In fact you can learn a lot about a
         | simple system by tracing just two rays. For this reason, ray
         | diagrams shown in optics designs tend to show relatively few
         | rays.
         | 
         | But every optics designer wishes we could have the same cool
         | tools as the graphics people, but with the analysis features
         | that we need.
        
       | xrd wrote:
       | Inkscape traces images and converts them to SVG, right? Can this
       | be scripted from the command line? I want to convert a line
       | drawing into an SVG.
        
         | LukeShu wrote:
         | Inkscape's tracing functionality uses the `potrace` command
         | line program.
        
           | mkl wrote:
           | There is also autotrace:
           | https://github.com/autotrace/autotrace
        
       | azalemeth wrote:
       | As an academic, this is _exactly_ the kind of tool that is
       | perfect for teaching and making exam questions with the minimum
       | of fuss. Thank you for doing it, and thank HN for bringing it to
       | my attention!
        
         | app4soft wrote:
         | JFTR, Also take a look on _Astree_ [0] & _Foucault2_ [1].
         | 
         | [0] https://github.com/edeforas/Astree
         | 
         | [1] https://github.com/edeforas/Foucault2
        
       | [deleted]
        
       | buildbot wrote:
       | Could this be used as a simple lens designer? Or are there better
       | programs for than?
        
         | app4soft wrote:
         | > _Could this be used as a simple lens designer? Or are there
         | better programs for than?_
         | 
         | Take a look on _Etienne de Foras '_[0] _Astree_ [1] (an amateur
         | telescope making FLOSS app to help with optical design and
         | optimisation) and on _Foucault2_ [2] (an amateur telescope
         | making FLOSS app to help with mirror design and polishing).
         | 
         |  _Astree_ in most cases is enough alternative to proprietary
         | _Zemax_ (+ Astree already support ZMX file format).[3]
         | 
         | [0] http://edeforas.free.fr/?cat=6
         | 
         | [1] https://github.com/edeforas/Astree
         | 
         | [2] https://github.com/edeforas/Foucault2
         | 
         | [3] https://github.com/edeforas/Astree/issues/28
        
         | hutzlibu wrote:
         | Speaking about it, has anyone experience using a laser cutter
         | to create fresnel lens, out of transparent plastic?
         | 
         | At some point I want to do this, and this plugin might seem
         | helpful.
        
         | ginko wrote:
         | > Or are there better programs for than?
         | 
         | There's the rayopt[1] Python library. You can find a repo of
         | notebooks modelling a bunch of lenses from the original patents
         | here[2]. I've played around a bit with that myself, modelling a
         | Voigtlander Color-Skopar.
         | 
         | [1] https://github.com/quartiq/rayopt [2]
         | https://github.com/quartiq/rayopt-notebooks
        
         | iFreilicht wrote:
         | Seems like it, rays seem to be accurately refracted between
         | object boundaries, depending on the optical index you set for
         | that object. Pretty cool!
        
       | damienbloch wrote:
       | Happy to know it can be useful! Just keep in mind that it's still
       | fairly bugged for an extensive usage. Because the issue is maybe
       | with the way Inkscape handles python extensions, it might take a
       | bit before it'll be stable.
        
         | rahimiali wrote:
         | I'm very excited about this. But I'm I'm also interested to
         | hear why you chose to build this instead of using Zemax's
         | sequential mode. I've written two bespoke ray tracers in my
         | career and to this day I wonder if I should have written them
         | as zemax extensions. Is it just cost?
        
           | pen2l wrote:
           | It's almost definitely cost! Zemax is what, a 5-digit price
           | for the full pack? Prohibitively expensive for anyone but
           | those deep inside the industry who really get their bang for
           | the buck.
        
           | damienbloch wrote:
           | Zemax would definitely be a more professional option, but I
           | never got the opportunity to dive into it. Also this is more
           | for quick plots than for complex optics
        
             | app4soft wrote:
             | > _Zemax would definitely be a more professional option_
             | 
             |  _Astree_ -- a FLOSS alternative to Zemax.[0]
             | 
             | [0] https://github.com/edeforas/Astree
        
         | wizzwizz4 wrote:
         | When it is, are there any plans to put it on
         | https://inkscape.org/gallery/=extension/?
        
           | damienbloch wrote:
           | If people can find a use for it, this might be a good idea.
           | But haven't discussed this yet
        
       ___________________________________________________________________
       (page generated 2021-02-06 23:01 UTC)