POV-Ray : Newsgroups : povray.newusers : isosurface extrude and rounded edges Server Time
1 Nov 2024 05:23:24 EDT (-0400)
  isosurface extrude and rounded edges (Message 1 to 3 of 3)  
From: Piotr 'utak3r' Borys
Subject: isosurface extrude and rounded edges
Date: 24 Mar 2006 08:05:39
Message: <4423eea3@news.povray.org>
Hi all,

First, welcome all here, as it's my first post :)
Now my problem: I've made a isosurface from sin(x) and then with abs 
function made it a box:

#declare Thickness = 0.15;
#declare WaveHeight = 0.15;
#declare fn = function(x,y,z) { y - sin(x*pi)*WaveHeight }

#declare wave_box =
isosurface {
   function { abs(fn(x,y+Thickness,z))-Thickness }
   contained_by { box { <-1,-0.5,-1>, < 1, 0.5, 1> } }
   max_gradient 0.8
}

all is great, it works :)
BUT - it would be _much_ better if it had rounded edges... but how the 
hell do it? I wonder if there's a way to distort for example 
f_rounded_box with sin(x)?...

Any advice would be appreciated :)

cheers
-- 
Piotr "utak3r" Borys


Post a reply to this message

From: Mike Williams
Subject: Re: isosurface extrude and rounded edges
Date: 24 Mar 2006 09:54:44
Message: <fnFUGEAOfAJEFwDA@econym.demon.co.uk>
Wasn't it Piotr 'utak3r' Borys who wrote:
>Hi all,
>
>First, welcome all here, as it's my first post :)
>Now my problem: I've made a isosurface from sin(x) and then with abs 
>function made it a box:
>
>#declare Thickness = 0.15;
>#declare WaveHeight = 0.15;
>#declare fn = function(x,y,z) { y - sin(x*pi)*WaveHeight }
>
>#declare wave_box =
>isosurface {
>   function { abs(fn(x,y+Thickness,z))-Thickness }
>   contained_by { box { <-1,-0.5,-1>, < 1, 0.5, 1> } }
>   max_gradient 0.8
>}
>
>all is great, it works :)
>BUT - it would be _much_ better if it had rounded edges... but how the 
>hell do it? I wonder if there's a way to distort for example 
>f_rounded_box with sin(x)?...

Here's a f_rounded_box distorted by sin(x*pi)*WaveHeight:

#declare Thickness = 0.15;
#declare WaveHeight = 0.15;
#declare Roundness = 0.1;

#include "functions.inc"

#declare wave_box =
isosurface {
   function { f_rounded_box(x,(y - sin(x*pi)*WaveHeight),z,Roundness,1,
        Thickness,1)}
   contained_by { box { <-1,-0.5,-1>, < 1, 0.5, 1> } }
   max_gradient 1.1
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: utak3r
Subject: Re: isosurface extrude and rounded edges
Date: 26 Mar 2006 10:20:01
Message: <web.4426b04a190c41edd866f3010@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> >BUT - it would be _much_ better if it had rounded edges... but how the
> >hell do it? I wonder if there's a way to distort for example
> >f_rounded_box with sin(x)?...
>
> Here's a f_rounded_box distorted by sin(x*pi)*WaveHeight:
>
> isosurface {
>    function { f_rounded_box(x,(y - sin(x*pi)*WaveHeight),z,Roundness,1,
>         Thickness,1)}
>    contained_by { box { <-1,-0.5,-1>, < 1, 0.5, 1> } }
>    max_gradient 1.1
> }

Och.... I can see now I have to learn a lot more about those functions and
operating their parameters, substitutions and so on... ;)

Thanks a lot!
--
Piotr Borys


Post a reply to this message

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