POV-Ray : Newsgroups : povray.newusers : Logo cut from cylinder Server Time
24 Nov 2024 23:55:32 EST (-0500)
  Logo cut from cylinder (Message 1 to 7 of 7)  
From: Carl
Subject: Logo cut from cylinder
Date: 9 Apr 2007 15:35:01
Message: <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 and starts something like this:

  #declare wwwmwww = prism {
    linear_sweep
    bezier_spline
    0, // sweep the following shape from here ...
    10, // ... up through here
    348, // the number of points making up the shape ...

However instead of cutting this logo out of a sheet, I'd like to cut it out
of a hollow cylinder with some wall thickness.  Instead of specifying
basically x and y, I'd like to specify something like theta and y.  Think
of it as a laser cutting out the logo as it moves up and down along the
axis of the cylinder and points in the direction of theta.  Is that
possible?

I'm not the best at describing what I want but I hope that gets the point
across.

Thanks,
Carl


Post a reply to this message

From: Alain
Subject: Re: Logo cut from cylinder
Date: 9 Apr 2007 16:11:59
Message: <461a9e0f$1@news.povray.org>
Carl nous apporta ses lumieres en ce 09-04-2007 15:31:
> 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 and starts something like this:

>   #declare wwwmwww = prism {
>     linear_sweep
>     bezier_spline
>     0, // sweep the following shape from here ...
>     10, // ... up through here
>     348, // the number of points making up the shape ...

> However instead of cutting this logo out of a sheet, I'd like to cut it out
> of a hollow cylinder with some wall thickness.  Instead of specifying
> basically x and y, I'd like to specify something like theta and y.  Think
> of it as a laser cutting out the logo as it moves up and down along the
> axis of the cylinder and points in the direction of theta.  Is that
> possible?

> I'm not the best at describing what I want but I hope that gets the point
> across.

> Thanks,
> Carl


Possible solution, if the desired cylinder have a ralatively large radius:
difference{
	object{wwwmwww}
	cylinder{<100,0,0><-100,0,0>,20}//must be longer than your prism
//the radius should be reasonably larger that the height of the prism
	cylinder{<101,0,0><-101,0,0>,17}//longer to avoid coincident surfaces
	texture{YourTexture}
	}
Here, the faces are curved, but the sides are still parallel.

Another way, is to use object pattern with a cylindrical warp to project it on a 
cylinder. This have the advantage of the sides been perpendicular to the 
surface. As this is meant for pigments, it must be converted to a function and 
used in an isosurface (extreem max_gradient) or directly as a media density. 
Both are slow.

-- 
Alain
-------------------------------------------------
Lutheran: If shit happens, don't talk about it.


Post a reply to this message

From: Carl
Subject: Re: Logo cut from cylinder
Date: 9 Apr 2007 16:55:02
Message: <web.461aa6d98b717c5070dc520d0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Possible solution, if the desired cylinder have a ralatively large radius:
> difference{
>  object{wwwmwww}
>  cylinder{<100,0,0><-100,0,0>,20}//must be longer than your prism
> //the radius should be reasonably larger that the height of the prism
>  cylinder{<101,0,0><-101,0,0>,17}//longer to avoid coincident surfaces
>  texture{YourTexture}
>  }
> Here, the faces are curved, but the sides are still parallel.
>
> Another way, is to use object pattern with a cylindrical warp to project it
> on a cylinder. This have the advantage of the sides been perpendicular to
> the surface. As this is meant for pigments, it must be converted to a
> function and used in an isosurface (extreem max_gradient) or directly as a
> media density. Both are slow.
>
> --
> Alain

Well, ultimately I wanted the logo to wrap 3/4th of the way around the
cylinder.  I was then going to animate it orbiting a sphere.  So I don't
think the difference with a cylinder method would work.  I must confess the
other solution you mention I think is beyond my POV-Ray skill level at the
moment.  I'm still learning.  Do you think you could make a simple example
so I can see what the code would look like?

Thanks,
Carl


Post a reply to this message

From: Chris B
Subject: Re: Logo cut from cylinder
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

From: Alain
Subject: Re: Logo cut from cylinder
Date: 10 Apr 2007 10:05:11
Message: <461b9997$1@news.povray.org>
Carl nous apporta ses lumieres en ce 09-04-2007 16:49:
> Alain <ele### [at] netscapenet> wrote:
>> Possible solution, if the desired cylinder have a ralatively large radius:
>> difference{
>>  object{wwwmwww}
>>  cylinder{<100,0,0><-100,0,0>,20}//must be longer than your prism
>> //the radius should be reasonably larger that the height of the prism
>>  cylinder{<101,0,0><-101,0,0>,17}//longer to avoid coincident surfaces
>>  texture{YourTexture}
>>  }
>> Here, the faces are curved, but the sides are still parallel.

