POV-Ray : Newsgroups : povray.newusers : isosurface perturbation Server Time
30 May 2025 00:49:57 EDT (-0400)
  isosurface perturbation (Message 1 to 4 of 4)  
From: kurtz le pirate
Subject: isosurface perturbation
Date: 26 May 2025 13:40:51
Message: <6834a7a3@news.povray.org>
Hello,

Suppose we have a define a block with an isosurface whose surface is 
perturbed by a pigment function like that in a macro :


#macro CarvedRocks(xDim, yDim, zDim, Rad)
isosurface {
  function {
   f_rounded_box(x, y, z, Rad, xDim, yDim, zDim)
   -f_agate(x,y,z)
   }
#end


I can carve multiple stones :
#declare block1 = CarvedRocks(x1, y1, z1, Rad)
#declare block2 = CarvedRocks(x1, y1, z2, Rad)
...


The problem is that the disturbance is the same for all blocks.
This is not illogical, since the agate function always returns the same 
values.


Hence my question: how to obtain different blocks with the same agate 
(or other) function ?


Traditionally, by applying pigment before translations, box appear 
different. But for an isosurface, I don't see how this can be done.



Any ideas ?
THanks


-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: isosurface perturbation
Date: 26 May 2025 14:00:00
Message: <web.6834ab04f8393ea59c0b49ce25979125@news.povray.org>
kurtz le pirate <kur### [at] freefr> wrote:
> Hello,
>
> Suppose we have a define a block with an isosurface whose surface is
> perturbed by a pigment function like that in a macro :
>
>
> #macro CarvedRocks(xDim, yDim, zDim, Rad)
> isosurface {
>   function {
>    f_rounded_box(x, y, z, Rad, xDim, yDim, zDim)
>    -f_agate(x,y,z)
>    }
> #end
>
>
> I can carve multiple stones :
> #declare block1 = CarvedRocks(x1, y1, z1, Rad)
> #declare block2 = CarvedRocks(x1, y1, z2, Rad)
> ...
>
>
> The problem is that the disturbance is the same for all blocks.
> This is not illogical, since the agate function always returns the same
> values.
>
>
> Hence my question: how to obtain different blocks with the same agate
> (or other) function ?
>
>
> Traditionally, by applying pigment before translations, box appear
> different. But for an isosurface, I don't see how this can be done.

It gets done in "exactly" the same way as you do with regular objects - you just
use math, not keywords to do it.

If you want to translate your box, you add or subtract to the x, y, or z going
into the function.

f_rounded_box(x-TransX, y-TransY, z-TransZ, Rad, xDim, yDim, zDim)

Same with the pigment function.

f_agate(x-TransX, y-TransY, z-TransZ)

If you wanted to use a keyword, you could undef your pigment function, and use

function (x, y, z, X, Y, Z) {pigment {agate translate <X, Y, Z>}}



- BW


Post a reply to this message

From: Alain Martel
Subject: Re: isosurface perturbation
Date: 26 May 2025 23:05:58
Message: <68352c16$1@news.povray.org>
Le 2025-05-26 à 13:40, kurtz le pirate a écrit :
> 
> Hello,
> 
> Suppose we have a define a block with an isosurface whose surface is 
> perturbed by a pigment function like that in a macro :
> 
> 
> #macro CarvedRocks(xDim, yDim, zDim, Rad)
> isosurface {
>   function {
>    f_rounded_box(x, y, z, Rad, xDim, yDim, zDim)
>    -f_agate(x,y,z)
>    }
> #end
> 
> 
> I can carve multiple stones :
> #declare block1 = CarvedRocks(x1, y1, z1, Rad)
> #declare block2 = CarvedRocks(x1, y1, z2, Rad)
> ...
> 
> 
> The problem is that the disturbance is the same for all blocks.
> This is not illogical, since the agate function always returns the same 
> values.
> 
> 
> Hence my question: how to obtain different blocks with the same agate 
> (or other) function ?
> 
> 
> Traditionally, by applying pigment before translations, box appear 
> different. But for an isosurface, I don't see how this can be done.
> 
> 
> 
> Any ideas ?
> THanks
> 
> 
You can feed the function some disturbed coordinates.

isosurface{f_leopar(x+f_granite(x,y,z), y+f_granite(x,y,z), 
y+f_granite(x,y,z)), contained_by{box{<-1000, -1.2, -1000><1000, 1.2, 
1000>}} <OtherIsodusfaceParameters>}


Post a reply to this message

From: kurtz le pirate
Subject: Re: isosurface perturbation
Date: 28 May 2025 04:29:40
Message: <6836c974$1@news.povray.org>
Thank you for your answers.
They gave me some new ideas.





-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

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