Skip to content

Instantly share code, notes, and snippets.

@thecodewarrior
Last active May 12, 2018 20:25

Revisions

  1. thecodewarrior revised this gist May 12, 2018. No changes.
  2. thecodewarrior renamed this gist May 12, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. thecodewarrior created this gist May 12, 2018.
    88 changes: 88 additions & 0 deletions falstadWavePoolFormat.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,88 @@
    http://www.falstad.com/ripple/Ripple.html

    the format for the import/export from text

    $ 1 <resolution> <A> ? <wave type> <brightness> <scale factor>
    // World start, each side is <resolution> units long
    // <resolution>/<A> ~= 8
    // 65.2*<scale factor> ~= world side length


    // <start X> <start Y>: the origin of the object
    // <end X> <end Y>: the end point or opposite corner of the object, whichever applies
    // <rotation> is the angle in radians with 0 being up normal/mouse above object, with positive angles moving counter-clockwise

    w ? <start X> <start Y> <end X> <end Y>
    // wall

    203 ? <start X> <start Y> <end X> <end Y> <slit count> <slit width> <slit separation>
    // slit

    b ? <start X> <start Y> <end X> <end Y> <rotation>
    // box

    s ? <X> <Y> <type> <wavelength factor> <phase> <length> <delay>
    // point source
    // <phase> = phase offset in radians
    // wavelength = 30/<wavelength factor> * <scale factor>
    // <type>: 0 = sine, 1 = pulse, 2 = packet

    S <gaussian> <start X> <start Y> <end X> <end Y> <type> <wavelength factor> <phase> <length> <delay>
    // line source
    // <gaussian>: 0 = false, 1 = true
    // <phase> = phase offset in radians
    // wavelength = 30/<wavelength factor> * <scale factor>
    // <type>: 0 = sine, 1 = pulse, 2 = packet

    200 ? <X> <Y> <first source X> <first source Y> <type> <wavelength factor> <phase> <length> <delay> <source count>
    // multi-pole source
    // <first point X/Y> = position of one of the sources. other positions are inferred by rotating this around the object origin
    // <phase> = phase offset in radians
    // wavelength = 30/<wavelength factor> * <scale factor>
    // <type>: 0 = sine, 1 = pulse, 2 = packet

    201 ? <start X> <start Y> <end X> <end Y> <type> <wavelength factor> <phase offset 1> <length> <delay> <phase offset 2>
    // phased array source
    // <phase> = phase offset in radians
    // wavelength = 30/<wavelength factor> * <scale factor>
    // <type>: 0 = sine, 1 = pulse, 2 = packet

    202 ? <start X> <start Y> <end X> <end Y> <rotation> ?
    // solid box

    W ? <start X> <start Y> <end X> <end Y> <rotation> <move duration> <pause duration>
    // moving wall

    d ? <start X> <start Y> <end X> <end Y> <type> <wavelength factor> <phase> <length> <delay> <move duration> <pause duration>
    // moving source

    c ? <start X> <start Y> <end X> <end Y> <rotation> <opening radius>

    m ? <start X> <start Y> <end X> <end Y> <rotation> <IOR factor>
    // medium
    // index of refraction = sqrt(1/<IOR factor>)

    M ? <start X> <start Y> <end X> <end Y> <rotation> <x mode> <y mode> <randomize> <draw box>
    // mode box

    g ? <start X> <start Y> <end X> <end Y> <rotation> <IOR factor 1> <IOR factor 2>
    // gradient
    // index of refraction = sqrt(1/<IOR factor>)

    e ? <start X> <start Y> <end X> <end Y> <rotation>
    // ellipse

    t ? <start X> <start Y> <end X> <end Y> <rotation> <IOR factor>
    // prism, empty corner is bottom right
    // index of refraction = sqrt(1/<IOR factor>)

    E ? <start X> <start Y> <end X> <end Y> <rotation> <IOR factor>
    // ellipse medium
    // index of refraction = sqrt(1/<IOR factor>)

    p ? <start X> <start Y> <end X> <end Y> <rotation>
    // parabola

    | ? <start X> <start Y> <end X> <end Y> <rotation> <IOR factor>
    // lens, bottom is flat
    // index of refraction = sqrt(1/<IOR factor>)