|
![](/i/fill.gif) |
I am trying to create 'wafers' with a small depth, and with rounded edges, a
bit like those created using the superellipsoid command. I can't find a
simple way to do this. I have tried creating one shape by joining three
superellipsoids together, but the result is not perfect. Here is my code:
+++++++++++++++++++++++++++++++++++++++++++++++++++
#include "colors.inc"
#declare roundness = .1;
union{
superellipsoid {
<1, roundness>
translate -x
}
superellipsoid {
<.02, roundness>
}
superellipsoid {
<1, roundness>
translate x
}
pigment {
color Yellow
}
finish{phong 1}
}
plane{
z ,2
pigment {
color White
}
}
//===================================
light_source {<-10,20,-100> color White}
camera {
location <-10,10, -30.0>
look_at <0.0, 0.0, 0.0>
angle 10
}
+++++++++++++++++++++++++++++++++++++++++++++++++++
Kaveh
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Wasn't it Kaveh who wrote:
>I am trying to create 'wafers' with a small depth, and with rounded edges, a
>bit like those created using the superellipsoid command. I can't find a
>simple way to do this. I have tried creating one shape by joining three
>superellipsoids together, but the result is not perfect. Here is my code:
Perhaps the superellipsoid route isn't appropriate for this type of
shape. Perhaps it might be better to use cylinder and torus instead,
something like this:-
#include "colors.inc"
#declare Roundness = .1;
#declare Thickness = .2;
#declare Distance = 1;
#declare Size = 1;
#declare Endpiece=union {
cylinder {z*Thickness, -z*Thickness, Size-Roundness}
cylinder {z*(Thickness-Roundness), -z*(Thickness-Roundness), Size}
torus {Size-Roundness,Roundness rotate x*90 translate z*(Thickness-Roundness)}
torus {Size-Roundness,Roundness rotate x*90 translate -z*(Thickness-Roundness)}
}
#declare Midpiece=union {
box {<-Distance,-Size,-Thickness+Roundness><Distance,Size,Thickness-Roundness>}
box {<-Distance,-Size+Roundness,-Thickness><Distance,Size-Roundness,Thickness>}
cylinder {-x*Distance,x*Distance,Roundness translate
<0,Size-Roundness,Thickness-Roundness>}
cylinder {-x*Distance,x*Distance,Roundness translate
<0,Size-Roundness,-Thickness+Roundness>}
cylinder {-x*Distance,x*Distance,Roundness translate
<0,-Size+Roundness,Thickness-Roundness>}
cylinder {-x*Distance,x*Distance,Roundness translate
<0,-Size+Roundness,-Thickness+Roundness>}
}
union {
object {Endpiece translate x*Distance}
object {Endpiece translate -x*Distance}
object {Midpiece pigment {rgb <1,1,0>}}
pigment {color Yellow}
finish{phong 1}
}
plane{
z ,2
pigment {
color White
}
}
//===================================
light_source {<-10,200,-100> color White}
camera {
location <-10,10, -30.0>
look_at <0.0, 0.0, 0.0>
angle 10
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <web.3d69c07e42c081aa1e1615b30@news.povray.org>,
"Kaveh" <kav### [at] focalimage com> wrote:
> I am trying to create 'wafers' with a small depth, and with rounded edges, a
> bit like those created using the superellipsoid command. I can't find a
> simple way to do this. I have tried creating one shape by joining three
> superellipsoids together, but the result is not perfect. Here is my code:
Superellipsoids don't just have rounded edges. The sides of a
superellipsoid "rounded box" are not flat, for example. The usual method
is to use a CSG union or merge with sphere, cylinder, or torus objects
for the rounded edges. There are macros in shapes.inc to make rounded
versions of several primitives.
Another thing: superellipsoids are slow and prone to errors, and CSG
gives you more control over the rounding.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |