POV-Ray : Newsgroups : povray.binaries.images : Drinking glass Server Time
8 Aug 2024 22:17:10 EDT (-0400)
  Drinking glass (Message 1 to 4 of 4)  
From: Mienai
Subject: Drinking glass
Date: 2 Apr 2005 16:25:00
Message: <web.424f0ce56fad66ab7cf280480@news.povray.org>
As long as everyone else is posting glasswares they've made, figured I'd
join the bandwagon.  The glass is completely CSG (one of my first in fact).

#macro cup1(h,tr,br,lh)
// cup hole
#declare cup_interior=
difference {
 intersection {
  cone { // Basic interior cone shape
   <0,.5,0>, br-.25
   <0,h+.000001,0>, tr-.05
  }
  sphere { // Bottom rounding
   <0,h-1.5,0>, h-2
  }
 }
 torus { // Wall curving
  (br-.25)+h*2.77*cos(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)+pow(h,2))
   /(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05)))), h*2.77
  translate y*h*2.77*sin(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)+pow(h,2))
   /(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05))))
 }
 hollow
}
// cup
#declare cup =
merge {
 difference {
  cone { // Outer cone shape
   <0,0,0>,br
   <0,h,0>,tr
  }
  difference{ //  curve from side to base
   intersection{
    cone {
     <0,0,0>,br
     <0,h,0>,tr
    }
    plane{y,.2}
   }
   union{
    torus{br-.2,.2 translate y*.2}
    cylinder{<0,0,0>,<0,.2,0>br-.2}
   }
   translate y*-.000001
  }
  object{cup_interior}
  torus { // Outter wall curve
   br+h*2.62*cos(pi-acos(sqrt(pow(br-tr,2)+pow(h,2))/(2*h*2.62))
    -atan(h/abs(br-tr))), h*2.62
   translate y*h*2.62*sin(pi-acos(sqrt(pow(br-tr,2)+pow(h,2))/(2*h*2.62))
    -atan(h/abs(br-tr)))
  }
  //base cut
  cone{<0,-.000001,0>,br-.2 <0,.2,0>,.2}
  // end base cut
 }
 torus { // Lip toroid
  (tr-.01), .05
  translate y*h
 }
 hollow
}
// liquid volume
#declare cup_content=
difference{
 intersection{
  object{cup_interior}
  plane{y,lh}
 }
 merge{ // adds water climbing sides effect
  torus{
   (br-.25)+h*2.77*cos(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)
    +pow(h,2))/(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05))))
    -sqrt(pow(h*2.77,2)
    -pow(h*2.77*sin(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)
    +pow(h,2))/(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05))))-lh,2))-0.15
   ,.3
  }
  cylinder{
   <0,-.3,0>,<0,.3,0>,
   (br-.25)+h*2.77*cos(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)
    +pow(h,2))/(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05))))
    -sqrt(pow(h*2.77,2)
    -pow(h*2.77*sin(pi-acos(sqrt(pow((br-.25)-(tr-.05),2)
    +pow(h,2))/(2*h*2.77))-atan(h/abs((br-.25)-(tr-.05))))-lh,2))-0.15
  }
  translate (lh+.15)*y
 }
 hollow
}
#end


Post a reply to this message


Attachments:
Download 'glass_cup.jpg' (63 KB)

Preview of image 'glass_cup.jpg'
glass_cup.jpg


 

From: Xplo Eristotle
Subject: Re: Drinking glass
Date: 2 Apr 2005 17:44:17
Message: <424f2041$1@news.povray.org>
Mienai wrote:
> As long as everyone else is posting glasswares they've made, figured I'd
> join the bandwagon.  The glass is completely CSG (one of my first in fact).

Funky shape for a glass, but it renders nicely.

I really like the pigment you used for the tile. Messy enough not to 
look procedural, but not so much as to look like random noise, and you 
chose a nice set of colors, too.

-Xplo


Post a reply to this message

From: stm31415
Subject: Re: Drinking glass
Date: 3 Apr 2005 10:20:01
Message: <web.424ffac342d2ed0976393b180@news.povray.org>
I agree. The glass is nice, but a funny shape... but it is the
linoleoleoleum (I always get lost in that word...) that steals the scene. I
can see a great bathroom/kitchen floor with that stuff.

-S
5TF!


Post a reply to this message

From: Mienai
Subject: Re: Drinking glass
Date: 3 Apr 2005 16:45:00
Message: <web.4250557542d2ed096d661f730@news.povray.org>
The glass shape is kinda strange because it's supposed to have a handle on
it, but I never got around to doing that since I wanted the glass to
begenerated by a couple dimensions (everything I did CSG back then was like
that).  The way it is now though are the same dimensions as the one I got
for being a groomsman for a friend (minus 1 or 2 details).

Since you all like the tile surface so much here's the code for that.

#declare side = 4;
#declare R1 = seed(19);
#declare tile=
object{
 #if(!quick_render)
  superellipsoid{<.05,.05>}
 #else
   box {<-1,-1,-1>,<1,1,1>}
 #end
 scale <side/2,.125,side/2>*.99
}

#declare m_tile=
material{
 texture{
  T_Stone26
  finish{
   Phong_Shiny
   reflection { 0.5 , 1.0
    fresnel on
    metallic 0.8
   }
   conserve_energy
  }
  translate rand(R1)*10 scale 2
 }
}

#macro Tile_Surface (xdir,zdir)
 #local CountX=0;
 #while (CountX<xdir)
  #local CountZ=0;
  #while (CountZ<zdir)
   object{
    tile
    translate <((xdir-1)/2)*(side+.1)-CountX*(side+.1)
     ,0,((zdir-1)/2)*(side+.1)-CountZ*(side+.1)>
    #if (!quick_render)
     material{m_tile}
    #else
     pigment{Red}
    #end
   }
   #local CountZ=CountZ+1;
  #end
  #local CountX=CountX+1;
 #end
 box{ // grouting
  <-((xdir)/2)*(side+.1),0,-((zdir)/2)*(side+.1)>,
  <((xdir)/2)*(side+.1),.09,((zdir)/2)*(side+.1)>
  pigment{Gray}
  #if(!quick_render)
   normal{granite scale .1} finish{Phong_Shiny}
  #end
 }
#end

#declare x_tiles=10;
#declare z_tiles=10;

#declare tbl_srfc=
union{
 intersection{
  union{
   Tile_Surface(x_tiles,z_tiles) translate <0,-.12376,0>
  }
  cylinder{<0,-2,0>,<0,2,0>,1               // bounding for table surface
   scale <x_tiles*side/2,1,z_tiles*side/2>
  }
 }
 torus{5*side,.15 scale <1,2,1> translate y*-.3 texture{T_Wood24}}  // edge
}

#if (obj_table)
 object{
  tbl_srfc
   pigment{Black}
   translate <-.5,80,-1>
  }
#end


Post a reply to this message

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