POV-Ray : Newsgroups : povray.newusers : Can this be done? :) sor-lathe type question Server Time
5 Sep 2024 16:17:23 EDT (-0400)
  Can this be done? :) sor-lathe type question (Message 1 to 8 of 8)  
From: Todd Taylor
Subject: Can this be done? :) sor-lathe type question
Date: 9 Sep 2000 19:49:56
Message: <39bacca4@news.povray.org>
/* I would like to rotate the object below by 360 degrees around an axis,
(say, the z-axis),
to get a bowl-like rotated object.  Is this possible?  Please help.  TIA.

Thanks!
Todd
tta### [at] netrelatedcom
*/

#include "colors.inc"
  background{White}
  camera {
    location <20, 80, -.1>
    look_at <0, 1, 0>
  }
  light_source { <20, 20, -20> color White }
  prism

    linear_sweep
    cubic_spline
    0,
    1,
    9,
    <300,-75>, <3,5>, <-3,5>, <-5,0>, <-3,-5>, <3, -5>, <5,0>, <3,5>,
<-50,-50>
    pigment { Green }
  }


Post a reply to this message

From: Margus Ramst
Subject: Re: Can this be done? :) sor-lathe type question
Date: 9 Sep 2000 21:27:36
Message: <39BAD564.C12B7C40@peak.edu.ee>
Todd Taylor wrote:
> 
>   /* I would like to rotate the object below by 360 degrees around an axis,
> (say, the z-axis),
> to get a bowl-like rotated object.  Is this possible?  Please help.  TIA.
> 

The lathe object creates a surface of revolution, so using your spline in a
lathe should do what you need.
If you want to make a radial array of copies of the actual prism object, use a
while loop. Something like:

#declare MyPrism = prism{...}
#declare Count = 0;
#declare Number = 20; //Number of copies to create
#while(Count < Number)
    object{MyPrism rotate <360 / Number * Count, 0, 0>}
    #declare Count = Count + 1;
#end

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Todd Taylor
Subject: Re: Can this be done? :) sor-lathe type question
Date: 9 Sep 2000 23:50:50
Message: <39bb051a$1@news.povray.org>
"Margus Ramst" <mar### [at] peakeduee> wrote in message
news:39BAD564.C12B7C40@peak.edu.ee...
> The lathe object creates a surface of revolution, so using your spline in
a
> lathe should do what you need.

Thanks, Margus, for replying to my post.  What I have
done so far is to use the prism and revolve it.  What I
have to ask now is this:  Is there a way to use 80 of these
and union them together (so there are no artifacts - I want
it to look like a smooth surface like an sor object).   I
used the code below but need to somehow union them
together (I have thought and thought but have no idea
where to go from here).

Thanks for your help!
Todd
tta### [at] netrelatedcom

> If you want to make a radial array of copies of the actual prism object,
use a
> while loop. Something like:
>
> #declare MyPrism = prism{...}
> #declare Count = 0;
> #declare Number = 20; file://Number of copies to create
> #while(Count < Number)
>     object{MyPrism rotate <360 / Number * Count, 0, 0>}
>     #declare Count = Count + 1;
> #end


Post a reply to this message

From: Margus Ramst
Subject: Re: Can this be done? :) sor-lathe type question
Date: 10 Sep 2000 16:16:40
Message: <39BBDE03.60E8A9F9@peak.edu.ee>
Todd Taylor wrote:
> 
> have to ask now is this:  Is there a way to use 80 of these
> and union them together (so there are no artifacts - I want
> it to look like a smooth surface like an sor object).>

At 80 copies there will in most cases be little visible difference between this
construct and a lathe object... Anyway, placing the created copies in a union is
simple:

#declare Number = 80; //Number of copies to create
#declare MyPrism = prism{...}
#declare Count = 0;
union{
  #while(Count < Number)
    object{MyPrism rotate <360 / Number * Count, 0, 0>}
    #declare Count = Count + 1;
  #end
}

The union will not remove any artefacts or give an unbroken surface. For that
you have to clip the prism to a wedge profile. Something like this:

#declare MyPrism =
prism{
  linear_sweep
  cubic_spline
  0,
  Thickness, //Thickness of the prism
  ...
  translate <0, -Thickness/2, 0>
  clipped_by{
    union{
      plane{y,0 rotate x*360/Number/2}
      plane{-y,0 rotate -x*360/Number/2}
      inverse
    }
  }
}

Notes:
1) the prism must have great enough thickness for the copies to overlap all the
way to the SOR's maximum circumference. It must also be translated to 
<0, -Thickness/2, 0> before clipping (see above example).
2) the clipping planes must intersect along the SOR axis (in my example the x
axis)

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Can this be done? :) sor-lathe type question
Date: 11 Sep 2000 21:42:33
Message: <39BD88B9.A8295B7D@online.no>
Todd Taylor wrote:

> ... What I have done so far is to use the prism and revolve it.
> What I have to ask now is this:  Is there a way to use 80 of
> these and union them together (so there are no artifacts
> - I want it to look like a smooth surface like an sor object).
> ...

I'm wondering what you mean by this.

Does your bowl like object look anything like
the vase I just posted to povray.binaries.images ?

news://news.povray.org/39BD872A.9D0EE76%40online.no

In that image I have used 5 lathes segments to join
the 5 prism parts smoothly.
(A macro takes care of all the needed calculations.)


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Todd Taylor
Subject: Re: Can this be done? :) sor-lathe type question
Date: 12 Sep 2000 03:49:12
Message: <39bddff8$1@news.povray.org>
"Tor Olav Kristensen" <tto### [at] onlineno> wrote in message
news:39BD88B9.A8295B7D@online.no...
<snip>
> I'm wondering what you mean by this.
>
> Does your bowl like object look anything like
> the vase I just posted to povray.binaries.images ?
> news://news.povray.org/39BD872A.9D0EE76%40online.no

To tell the truth, I am not altogether sure. :)

> In that image I have used 5 lathes segments to join
> the 5 prism parts smoothly.
> (A macro takes care of all the needed calculations.

If I understand you correctly, Tor, you had 5 prism parts and then used 5
lathe segments to smoothly join the prism parts.  What I am intending to do
is to take a single prism object and sweep it around an axis, forming
something akin to a bowl.

For instance, if you were to take the upper case letter "L" and
rotate it about an axis that ran just even with the end of the
horizontal "stick" of the "L", you'd have something looking like
a short, open-ended cylinder.

I want to do the same thing, but with a prism of my own design.

(BTW, your creation, Tor, looks like it'd be good rosebud.  I'd
be interested on how you did that as well as any ideas you might
have on this problem as well.  TIA.)

Thanks!
Todd

Following is the pertinent code:

 #include "colors.inc"
  background{White}
  camera {
    location <4.1, 10.1, -.1>
    look_at <0, 01, 0>
    rotate <180,180,0>
  }
  light_source { <20, 20, -20> color White rotate <180,180,0>}


#declare MyPrism = prism {
    cubic_spline
    0, /* sweep the following shape from here ... */
    1, /* ... up through here */
    9, /* the number of points making up the shape ... */
    <300,-75>, <3,5>, <-3,5>, <-5,0>, <-3,-5>, <3, -5>, <5,0>, <3,5>,
