POV-Ray : Newsgroups : povray.newusers : Superellipsoid type round edge, but for arbitrary shapes Server Time
25 Dec 2024 23:55:11 EST (-0500)
  Superellipsoid type round edge, but for arbitrary shapes (Message 1 to 4 of 4)  
From: Kaveh
Subject: Superellipsoid type round edge, but for arbitrary shapes
Date: 26 Aug 2002 01:50:03
Message: <web.3d69c07e42c081aa1e1615b30@news.povray.org>
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

From: Mike Williams
Subject: Re: Superellipsoid type round edge, but for arbitrary shapes
Date: 26 Aug 2002 03:30:48
Message: <vvAw2BAujda9EwrM@econym.demon.co.uk>
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

From: Kaveh
Subject: Re: Superellipsoid type round edge, but for arbitrary shapes
Date: 26 Aug 2002 08:25:14
Message: <web.3d6a1d0de234af4c1e1615b30@news.povray.org>
Mike Williams wrote:
[...]

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

[...]

Absolutely cutely wonderful. Just like lego!

This is a great tutorial for me, to build other things. And it renders so
fast too. Thanks Mike.

Kaveh


Post a reply to this message

From: Christopher James Huff
Subject: Re: Superellipsoid type round edge, but for arbitrary shapes
Date: 26 Aug 2002 15:06:18
Message: <chrishuff-1258EC.15062726082002@netplex.aussie.org>
In article <web.3d69c07e42c081aa1e1615b30@news.povray.org>,
 "Kaveh" <kav### [at] focalimagecom> 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] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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