POV-Ray : Newsgroups : povray.advanced-users : shearing isosurfaces Server Time
31 Oct 2024 21:29:01 EDT (-0400)
  shearing isosurfaces (Message 1 to 9 of 9)  
From: Mick Hazelgrove
Subject: shearing isosurfaces
Date: 18 May 2004 14:51:09
Message: <40aa5b1d@news.povray.org>
Hi All

I want to shear an isosurface, before anyone says it, I know about the
shearing macro in transforms.inc but I need to shear an isosurace by using
some sort of function before blobbing the isosurface - does this make sense?

if does is it possible and how do I do it?

Mick


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: shearing isosurfaces
Date: 18 May 2004 15:00:00
Message: <40aa5d30@news.povray.org>
In article <40aa5b1d@news.povray.org> , "Mick Hazelgrove" 
<mic### [at] mhazelgrovefsnetcouk> wrote:

> I want to shear an isosurface, before anyone says it, I know about the
> shearing macro in transforms.inc but I need to shear an isosurace by using
> some sort of function before blobbing the isosurface - does this make sense?
>
> if does is it possible and how do I do it?

How about a transform function?  See section 6.1.6.4 "Declaring User-Defined
Vector Functions" <http://www.povray.org/documentation/view/140/>.  It won't
be fast, but I am not sure there are faster ways to do what you want.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: shearing isosurfaces
Date: 18 May 2004 15:04:59
Message: <40aa5e5b@news.povray.org>
In article <40aa5d30@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

You should be able to code it like this:

#declare tfoo = function { transform { matrix { ... } } }
#declare afoo = function { ... your function ... }
#declare foo = function { afoo(tfoo(x,y,z).x,tfoo(x,y,z).y,tfoo(x,y,z).z) }

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: shearing isosurfaces
Date: 18 May 2004 15:18:02
Message: <40aa616a@news.povray.org>
Thanks Thorsten

Speed doesn't matter as I'll convert the isosurface to a mesh when I get it
right.

Mick


Post a reply to this message

From: Christoph Hormann
Subject: Re: shearing isosurfaces
Date: 18 May 2004 15:25:01
Message: <c8dnn2$1p8$1@chho.imagico.de>
Mick Hazelgrove wrote:
> Hi All
> 
> I want to shear an isosurface, before anyone says it, I know about the
> shearing macro in transforms.inc but I need to shear an isosurace by using
> some sort of function before blobbing the isosurface - does this make sense?
> 
> if does is it possible and how do I do it?

You can very easily apply transforms to functions with the IsoCSG lib:

http://www.tu-bs.de/~y0013390/pov/ic/

But note that when you have a function representing linear distance from 
a surface (which is usually what you want for blobbing) and you shear it 
(or scale it non-uniformly) you will loose this property of the function.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 01 May. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Slime
Subject: Re: shearing isosurfaces
Date: 18 May 2004 22:40:01
Message: <40aac901@news.povray.org>
> I need to shear an isosurace by using
> some sort of function before blobbing the isosurface

To shear a function along an axis, just replace one of the axis variables
(y, for instance), with the same variable offset by a different variable
(y+C*x). For example, take the unit sphere function:

x*x + y*y + z*z - 1

By replacing y with y+2*x, we can bring the right side of the sphere down
and the left side up:

x*x + (y+2*x)*(y+2*x) + z*z - 1

Try rendering it and see the results.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Warp
Subject: Re: shearing isosurfaces
Date: 19 May 2004 08:04:24
Message: <40ab4d48@news.povray.org>
Slime <fak### [at] emailaddress> wrote:
> x*x + y*y + z*z - 1

> By replacing y with y+2*x, we can bring the right side of the sphere down
> and the left side up:

> x*x + (y+2*x)*(y+2*x) + z*z - 1

  This is easier to do like this:

#declare SphereF = function { x*x + y*y + z*z -1 }

#declare Sheared = function { SphereF(x, y+2*x, z) }

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: ingo
Subject: Re: shearing isosurfaces
Date: 19 May 2004 10:20:50
Message: <Xns94EEA64A6A571seed7@news.povray.org>
in news:40aa5b1d@news.povray.org Mick Hazelgrove wrote:

> if does is it possible and how do I do it?
> 

Just found this in the docs:

6.5.4.3.4  Functions, Shear
shear in XY-plane : replace "x" with "x + y*tan(radians(Angle))" (idem 
other parameters)

shear 45 degrees left   gives    P(x+y*tan(radians(45)), y, z)


Ingo


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: shearing isosurfaces
Date: 19 May 2004 11:14:27
Message: <40ab79d3@news.povray.org>
Thanks Guys

that gives me lots to play with :-)

Mick


Post a reply to this message

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