|
|
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'
|
|