<-50,-50>
    pigment { Green }
    scale<.25,.25,.25>
  }

#declare Count = 0;
#declare Number = 360; /*Number of copies to create*/
union{
  #while(Count < Number)
    object{MyPrism rotate <360 / Number * Count, 0, 0>}
    #declare Count = Count + 1;
  #end
}


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Can this be done? :) sor-lathe type question
Date: 12 Sep 2000 18:02:17
Message: <39BEA691.E208641D@online.no>
Todd Taylor wrote:

> "Tor Olav Kristensen" <tto### [at] onlineno> wrote in message
> news:39BD88B9.A8295B7D@online.no...
> <snip>
> > I'm wondering what you mean by this.
> >
> > Does your bowl like object look anything like
> > the vase I just posted to povray.binaries.images ?
> > news://news.povray.org/39BD872A.9D0EE76%40online.no
>
> To tell the truth, I am not altogether sure. :)
>
> > In that image I have used 5 lathes segments to join
> > the 5 prism parts smoothly.
> > (A macro takes care of all the needed calculations.
>
> If I understand you correctly, Tor, you had 5 prism parts and then used 5
> lathe segments to smoothly join the prism parts.  What I am intending to do
> is to take a single prism object and sweep it around an axis, forming
> something akin to a bowl.
>
> For instance, if you were to take the upper case letter "L" and
> rotate it about an axis that ran just even with the end of the
> horizontal "stick" of the "L", you'd have something looking like
> a short, open-ended cylinder.

Are you sure that you can not use an ordinary lathe object
for making such a shape ?

Below are some code that shows how to do this.
I also modified your code a little bit to show how a
bowl can be made with a "rotated" L-shaped prism.

If neither of the two shapes are what you seek, then
please try to explain more. :)


> I want to do the same thing, but with a prism of my own design.
>
> (BTW, your creation, Tor, looks like it'd be good rosebud.  I'd
> be interested on how you did that as well as any ideas you might
> have on this problem as well.  TIA.)

I'll post the code for my "rosebud" later (when I have un-messed it :)


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.1;
#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare MyPrism =
prism {
  cubic_spline
  0,
  1,
  9,
  <1,-3>,
  <1,-2>, <7,-2>, <7, 6>, <8, 6>, <8,-3>, <1,-3>, <1,-2>
  <7,-2>
}
// Note that all the first co-ordinates for the points
// above are positive.  That is not required here,
// but it makes it easier to imagine how the "spun"
// object will look like.


#declare NrOfPrisms = 36;

#declare PrismBowl =
union {
  #declare Count = 0;
  #while(Count < NrOfPrisms)
    object { MyPrism rotate 360/NrOfPrisms*Count*z }
    #declare Count = Count + 1;
  #end
  rotate -90*x
}


#declare LatheBowl =
lathe {
  cubic_spline
  9,
  <1,-3>,
  <1,-2>, <7,-2>, <7, 6>, <8, 6>, <8,-3>, <1,-3>, <1,-2>
  <7,-2>
}
// Note that the first and last point in the middle line
// are equal.
// Also note that the point in the first line is equal
// to the second last point in the middle line.
// And that the point in the last line is equal to
// the second point in the middle line.
// (This makes a "smooth" and "closed" cubic_spline)


object {
  PrismBowl
  pigment { Green }
  translate -10*x
}


object {
  LatheBowl
  pigment { Red }
  translate 10*x
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

background { color White }

light_source { 100*<1, 5, -2> color White }

camera {
  location <0, 5, -3>*7
  look_at <0, 0, 0>
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Can this be done? :) sor-lathe type question
Date: 12 Sep 2000 19:27:28
Message: <39BEBA96.2CEA2AAB@online.no>
Tor Olav Kristensen wrote:

> ...
> I'll post the code for my "rosebud" later (when I have un-messed it :)
> ...
>

The source is now in povray.text.scene-files:
(news://news.povray.org/39BEB918.80B0687D%40online.no)

Note that it's not necessary to use as much code
and macros that I did to make such a vase.
(I only thought it was interesting to see how this
could be done with macros.)


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

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