Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow source in tissue #59

Merged
merged 13 commits into from
Apr 30, 2022
Merged

Allow source in tissue #59

merged 13 commits into from
Apr 30, 2022

Conversation

JLBegin
Copy link
Contributor

@JLBegin JLBegin commented Apr 27, 2022

Changes

  • You can now set a world material when creating a Scene (instead of later during propagation)
  • Source can be positioned anywhere in the scene. Photon context will be automatically initialized with the correct environment.
  • Added simple source graphic (shere) showed by default on Stats 3D displays

Implementation details

  • Moved world material context out of source.propagate and into Scene
  • Source environment is determined when starting propagation by asking the scene what is the environment at the source position (uses a special algo when dealing with stacks).
  • Stats now adds the source photonCount to a solid's total input energy when the source is contained in it.

Example

Showing a few graphs from rayscattering/example.py with source positioned at Vector(0, 0, 0.3).
snap_3d_source

snap_3dsurfaces_source
snap_1d_source

Report of solid 'frontLayer'
  Absorbance: 42.4% (43.2% of total power)
  Absorbance + Transmittance: 100.0%
    Transmittance at 'interface1': 56.1%
    Transmittance at 'front': 0.9%
    Transmittance at 'top': 0.2%
    Transmittance at 'left': 0.2%
    Transmittance at 'bottom': 0.1%
    Transmittance at 'right': 0.2%
Report of solid 'middleLayer'
  Absorbance: 51.8% (30.2% of total power)
  Absorbance + Transmittance: 100.0%
    Transmittance at 'interface1': 3.2%
    Transmittance at 'bottom': 0.3%
    Transmittance at 'interface0': 44.0%
    Transmittance at 'right': 0.3%
    Transmittance at 'left': 0.2%
    Transmittance at 'top': 0.2%
Report of solid 'backLayer'
  Absorbance: 67.9% (17.4% of total power)
  Absorbance + Transmittance: 100.0%
    Transmittance at 'interface0': 4.9%
    Transmittance at 'back': 23.2%
    Transmittance at 'top': 0.8%
    Transmittance at 'right': 0.9%
    Transmittance at 'bottom': 1.2%
    Transmittance at 'left': 1.2%

@JLBegin JLBegin requested a review from PyMarc2 April 27, 2022 21:59
@JLBegin JLBegin self-assigned this Apr 27, 2022
@JLBegin JLBegin changed the base branch from fast-logger to scene-dev April 30, 2022 16:57
@JLBegin JLBegin merged commit cdbec1a into scene-dev Apr 30, 2022
@JLBegin JLBegin deleted the source-in-tissue branch April 30, 2022 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants