POV-Ray : Newsgroups : povray.binaries.images : Patches for arbitrary topology shapes - 4 attachments Server Time
14 Nov 2024 14:19:34 EST (-0500)
  Patches for arbitrary topology shapes - 4 attachments (Message 1 to 10 of 29)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Tor Olav Kristensen
Subject: Patches for arbitrary topology shapes - 4 attachments
Date: 3 Jan 2004 23:08:31
Message: <3ff791bf@news.povray.org>
I have now looked into the problem of modelling shapes of
arbitrary topology by using POV-Ray's built-in bicubic patches.

For such shapes, it is often necessary to have more (or less)
than four such patches meet at a single point. How to do this
seems to be a non-trivial problem. (At least for me.)

But now I have rewritten my macros (again) to allow for such
topologies. To model a shape, one must put all the coordinates
for the control points in a 1-dimensional list. Then one must
put all the patches in another 1-dimensional list. Each patch
therein is defined by the numbers of the 4 control points, that
controls each patch. (These 4 numbers must be written in anti-
clockwise order.)

When the information above is given, the macros will calculate
the information that is needed to make the transitions between
the patches smooth. (Other macros will place all the patches.)

The patchwork shown in these images has a point were five bicubic
patches meet. (The macros will allow any number of patches to
meet at any point.)

You'll probably notice that the shape is not "perfect". But it
can be refined by setting the patch resolution higher; i.e. by
defining more control points (and thereby more patches) for the
same region of the shape.

The 2nd image is an orthographic top view and the 4th image shows
where the control points are located.


Any comments ?


Tor Olav


Post a reply to this message


Attachments:
Download 'FivePatches13.jpg' (28 KB) Download 'FivePatches14.jpg' (30 KB) Download 'FivePatches15.jpg' (26 KB) Download 'FivePatches16.jpg' (29 KB)

Preview of image 'FivePatches13.jpg'
FivePatches13.jpg

Preview of image 'FivePatches14.jpg'
FivePatches14.jpg

Preview of image 'FivePatches15.jpg'
FivePatches15.jpg

Preview of image 'FivePatches16.jpg'
FivePatches16.jpg


 

From: Tor Olav Kristensen
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment
Date: 4 Jan 2004 01:19:43
Message: <3ff7b07f@news.povray.org>
And here is a shape where six bicubic patches
meet at one of the control points.

Below is some code that show how the shape was
defined and how macros was called in order to
have the shape drawn.


Tor Olav


#declare A = 0.3;

#declare I = 1.0;
#declare J = 1.0;
#declare K = 1.0;

#declare P = 2.0;
#declare Q = 2.0;
#declare R = 2.0;

#declare Points =
  array[37] {
    < 0,  0,  0>, // 00
    < A, -J, -A>, // 01
    < I, -A,  A>, // 02
    < A,  A,  K>, // 03
    <-A,  J,  A>, // 04
    <-I,  A, -A>, // 05
    <-A, -A, -K>, // 06
    < I, -J,  0>, // 07
    < I,  0,  K>, // 08
    < 0,  J,  K>, // 09
    <-I,  J,  0>, // 10
    <-I,  0 ,-K>, // 11
    < 0, -J, -K>, // 12
    < A, -Q, -A>, // 13
    < P, -A,  A>, // 14
    < A,  A,  R>, // 15
    <-A,  Q,  A>, // 16
    <-P,  A, -A>, // 17
    <-A, -A, -R>, // 18
    < I, -Q,  0>, // 19
    < P, -J,  0>, // 20
    < P,  0,  K>, // 21
    < I,  0,  R>, // 22
    < 0,  J,  R>, // 23
    < 0,  Q,  K>, // 24
    <-I,  Q,  0>, // 25
    <-P,  J,  0>, // 26
    <-P,  0, -K>, // 27
    <-I,  0, -R>, // 28
    < 0, -J, -R>, // 29
    < 0, -Q, -K>, // 30
    < P, -Q,  0>, // 31
    < P,  0,  R>, // 32
    < 0,  Q,  R>, // 33
    <-P,  Q,  0>, // 34
    <-P,  0, -R>, // 35
    < 0, -Q, -R>  // 36
  }

#declare Patches =
  array[24] {
    array [4] {  0,  1,  7,  2 }, // 00
    array [4] {  0,  2,  8,  3 }, // 01
    array [4] {  0,  3,  9,  4 }, // 02
    array [4] {  0,  4, 10,  5 }, // 03
    array [4] {  0,  5, 11,  6 }, // 04
    array [4] {  0,  6, 12,  1 }, // 05
    array [4] {  1, 13, 19,  7 }, // 06
    array [4] {  2,  7, 20, 14 }, // 07
    array [4] {  2, 14, 21,  8 }, // 08
    array [4] {  3,  8, 22, 15 }, // 09
    array [4] {  3, 15, 23,  9 }, // 10
    array [4] {  4,  9, 24, 16 }, // 11
    array [4] {  4, 16, 25, 10 }, // 12
    array [4] {  5, 10, 26, 17 }, // 13
    array [4] {  5, 17, 27, 11 }, // 14
    array [4] {  6, 11, 28, 18 }, // 15
    array [4] {  6, 18, 29, 12 }, // 16
    array [4] {  1, 12, 30, 13 }, // 17
    array [4] {  7, 19, 31, 20 }, // 18
    array [4] {  8, 21, 32, 22 }, // 19
    array [4] {  9, 23, 33, 24 }, // 20
    array [4] { 10, 25, 34, 26 }, // 21
    array [4] { 11, 27, 35, 28 }, // 22 
    array [4] { 12, 29, 36, 30 }, // 23
  }


union {
  DrawAllPatches(
    Points,
    Patches,
    PointNormals(Points, Patches)
  )
  texture { ... }
}


Post a reply to this message


Attachments:
Download 'SixPatches.jpg' (31 KB)

Preview of image 'SixPatches.jpg'
SixPatches.jpg


 

From: Tor Olav Kristensen
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 4 Jan 2004 01:59:07
Message: <3ff7b9bb@news.povray.org>
For the curious: Here are the patch numbers in black
and the point numbers in white. (See the table entries
within my previous post.)


Tor Olav


Post a reply to this message


Attachments:
Download 'SixPatches_Numbers.jpg' (43 KB)

Preview of image 'SixPatches_Numbers.jpg'
SixPatches_Numbers.jpg


 

From: Tor Olav Kristensen
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 4 Jan 2004 02:14:06
Message: <3ff7bd3e@news.povray.org>
Tor Olav Kristensen <tor_olav_kCURLYAhotmail.com> wrote in 
news:3ff7b07f@news.povray.org:

> #declare A = 0.3;
> 
> #declare I = 1.0;
> #declare J = 1.0;
> #declare K = 1.0;
> 
> #declare P = 2.0;
> #declare Q = 2.0;
> #declare R = 2.0;

The attached image is the result if these numbers are
changed to this:

#declare A = 0.10;

#declare I = 0.4;
#declare J = 0.4;
#declare K = 0.4;

#declare P = 2.0;
#declare Q = 2.0;
#declare R = 2.0;


Ok - Now I'll stop posting images to this thread.


Tor Olav


Post a reply to this message


Attachments:
Download 'SixPatches02.jpg' (29 KB)

Preview of image 'SixPatches02.jpg'
SixPatches02.jpg


 

From: Christoph Hormann
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 4 Jan 2004 05:02:04
Message: <dk4lc1-1p2.ln1@triton.imagico.de>
These all look very interesting, i wonder if this could be extended to a 
system to design shapes with smooth transits, with a few elements like 
this you could build a rounded version of any CSG made of axis-aligned 
boxes.

Christoph

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


Post a reply to this message

