POV-Ray : Newsgroups : povray.binaries.images : MegaPov magic trick: watch as I saw an iso in half! : MegaPov magic trick: watch as I saw an iso in half! Server Time
19 Aug 2024 06:19:47 EDT (-0400)
  MegaPov magic trick: watch as I saw an iso in half!  
From: Greg M  Johnson
Date: 2 Jan 2001 15:25:38
Message: <3A5237E4.F6F237A5@my-dejanews.com>
Using Megapov, I present a collection of three images:
1) the first is a union of five spheres at +/- xyz  unioned with a
parametric surface (the superellipsoid equation for a sphere of radius
1).
2) I then union this union with a small brown box.
3) I then difference union #1 minus the small brown box.

Voila!  I have cut through the parametric surface without cutting
through the spheres! At no time does the brown box cut through spheres
at <0,0,0> nor <0,0,1>!  (It does cut through the back half of sphere at
<0,0,-1>, if you observe closely).

(If this is a known phenomenon, sorry for the bother.)


----------------------------------------------------
#version unofficial MegaPov 0.5;
#include "colors.inc"
camera  {
        location <0,1.8,-8>
        look_at <0,0,0>
        angle 26
        }

light_source{<-70,1500,-1200>rgb 1.55}

#declare rx=1;
#declare ry=1;
#declare rz=1;

#declare n1=1;
#declare n2=1;


  //union{                        //UNCOMMENT OUT THIS LINE!, then
  //difference{                     //UNCOMMENT OUT THIS LINE!

union{
        sphere {<0,0,0>,0.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {<-1,0,0>,.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {< 1,0,0>,.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {<0,-1,0>,.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {<0, 1,0>,.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {<0,0,-1>,.1 pigment {Yellow} finish{ambient 0.3}}
        sphere {<0,0, 1>,.1 pigment {Yellow} finish{ambient 0.3}}

        parametric {
                function
                rx*(cos(u)^n1)*(cos(v)^n2),
                ry*(cos(u)^n1)*(sin(v)^n2),
                rz*(sin(u)^n1)
                <-pi,-pi>, <pi,pi>
                <-2,-2,-2>, <2,2,2>
                accuracy 0.001
                ////////precompute 15, [x, z]
                pigment{SeaGreen*0.8}
                finish{ambient 0.3}
                rotate <90,0,0>
        }
}

//UNCOMMENT OUT THE NEXT TWO LINES!
    //    box{<-0.5,-0.5,-0.5>,<0.5,0.5,-1.0>        pigment
{Brown}        }
     // }

light_source{<-70,1200,-120>rgb 1.}
light_source{<88,-200,-50>rgb .3}

background{White/2.7+Blue/2}


Post a reply to this message


Attachments:
Download 'csgparametric.jpg' (12 KB)

Preview of image 'csgparametric.jpg'
csgparametric.jpg


 

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