POV-Ray : Newsgroups : povray.general : Lens Design: CSG Intersection vs Lathe Object : Lens Design: CSG Intersection vs Lathe Object Server Time
29 Jul 2024 22:25:33 EDT (-0400)
  Lens Design: CSG Intersection vs Lathe Object  
From: AlexLens
Date: 14 Jun 2010 12:35:01
Message: <web.4c16590c40a0687f444cd8050@news.povray.org>
Hi all,

I'm playing around with POV-Ray to make two plano-convex lenses, at first with a
CSG intersection, and then with numerically calculated data points rotated with
a quadratic spline lathe.

The problem I'm having now is the plano-convex lens made from a sphere
intersected with a plane converges light as expected:

Image 1)    http://img193.imageshack.us/i/planoconvexjpg.jpg/

But then when I make the lens with a lathe of 1000 data points, it actually
DIVERGES light, when it should be functionally the same:

Image 2)   http://img507.imageshack.us/i/planoconvexnumericallin.jpg/

Here is the POV-Ray source code for the first image (CSG intersections)

The code for Image 2 is the same as Image 1 except with a lathe with quadratic
spline replacing the CSG intersection.

Please let me know what you all think could be the reason for this, and any
random tips as well as I'm pretty new to POV-Ray.

Thanks!!!


//--------------------------------START OF POVRAY CODE-------------------------
#include "colors.inc"
#include "textures.inc"
#include "glass.inc"

global_settings
{
    photons
    {
        spacing .01
        autostop 0
        media 100
    }
}


camera
{
      location <10,1,0>
      angle 60
      look_at <0,1,0>
}


//--------------------------------PLANO CONVEX LENS-----------------------------
#declare R   = 6.0;   //sphere radius
#declare Over= 0.0839202690038387;   //sphere overlappingg
intersection{
 sphere{<0,0,0>,R  translate <0,0,R-Over>}

 plane
 {z,0

 }

  texture
  {
    pigment {color Clear}
    finish
    {
        ambient 0

        diffuse 0
        specular 0
        roughness 0
        reflection 0

    }
  }

 interior
 {
    ior -1.5
    dispersion 1
    fade_power 0
    fade_distance 0
    fade_color <1,1,1>

 }
 photons
 {
    target
    reflection on
    refraction on
    collect off
 }
 hollow
 translate < 0,1,0>

 }

//--------------------------------LIGHT BACK STOP-------------------------------
box
{
    <5,5,.05>,<-5,-5,-.05>
    pigment
    {
        color Black
    }
    finish
    {

     phong 1
     phong_size 1
    }
    photons
    {
        collect on
    }
translate <0,1,-12.05>
}

//--------------------------------LASER LIGHT GRID------------------------------
//Provides grid of lasers to be refracted by lens

#for(j,-.7,.7,.1)
#for(i, -.7,.7,.1)
light_source
{
    <j,1+i,100>
    rgb <1,1,1>
    cylinder
    parallel
    point_at <j,1+i,0>
    //radius 1
    tightness 0
    falloff .01
    photons
    {
        reflection on
        refraction on
    }
}

#end
#end


//--------------------------------SCATTERING MEDIA------------------------------
//makes possible the visualization of light from a side angle
#declare transparent_with_media = material{
texture {pigment { White filter 1 }}
interior{
media {
method 3
intervals 1
samples 50, 1000
scattering {
1 , rgb 1*<0.1, 0.1, 0.1> // isotropic scattering
extinction 0.000001
}
}
}
}

box { <-50,-10,-50> <50,10,50>
material {transparent_with_media}
hollow
photons
{
    pass_through
}
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.