POV-Ray : Newsgroups : povray.general : Iso-blobbing made easier Server Time
20 Nov 2024 01:29:37 EST (-0500)
  Iso-blobbing made easier (Message 1 to 5 of 5)  
From: Tor Olav Kristensen
Subject: Iso-blobbing made easier
Date: 12 Dec 2001 21:56:52
Message: <3C1816A0.6D6B72C@hotmail.com>
I have tried to write the code below in order to show
how one can both add and subtract "blobbed" components
to a iso-surface.

Please try this at home...
- and tell me what you think of it.

Oded proposed to use a sigmoid for "blobbing" of
iso-surfaces in his post 22. Oct. 2001
"iso-surface polyhedra":
http://news.povray.org/povray.binaries.images/18586/
news://news.povray.org/3bace06b%40news.povray.org

(My method also uses a kind of sigmoid function)

Also see this thread (by me 1. Oct. 2001):
"How to transform and blob together iso-shapes in v3.5":
http://news.povray.org/povray.general/18830/
news://news.povray.org/3BB8D35B.BB527254%40hotmail.com


Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
// Copyright 2001 by Tor Olav Kristensen
// Email: tor### [at] hotmailcom
// http://www.crosswinds.net/~tok
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.5;

#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
// Function needed for the "iso-blobbing"

#declare SquashFn =
function(Fn, S) { select(S, -1, 1)*(1/(1 + exp(-abs(S)*Fn)) - 1) }

// Fn is the function for the shape to be "blobbed"
// A negative S-value "subtracts" the shape
// A positive S-value "adds" the shape
// The magnitude of S is the "blobbing" strength

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
// Simple iso-surface example

#declare CylRad = 3;
#declare SphRad1 = 10;
#declare SphRad2 = 8;

#declare XcylFn = function { sqrt(y^2 + z^2) - CylRad }
#declare YcylFn = function { sqrt(x^2 + z^2) - CylRad }
#declare ZcylFn = function { sqrt(x^2 + y^2) - CylRad }
#declare Sphere1Fn = function { sqrt(x^2 + y^2 + z^2) - SphRad1 }
#declare Sphere2Fn = function { sqrt(x^2 + y^2 + z^2) - SphRad2 }

isosurface {
  function {
    SquashFn(Sphere1Fn(x, y, z), 3) // Add "outer" sphere
   +SquashFn(XcylFn(x, y, z), -10)  // Subtract X-cylinder
   +SquashFn(YcylFn(x, y, z), 2)    // Add Y-cylinder
   +SquashFn(ZcylFn(x, y, z), -3)   // Subtract Z-cylinder
   +SquashFn(Sphere2Fn(x, y, z), 1) // Add "inner" sphere
  }
  max_gradient 4
  threshold -0.5 // Value to use for this kind of blobbing
  contained_by { sphere { <0, 0, 0>, SphRad1 + 6 } }
  pigment { color Blue + White }
}                                     

// Add an "ordinary" Z-cylinder
cylinder {
  -16*z, 16*z, CylRad
  pigment { color Yellow + White }
}

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

background { color (Blue + Cyan)/4 }

light_source {
  <-2, 3, -2>*100
  color White
  shadowless
}

camera {
  location <-1.8, 0, -1>*20
  look_at <0, 0, 0>
}

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


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Iso-blobbing made easier
Date: 12 Dec 2001 22:03:17
Message: <3C181826.B9E88733@hotmail.com>
Tor Olav Kristensen wrote:
> 
>...
> Oded proposed to use a sigmoid for "blobbing" of
> iso-surfaces in his post 22. Oct. 2001
> "iso-surface polyhedra":

Sorry, the date was 22. Sept.


Tor Olav


Post a reply to this message

From: Jan Walzer
Subject: Re: Iso-blobbing made easier
Date: 13 Dec 2001 07:51:26
Message: <3c18a44e@news.povray.org>
this looks really useful ...
but I assume, it won't blob correctly, when using, the inside()-function or
any other, with a strange gradient ...

or am I completely wrong ?
it would just be useful, to blob text-objects and other ones ...

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Iso-blobbing made easier
Date: 13 Dec 2001 19:31:55
Message: <3C1945A6.339D8F0E@hotmail.com>
Jan Walzer wrote:
> 
> this looks really useful ...
> but I assume, it won't blob correctly, when using, the inside()-function or
> any other, with a strange gradient ...
> 
> or am I completely wrong ?
> it would just be useful, to blob text-objects and other ones ...

No, unfortunately I think you are completely right.


But Chris Huff once mentioned that there is a 
proximity pattern available in a MegaPOV version
(IIRC).

I have not checked yet what possibilities there
are with this pattern. - If it can return some
kind of distance from an arbitrary point to a
given object, then it might be useful.


Tor Olav


Post a reply to this message

From: Jan Walzer
Subject: Re: Iso-blobbing made easier
Date: 14 Dec 2001 01:02:15
Message: <3c1995e7$1@news.povray.org>
this will be _veryyyyyy_ slow ...
I saw some pix of this pattern ... and I saw the rendertimes ...

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

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