POV-Ray : Newsgroups : povray.general : wheel slice of a sphere Server Time
4 Aug 2024 12:20:15 EDT (-0400)
  wheel slice of a sphere (Message 1 to 5 of 5)  
From: Mario
Subject: wheel slice of a sphere
Date: 2 Jun 2003 10:29:38
Message: <3edb5f52$1@news.povray.org>
Hello again!

Imagine wheel. Now imagine it  cut in half. That is the shape I am trying to
get.

I was able to get that shape by using taking the difference of a sphere and
some cubes, but is there an easier way?

Below is an example of how I do it now, hopefully there is a better way


// file begin

#version 3.5;

#include "colors.inc"
#include "textures.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

// ----------------------------------------

camera {
  location  <5.5, 4, -20>
  look_at   <5.5, 4, -10>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {               // checkered floor
  y, -2.5
  texture
  {
    pigment {
      checker
      color rgb 1
      color blue 1
      scale 0.5
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}


difference {
    sphere {              // reflective sphere
      <5.5, 4, -10>, 2.5
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // bottom box
    box {
        <3, 1.5, -12.5>
        <8, 4,  -7.5>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // front box
    box {
        <3, 4, -12.5>
        <8, 6.5, -10.125>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // back box
    box {
        <3, 4, -9.875>
        <8, 6.5, -7.5>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

}


Post a reply to this message

From: ABX
Subject: Re: wheel slice of a sphere
Date: 2 Jun 2003 10:39:20
Message: <73omdv4t3jo38s0j0hpmb67p893hklsrcm@4ax.com>
On Mon, 2 Jun 2003 10:29:39 -0400, "Mario" <ant### [at] spamcopnet> wrote:
> Hello again!
>
> Imagine wheel. Now imagine it  cut in half. That is the shape I am trying to
> get.
>
> I was able to get that shape by using taking the difference of a sphere and
> some cubes, but is there an easier way?

intersection{} of sphere{} and plane{} ?

>        texture {
>            Glass
>            scale 4      // Scale by the same amount in all
>        }

Out of curriosity what you expect from "scale 4" here ?

And since all components of difference{} have the same texture you could apply
it once at end of difference{} block.

ABX


Post a reply to this message

From: Mario
Subject: Re: wheel slice of a sphere
Date: 2 Jun 2003 10:50:23
Message: <3edb642f$1@news.povray.org>
"ABX" <abx### [at] abxartpl> wrote in message
news:73omdv4t3jo38s0j0hpmb67p893hklsrcm@4ax.com...
> On Mon, 2 Jun 2003 10:29:39 -0400, "Mario" <ant### [at] spamcopnet>
wrote:
> > Hello again!
> >
> > Imagine wheel. Now imagine it  cut in half. That is the shape I am
trying to
> > get.
> >
> > I was able to get that shape by using taking the difference of a sphere
and
> > some cubes, but is there an easier way?
>
> intersection{} of sphere{} and plane{} ?

I think that would be more like a hemisphere. What I wanted was a slice of
that. Hmm... like a lemon wedge slice or orange slice


>
> >        texture {
> >            Glass
> >            scale 4      // Scale by the same amount in all
> >        }
>
> Out of curriosity what you expect from "scale 4" here ?

I'm not sure....I think that was just copied from code somewhere else. Maybe
something off of the POVRay "Insert" submenu...


> And since all components of difference{} have the same texture you could
apply
> it once at end of difference{} block.

That's good to know! Thanks!


Post a reply to this message

From: ABX
Subject: Re: wheel slice of a sphere
Date: 2 Jun 2003 10:53:46
Message: <23pmdv4o26ijgv0rq1u8kvtgnb5c4i7tdc@4ax.com>
On Mon, 2 Jun 2003 10:50:23 -0400, "Mario" <ant### [at] spamcopnet> wrote:
> I think that would be more like a hemisphere. What I wanted was a slice of
> that. Hmm... like a lemon wedge slice or orange slice

then put intersection between sphere and box, like:

intersection{
  sphere{0 1}
  box{<-.5,-1,-1><-.4,1,1>}
  pigment{rgb 1}
}

ABX


Post a reply to this message

From: Tim Attwood
Subject: Re: wheel slice of a sphere
Date: 3 Jun 2003 06:07:15
Message: <3edc7353@news.povray.org>
Maybe you should look at superellipsoids....

difference {
  superellipsoid {  <1, 0.5>
    scale z/2 
  }
  plane {y,0 rotate z*30}
  plane {y,0 rotate -z*30}
  pigment {Red}
  rotate <0,45,0>
}


// ----- Tim Attwood -----
light_source{-10 color rgb 1}#local T=6*z-3*x;#local I=T;#local 
M=0;#local A=
array[10]{1287709,43035510,7312399,36346003,50603446,6192184,12772732,33037915,
41777870,42384480}union{#while(M<99)#local 
N=int(mod(A[div(M,10)]/pow(6,(9-mod(
M,10))),6));#local 
I=I+((N=0)-(N=1))*y/2+((N=3)-(N=2))*x/2;#if(N=4)sphere{T.1}
cylinder{T,I,.1}#end#local T=((N>3)?I:T);#local M=M+1;#end pigment{rgb x+y}}


Post a reply to this message

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