From: Jellby
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 4 Jan 2004 06:24:05
Message: <3ff7f7d4@news.povray.org>
Among other thigs, Christoph Hormann wrote:

> These all look very interesting, i wonder if this could be extended to a
> system to design shapes with smooth transits, with a few elements like
> this you could build a rounded version of any CSG made of axis-aligned
> boxes.

Indeed, interesting...

Could you extend the macros to automatically "patch" parametric shapes or 
isosurfaces (Something like Ingo's MMMM)?

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 4 Jan 2004 19:41:40
Message: <3ff8b2c4$1@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote in news:dk4lc1-
1p2### [at] tritonimagicode:

> 
> These all look very interesting, i wonder if this could be extended to a 
> system to design shapes with smooth transits, with a few elements like 
> this you could build a rounded version of any CSG made of axis-aligned 
> boxes.

Good idea.

It should certainly be possible, but I'll have to think
about it for a while to find out how to do it.


Tor Olav


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment - 1 attachment
Date: 4 Jan 2004 19:54:54
Message: <3ff8b5de@news.povray.org>
Jellby <jel### [at] M-yahoocom> wrote in news:3ff7f7d4@news.povray.org:

> Among other thigs, Christoph Hormann wrote:
> 
>> These all look very interesting, i wonder if this could be extended
>> to a system to design shapes with smooth transits, with a few
>> elements like this you could build a rounded version of any CSG made
>> of axis-aligned boxes.
> 
> Indeed, interesting...
> 
> Could you extend the macros to automatically "patch" parametric shapes
> or isosurfaces (Something like Ingo's MMMM)?

It is hard to do with the current version of the
macros, but the previous versions of them can easily
be used for this.

Here's an example image I rendered of a Moebious strip
defined as a parametric surface:

#declare xFn = function(u, v) { cos(u)*(1 + v*cos(u/2)) }
#declare yFn = function(u, v) { sin(u)*(1 + v*cos(u/2)) }
#declare zFn = function(u, v) { v*sin(u/2) }

The surface in the image is made with 33 bicubic patches.


Tor Olav


Post a reply to this message


Attachments:
Download 'MoebiusBicubicMesh.jpg' (46 KB)

Preview of image 'MoebiusBicubicMesh.jpg'
MoebiusBicubicMesh.jpg


 

From: Rune
Subject: Re: Patches for arbitrary topology shapes - 4 attachments
Date: 5 Jan 2004 09:26:05
Message: <3ff973fd@news.povray.org>
I have never been able to figure out how to completely smoothly have
another number than four bicubic patches meet at a point. What rules did
you use to accomplish it?

It would be nice if you gave all the patches the same color, and maybe a
little phong or specular, so the smoothness can be better examined. From
the posted images, it's impossible to tell if the surface really is
completely smooth.

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com **updated Dec 30**
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Christoph Hormann
Subject: Re: Patches for arbitrary topology shapes - 4 attachments - 1 attachment - 1 attachment
Date: 5 Jan 2004 10:46:24
Message: <2bdoc1-hpt.ln1@triton.imagico.de>
Tor Olav Kristensen wrote:
> 
>>These all look very interesting, i wonder if this could be extended to a 
>>system to design shapes with smooth transits, with a few elements like 
>>this you could build a rounded version of any CSG made of axis-aligned 
>>boxes.
> 
> 
> Good idea.
> 
> It should certainly be possible, but I'll have to think
> about it for a while to find out how to do it.

Thinking a bit more about it: There are possible special cases where 
things might get quite complicated - But it should not be too difficult 
to do for a difference between two boxes for example: check every corner 
  of the second box if it is inside the first box and trace along all 
edges.  This information should be enough to build the resulting shape.

The whole thing might be easier though if you start with a analytical 
tesselation algorithm (approach would be similar as drafted above with 
insideness tests and traces) and then apply a subdivision algorithm and 
forget about bicubic patches (and if you are even lazier you forget 
about POV-SDL and model your shape in Wings3D :-)).

Christoph

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


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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