>> Another way, is to use object pattern with a cylindrical warp to project it
>> on a cylinder. This have the advantage of the sides been perpendicular to
>> the surface. As this is meant for pigments, it must be converted to a
>> function and used in an isosurface (extreem max_gradient) or directly as a
>> media density. Both are slow.

>> --
>> Alain

> Well, ultimately I wanted the logo to wrap 3/4th of the way around the
> cylinder.  I was then going to animate it orbiting a sphere.  So I don't
> think the difference with a cylinder method would work.  I must confess the
> other solution you mention I think is beyond my POV-Ray skill level at the
> moment.  I'm still learning.  Do you think you could make a simple example
> so I can see what the code would look like?

> Thanks,
> Carl




OK. Logo wraps 3/4 around a vertical cylinder.
In your case, the best way is probably to use some external modeler like Wings 
and use the resulting mesh.
The render time will be much faster than that of an isosurface and you can have 
specular highlights if you want (impossible with the media solution).

-- 
Alain
-------------------------------------------------
Honk if you love peace and quiet.


Post a reply to this message

From: Tim Attwood
Subject: Re: Logo cut from cylinder
Date: 10 Apr 2007 19:16:10
Message: <461c1aba$1@news.povray.org>
You might want to look at Chris Colefax's object bender macro,
it's a bit slow, but should be able to do this.
http://www.geocities.com/ccolefax/


Post a reply to this message

From: Carl
Subject: Re: Logo cut from cylinder
Date: 17 Apr 2007 13:10:02
Message: <web.4624fe388b717c5070dc520d0@news.povray.org>
I found a way to do almost what I was after.  Check this out:

http://www.wwwmwww.com/images/MyLogo2.png

If this is my original prism:

  #declare wwwmwww1 = prism {
    linear_sweep
    bezier_spline
    0, // sweep the following shape from here ...
    10, // ... up through here
    348, // the number of points making up the shape ...
    #declare Ctr = 0;
    #while (Ctr < 85.5)
      P1[Ctr],C1[Ctr+1],C2[Ctr],P1[Ctr+1],
      #declare Ctr = Ctr+1;
    #end
    P1[Ctr],C1[Ctr+1],C2[Ctr],P1[Ctr+1]
  }

Then all I had to do was this:

  #declare shell = difference {
    sphere {<0,0,0>,1}
    sphere {<0,0,0>,0.95}
  }

  #declare wwwmwww3 = prism {
    conic_sweep
    bezier_spline
    0, // sweep the following shape from here ...
    1, // ... up through here
    348, // the number of points making up the shape ...
    #declare Ctr = 0;
    #while (Ctr < 85.5)
      <tan(radians(f1*P1[Ctr].x)),
       tan(radians(f1*P1[Ctr].y))/cos(radians(f1*P1[Ctr].x))>,
      <tan(radians(f1*C1[Ctr+1].x)),
       tan(radians(f1*C1[Ctr+1].y))/cos(radians(f1*C1[Ctr+1].x))>,
      <tan(radians(f1*C2[Ctr].x)),
       tan(radians(f1*C2[Ctr].y))/cos(radians(f1*C2[Ctr].x))>,
      <tan(radians(f1*P1[Ctr+1].x)),
       tan(radians(f1*P1[Ctr+1].y))/cos(radians(f1*P1[Ctr+1].x))>,
      #declare Ctr = Ctr+1;
    #end
    <tan(radians(f1*P1[Ctr].x)),
     tan(radians(f1*P1[Ctr].y))/cos(radians(f1*P1[Ctr].x))>,
    <tan(radians(f1*C1[Ctr+1].x)),
     tan(radians(f1*C1[Ctr+1].y))/cos(radians(f1*C1[Ctr+1].x))>,
    <tan(radians(f1*C2[Ctr].x)),
     tan(radians(f1*C2[Ctr].y))/cos(radians(f1*C2[Ctr].x))>,
    <tan(radians(f1*P1[Ctr+1].x)),
     tan(radians(f1*P1[Ctr+1].y))/cos(radians(f1*P1[Ctr+1].x))>
  }

  #declare wwwmwww = intersection {
    object {shell}
    object {wwwmwww3}
  }

In fact I think I like this more then what I was after.  However I'm
surprised that if its this easy to cut my logo from a sphere that it seems
so much harder to cut it out of a cylinder.

Thanks,
Carl

P.S.  f1 above is just a scaling factor used to convert the original x and y
values into degrees.  Also note this method can only be used to wrap the
logo half way around the sphere.  I think if I break the logo up into 2
prisms though I can get more then 180 degree coverage.


Post a reply to this message

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