POV-Ray : Newsgroups : povray.newusers : Logo cut from cylinder : Re: Logo cut from cylinder Server Time
29 Jul 2024 00:26:50 EDT (-0400)
  Re: Logo cut from cylinder  
From: Chris B
Date: 9 Apr 2007 19:26:41
Message: <461acbb1$1@news.povray.org>
"Carl" <car### [at] semisouthcom> wrote in message 
news:web.461a94952a2d760870dc520d0@news.povray.org...
> Hello,
>
>   I had a quick question.  I've made this logo seen here:
>
> http://www.wwwmwww.com/images/MyLogo.png
>
> It's a simple prism ... snip ...  instead of cutting this logo out of a 
> sheet,
> I'd like to cut it out of a hollow cylinder with some wall thickness.
> ... snip ...
>
> Thanks,
> Carl
>

Hi Carl,

One approach I've used in the past for this sort of thing is to take slices 
of an object (LogoObject), then transform the slices as required.
The example below takes horizontal slices, translates them down to the XZ 
plane then rotates them the same distance around the face of a cylinder 
centred on the X-axis. This example uses a small number of slices giving a 
render time of just a few minutes. When you've got the effect you want you 
can reduce the SliceThickness to get the desired quality.

Regards,
Chris B.

camera {location <0, 0,-3.5> look_at  <0,0,0>}
light_source { <-50, 50, -30> color rgb <1,1,1>}
light_source { <-50,-50, -30> color rgb <1,0.5,0>}

#declare CylinderRadius = 0.5;
#declare CylinderThickness = 0.1;
#declare SliceThickness = 0.1;
//#declare SliceThickness = 0.01;
#declare CylinderCircumference = 2*pi*CylinderRadius;

#declare LogoObject = text {
  ttf             // font type (only TrueType format for now)
  "crystal.ttf",  // Microsoft Windows-format TrueType font file name
  "POV-Ray",      // the string to create
  2,              // the extrusion depth
  0               // inter-character spacing
  translate <-1.7,-0.3,-CylinderRadius>
}

#declare Top    = max_extent(LogoObject).y;
#declare Bottom = min_extent(LogoObject).y;

// This makes a curved object
// Make the back surface dead smooth
difference {
  // Make the front surface dead smooth
  intersection {
    cylinder {-2*x,2*x,CylinderRadius}
    // Assemble some slices
    union {
      #local Height = Top;
      #while (Height>=Bottom)
        intersection {
          // Take a thin slice of the object
          object {LogoObject}
          box {<-2,Height-SliceThickness-0.01,-1>,<2,Height+0.01,0>}
          // Drop slice to XY plane
          translate (-Height+SliceThickness)*y
         // Rotate around surface of the cylinder
          rotate x*360*(Height-SliceThickness)/CylinderCircumference
        }
        #local Height = Height - SliceThickness;
      #end
    }
  }
  cylinder {-2*x,2*x,CylinderRadius-CylinderThickness}
  pigment {color rgb <1,1,0>}
  translate y*0.5
}


Post a reply to this message

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