How to use the raytracing.abcd.ImagingPath function in raytracing

To help you get started, we’ve selected a few raytracing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DCC-Lab / RayTracing / raytracing / abcd.py View on Github external
width=0.1, fc='g', ec='g',
                head_length=arrowHeight, head_width=arrowWidth,
                length_includes_head=True)
            axes.arrow(position, -size-arrowSize, 0, arrowSize,
                width=0.1, fc='g', ec='g',
                head_length=arrowHeight, head_width=arrowWidth,
                length_includes_head=True)


""" Synonym of Matrix: Element 

We can use a mathematical language (Matrix) or optics terms (Element)
"""
Element = Matrix
Group = MatrixGroup
OpticalPath = ImagingPath
github DCC-Lab / RayTracing / raytracing / abcd.py View on Github external
def drawBeamTrace(self, axes, beam):
        """ Draw beam trace corresponding to input beam 
        Because the laser beam diffracts through space, we cannot
        simply propagate the beam over large distances and trace it
        (as opposed to rays, where we can). We must split Space() 
        elements into sub elements to watch the beam size expand.
        
        We arbitrarily split Space() elements into 100 sub elements
        before plotting.
        """

        highResolution = ImagingPath()
        for element in self.elements:
            if isinstance(element, Space):
                for i in range(100):
                    highResolution.append(Space(d=element.L/100, 
                                                n=element.frontIndex))
            else:
                highResolution.append(element)


        beamTrace = highResolution.trace(beam)
        (x, y) = self.rearrangeBeamTraceForPlotting(beamTrace)
        axes.plot(x, y, 'r', linewidth=1)
        axes.plot(x, [-v for v in y], 'r', linewidth=1)
github DCC-Lab / RayTracing / raytracing / abcd.py View on Github external
def ImagingPath(self):
        return ImagingPath(elements=self.elements, label=self.label)
github DCC-Lab / RayTracing / raytracing / abcd.py View on Github external
self.fanNumber = 9         # number of rays in fan
        self.rayNumber = 3         # number of points on object

        # Constants when calculating field stop
        self.precision = 0.001
        self.maxHeight = 10000.0

        # Display properties
        self.showObject = True
        self.showImages = True
        self.showEntrancePupil = True
        self.showElementLabels = True
        self.showPointsOfInterest = True
        self.showPointsOfInterestLabels = True
        self.showPlanesAcrossPointsOfInterest = True
        super(ImagingPath, self).__init__(elements=elements, label=label)

raytracing

Simple optical ray tracing library to validate the design of an optical system (lenses positions and sizes, focal lengths, aperture and field stops). Support for Monte Carlo raytracing to estimate transmission efficiency and powers, limited but functional Zemax file loader for lenses, several material dispersion curves included for chromatic aberrations all coming from http://refractiveindex.info

MIT
Latest version published 3 months ago

Package Health Score

64 / 100
Full package analysis