Results 1 to 19 of 19

Thread: Converting XYZ file into power map

  1. #1
    Bad address email on file
    Join Date
    Jan 2005
    Location
    France, Paris
    Occupation
    Lens Manufacturer
    Posts
    10

    Converting XYZ file into power map

    Does anybody know a way (software, formula...) to convert such a lens descrition:
    - an xyz file for the back side (the one used by a freeform generator for exemble)
    - a radius for the front side
    - a center thikness (and prism)
    - a refractive index

    into a maps of powers and axis?


    Fred

  2. #2
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    you are looking for a way to convert the files cartesian coordinates to polar coordinates. Yes it can be done and should be fairly staright forward, if you get me an example of the file I will see if I can work up some of the formulas and maybe even some software for you.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  3. #3
    Bad address email on file
    Join Date
    Jan 2005
    Location
    France, Paris
    Occupation
    Lens Manufacturer
    Posts
    10
    Harry,

    I'm realy happy to hear that you may help me... but in the same way i don't understand why you speak about polar coordonate...
    is there a direct link between the back vertex power and the polar coordonate???

    Anyway, i try to find some files to give you...

    ...hope it will work

    Fred

  4. #4
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    Their are two ways to look at the curvature,

    {x, y, z} also known as point files
    - or -
    {r, theta, z} wich is what in the optical business we use

    r=radius
    theta=angle
    z=thickness

    I always get them backwards, we are wanting to convert from polar to cartesian

    x=r * cos(theta)
    y=r * sin(theta)
    z=r^2 - [r^2 - (d/2)^2]^1/2

    this is off the top of my head and I can check it for you when I get home.
    Last edited by HarryChiling; 09-08-2006 at 06:32 PM.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  5. #5
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    You would probably have to construct bivariate interpolating polynomials (e.g., splines) for the surface height data and then calculate the partial derivatives of those polynomials in order to determine the various aspects of surface curvature for any arbitrary point on the lens (including the mean curvature, surface astigmatism, and axis). However, this kind of numerical analysis is not trivial.

    To display the final curvature information as a "power map" -- or contour plot -- your best bet would be to find some off-the-shelf cartography software or some code chunks for producing contour plots in the software language you're using to develop this.
    Darryl J. Meister, ABOM

  6. #6
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    I had thought about splines for determining the power, however I am not sure which 3 point to consider for determining the power and parabola with. Would it be the two points next to the point being determinined or two points at the extreme edges. Or do you think using a two point and their derivatives to determine a cubic would fit this problem better.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  7. #7
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    What if the 3 points used to calculate the power were based on the average pupil size imitating the amount of light that will enter the eye in the one area, if this was used to determine the parabola for a specific point in the lens. What do you think Darryl, would this be feasable or would I be missing something?
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  8. #8
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    I think Fred is looking to produce a contour plot of the entire surface, not just the power at a specific point.

    Also, if you're using adequate interpolating functions, you wouldn't necessarily need to choose a number of points to evaluate curvature. You could calculate the curvatures at any point directly. However, if you wanted to simulate the power as measured by an optical system with an aperture, such as the human eye (~4 mm) or a typical focimeter (~7 mm), you could "average" the curvatures over a finite region of the lens using a few selected points.
    Darryl J. Meister, ABOM

  9. #9
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    Quote Originally Posted by Darryl Meister
    However, if you wanted to simulate the power as measured by an optical system with an aperture, such as the human eye (~4 mm) or a typical focimeter (~7 mm), you could "average" the curvatures over a finite region of the lens using a few selected points.
    This was my thought on what he may have wanted, for a contour plot wouldn't al the data you would need be present in a point file for a contour plot. My assumtion would be that all you would need at this point is some graphical representation of of the x, y, and z axises like a 3 dimensional graph. All the data points should be available in the point file. I am doing alot of assuming. Does anyone have a point file that I could look at?
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  10. #10
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    This was my thought on what he may have wanted, for a contour plot wouldn't al the data you would need be present in a point file for a contour plot.
    A contour plot of X,Y,Z surface height data wouldn't be a map of power though, it would be a map of sagittal values -- which wouldn't be particularly meaningful to most users. He is apparently wanting to convert surface height data into a contour plot of power across the lens, in which case you'd need to calculate the curvatures first.

    (I noticed in another thread by Fred that he is the sales manager for lens mapping equipment marketed mainly to free-form progressive lens processors.)
    Darryl J. Meister, ABOM

  11. #11
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    A contour plot of X,Y,Z surface height data wouldn't be a map of power though, it would be a map of sagittal values -- which wouldn't be particularly meaningful to most users. He is apparently wanting to convert surface height data into a contour plot of power across the lens, in which case you'd need to calculate the curvatures first.
    How would you calculate the curvatures without having a few points to reference, am i missing something or are we talking in circles?

    Even a lens clock uses 3 points to determine the curvature. My thought is for the power is to take a given reference point that we want to measure and evaluate 2 points along a meridian 2mm apart from the reference points in opposite directions. Evalute the lowest points and the meridian they lie on and the highest points and the meridian they lie on. These meridians would be the axis. The two points would be used to calculate the power at that point by converting the sag back to a radius and then power. Since it can all be automated by computer even if this s the long way of doing it it is possible right? Would that accomplish getting the power at that given point? Does anyone have a point file I can mess with please?
    Last edited by HarryChiling; 09-10-2006 at 06:38 PM.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  12. #12
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    Even a lens clock uses 3 points to determine the curvature. My thought is for the power is to take a given reference point that we want to measure and evaluate 2 points along a meridian 2mm apart from the reference points in opposite directions. Evalute the lowest points and the meridian they lie on and the highest points and the meridian they lie on.
    A lens clock uses 3 points to determine curvature through one meridian, and even then it assumes a spherical surface (so it wouldn't work particularly well for a rapidly changing surface, such as a progressive).

    Secondly, what you're suggesting could only be used to describe the power in the center of the lens with enough peripheral points to evaluate a sufficient number of meridians. You couldn't calculate the curvatures at any arbitrary point on the surface in this manner, with heights from only a few points, because it is unlikely that those points would represent the "highest" and "lowest" surface height values around that point.

    All you could really do is approximate the average curvature. For instance, if you take a toric surface at axis 45, and measure points at equal distances to the right of, left of, above, and below the center, you will get identical sag values, which might otherwise suggest a spherical surface.
    Darryl J. Meister, ABOM

  13. #13
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    Harry, To clarify, I am referring to the use of splines to calculate the curvature at any arbitrary location across the lens surface (that is, a point not necessarily lying on one of the X,Y points supplied in the data file). You would still need to do some numerical calculations for each point available from the data file, using many surrounding points, in order to determine the derivatives used for fitting the splines. This might be what you were thinking...
    Last edited by Darryl Meister; 09-11-2006 at 02:28 AM.
    Darryl J. Meister, ABOM

  14. #14
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    Harry, To clarify, I am referring to the use of splines to calculate the curvature at any arbitrary location across the lens surface (that is, a point not necessarily lying on one of the X,Y points supplied in the data file). You would still need to do some numerical calculations for each point available from the data file, using many surrounding points, in order to determine the derivatives used for fitting the splines. This might be what you were thinking...
    We are talking about the same thing, I think. If I get you you are saying use the points available to interpolate new data points. These data points will help to determine the meridians of highest and lowest power.

    Darryl It would not be to difficult because I am not trying to invent the wheel on this one. There is already a defined function for doing this. Check this link out http://www.petdb.org/PetroPlot/ , my thoughts was to use this function to create all the missing data points I would need to calculate the power at any given point. I would have much rather done it than talked about it, but it seems like this guy is not interested anymore anyway and I have much better things to do anyway. I do appreciate picking your brain Darryl, thanks again.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  15. #15
    Underemployed Genius Jacqui's Avatar
    Join Date
    Oct 2003
    Location
    Frostbite Falls, Mn.
    Occupation
    Optical Wholesale Lab (other positions)
    Posts
    7,417
    Will this work to plot lens curves?? How about sphero-cylinders??

  16. #16
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    There is already a defined function for doing this.
    You can actually get these functions from most texts on numerical analysis, and there are also many routines available from C libraries and that sort of thing. However, I don't know that this Petro plot code converts data into curvature measurements...?
    Darryl J. Meister, ABOM

  17. #17
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    I had a closer look at that website. It appears (I'd have to run the software to know for certain) that it estimates the derivatives for you. However, the bad news is that it seems to only interpolate in one dimension, which wouldn't make it very useful for lens mapping.
    Darryl J. Meister, ABOM

  18. #18
    ATO Member HarryChiling's Avatar
    Join Date
    Apr 2005
    Location
    Nowhereville
    Occupation
    Other Eyecare-Related Field
    Posts
    7,765
    Quote Originally Posted by Darryl Meister
    I had a closer look at that website. It appears (I'd have to run the software to know for certain) that it estimates the derivatives for you. However, the bad news is that it seems to only interpolate in one dimension, which wouldn't make it very useful for lens mapping.
    I don't know how effective it would have been for the problem at hand, but I did like the thought of a challenge. I am not sure the details of how the thing runs, but it does get you the derivatives, and again with a little more coding I was hoping to expand on it. I have been wanting to get my hands on a point file for a while just to play around with, this presented an opportunity that was the only reason why I was so interested in it.
    1st* HTML5 Tracer Software
    1st Mac Compatible Tracer Software
    1st Linux Compatible Tracer Software

    *Dave at OptiVision has a web based tracer integration package that's awesome.

  19. #19
    Master OptiBoarder Darryl Meister's Avatar
    Join Date
    May 2000
    Location
    Kansas City, Kansas, United States
    Occupation
    Lens Manufacturer
    Posts
    3,700
    You would need a lot more coding for bicubic splines. But there are numerical recipes out there for this sort of thing. After thinking a little more about it, if his original point file contains regularly spaced heights over a rectangular grid, it would probably be more trouble than it's worth to use splines for this application. You could still base your contour plotting on points available from the file; the point spacing is probably sufficiently small anyway. Though you would still have to estimate the derivatives at each point (for calculating curvatures) using numerical techniques.
    Darryl J. Meister, ABOM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Converting eyesight test results
    By Fionnán in forum General Optics and Eyecare Discussion Forum
    Replies: 5
    Last Post: 03-21-2006, 05:52 PM
  2. Converting SAG formula to a base curve
    By lensgrinder in forum Ophthalmic Optics
    Replies: 19
    Last Post: 10-25-2005, 09:12 PM
  3. Varilux Liberty: Converting the bifocals?
    By ilanh in forum Progressive Lens Discussion Forum
    Replies: 15
    Last Post: 07-21-2005, 12:41 PM
  4. Converting Data into Information
    By Optical Plumber in forum Optical Marketplace
    Replies: 0
    Last Post: 01-22-2003, 11:07 AM
  5. Converting sags to radii to dioptric powers...
    By Pete Hanlin in forum Ophthalmic Optics
    Replies: 5
    Last Post: 07-26-2002, 11:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •