Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Lenslet-Assignment #352

Merged
merged 63 commits into from
Jan 24, 2022
Merged

Lenslet-Assignment #352

merged 63 commits into from
Jan 24, 2022

Conversation

BrianGun
Copy link
Contributor

@BrianGun BrianGun commented Jan 23, 2022

Pull Request Template

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration(s):

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Fixes #336

changed hcat([0,0]) to [0;0;;] in draw functions for LatticeCluster and ClusterWithProperties. Also changed draw(::LatticeCluster) function to have the scale argument come last so the two cluster draw functions are consistent.
Fixes #336

adding code to setup lenslet system.
Fixes #336

Wrapped the SMatrix for Transform in a new Transform struct. The old type alias Transform{T} = SMatrix{4,4,T,16} was causing subtle bugs. Should have left it the way @galran initially wrote it.
…form module in several files. Replaced them all with Transform.
…I. Made sure all Transform,Transform{T} calls inside Transform.jl were correct usage.
added license to LensletAssignment
… was not including the size of the underlying element basis.
… since they provide generic functionality for any lattice.
…function for assigning names to lattice elements
…ion. Will do hex7,hex19,hex37, etc. all regions of n neighbors of (0,0).
working on setup_system which assigns lenslet fov and color
…ement coordinates.

Changed choosecluster to return latticediameter*lensletdiameter to give the physical dimensions of the lattice cluster.

added hex37 cluster size to anglesubdivisions.

wrote hexn() function that returns a symmetrical hexagonal lattice consisting of the region of size n. This can be used to generate hex7,hex19,hex37
changed hex7(),hex19() use hexn()
working on adding display to lenslets in array and then arranging emitters on the display plane.
…rithm sometimes returns flips.

moved typical luminance data to HumanEye.jl where it is useful.

Fixed bugs in analysis and made pixelsperdegree be computed rather than an input parameter. Forced f# to a particular input value. Seems to be easier to examine the design space with these defaults.
renamed Lenslets module to Multilens to be more consistent with directory naming convention.
moved eye data to new Data module. This module is where we should put useful constants, measurements, etc.
… match LatticeCluster and ClusterWithProperties

added eyebox_assignment function to map tile coordinates to a subdivided eyebox.
… PlanarShape should have a plane function but it wasn't defined.

working on computing the projection of the eyebox onto the lenslet display plane.
…orting properly.

rewrote various functions in DisplayGeneration.jl to work with LeafNode instead of Spere because Sphere always has origin = (0,0,0) and it needs to be translated.

changed display_plane to put the display plane at the correct position relative to the lens.
added unzip macro to LensletAssignment.jl
…directly in the cluster struct rather than stored as a separate variable.

added euclideandiameter function to AbstractLatticeCluster interface which computes the norm of the largest lattice basis vector.
…nd for this scale to be reflected in lattice clusters.
…display planes.

fixed problem in generating lenslet normals. They were not consistently oriented so added a positive_z_direction argument to projectonbestfitplane, and planarpoly (where it is called desired_normal).

Also flipped the meaning of dir in spherepolygons() and spherelensets() to match the documentation string.
Added LensletSystem to encapsulate all the data describing a complete system of lenslets.
fixed error in system_properties in creation of Dict

added more examples in Multilens/Example.jl and improved documentation on same.
fixed bug in compute_optical_center in LensletAssignment.jl. Was computintg the ray from the display center to the eyeboxcentroid, should have been from the lenslet center to the eyeboxcentroid.

Added more extensive documentation to many function sin LensletAssignment.jl

attempted to change the mouse rotation speed for visualization but didn't work.

added testset for ParaxialLens to make sure rays refract properly regardless of which direction they approach the lens from.
… transform information is being stored. This was confusing, especially since other Paraxial lenses don't have a local transform.

added code to test compute_optical_center and replace_optical_center which both appear to be working, even though incorrect results are being generated in the multilens system creation. Maybe a problem with the local transform for the lens.

eliminated redundant replace_optical_center function

moved test_replace_optical_center to Example.jl where it belongs.
…tly onto eyebox plane. Computed optical center of lenslet using the center of the display plane, but this is not the center of the eyebox projected into the displayplane. Once the optical center was computed using the centroid of the projected eyebox it worked properly.

changed compute_optical_center so it wouldn't cause setup_system to crash if the displaced optical center was outside of the lenslet shape.
…oject. The beamenergy function should be moved elsewhere, it's of more use than for repeating structures.
…sembly. Everything seems to be fixed now except the processintersection function for paraxial lenses. This is a long standing error that has nothing to do with LensletAssembly.jl.
…itive and negative focal lengths and for rays intersecting the surface at any angle.
@BrianGun BrianGun requested a review from galran January 23, 2022 23:04
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2022

Codecov Report

Merging #352 (7edc0b2) into main (b0cc2cc) will increase coverage by 0.35%.
The diff coverage is 6.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #352      +/-   ##
==========================================
+ Coverage   52.03%   52.38%   +0.35%     
==========================================
  Files          84       81       -3     
  Lines        8041     7763     -278     
==========================================
- Hits         4184     4067     -117     
+ Misses       3857     3696     -161     
Impacted Files Coverage Δ
src/Data/HumanEye.jl 0.00% <0.00%> (ø)
src/Examples/eyemodels.jl 0.00% <ø> (ø)
src/Geometry/Primitives/NonCSG/ConvexPolygon.jl 61.53% <ø> (+2.38%) ⬆️
src/Geometry/Primitives/NonCSG/PlanarShape.jl 60.00% <0.00%> (-15.00%) ⬇️
src/Geometry/Primitives/Plane.jl 75.00% <0.00%> (-1.37%) ⬇️
src/Geometry/Ray.jl 43.75% <ø> (ø)
src/OpticSim.jl 87.50% <ø> (-1.39%) ⬇️
src/Optical/LensAssembly.jl 73.07% <ø> (+0.68%) ⬆️
src/RepeatingStructures/Lattice.jl 16.66% <0.00%> (-4.31%) ⬇️
src/RepeatingStructures/Multilens/Analysis.jl 0.00% <0.00%> (ø)
... and 70 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0cc2cc...7edc0b2. Read the comment docs.

@BrianGun BrianGun merged commit adc956e into main Jan 24, 2022
@BrianGun BrianGun deleted the Lenslet-Assignment branch January 24, 2022 20:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants