POV-Ray : Newsgroups : povray.general : Bicubic patch with 3 corners ? Server Time
8 Aug 2024 16:16:21 EDT (-0400)
  Bicubic patch with 3 corners ? (Message 1 to 6 of 6)  
From: Rune
Subject: Bicubic patch with 3 corners ?
Date: 7 Dec 2000 13:36:55
Message: <3a2fd8c7@news.povray.org>
I have learned myself how to handcode bicubic patches that fits seamlessly
together. However, I never get the result I want when I try to make a patch
where two of the corners lie in the same point.

Say I want to make a unit-sphere made of 8 bicubic patches. Could you show
me what one of those patches would look like in POV-code? It doesn't have to
be a 100% perfect sphere, but I don't want any "folds" anywhere.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated October 9)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Ron Parker
Subject: Re: Bicubic patch with 3 corners ?
Date: 7 Dec 2000 14:29:51
Message: <slrn92vp9h.s4l.ron.parker@fwi.com>
On Thu, 7 Dec 2000 18:54:31 +0100, Rune wrote:
>I have learned myself how to handcode bicubic patches that fits seamlessly
>together. However, I never get the result I want when I try to make a patch
>where two of the corners lie in the same point.

I think it's a difficult problem to solve in the general case without 
introducing "folds."

>Say I want to make a unit-sphere made of 8 bicubic patches. Could you show
>me what one of those patches would look like in POV-code? It doesn't have to
>be a 100% perfect sphere, but I don't want any "folds" anywhere.

I'd cheat and make it out of 10 bicubic patches: 8 in the obvious places and
another 2 at the poles.  Somewhat like a beach ball.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: ddombrow
Subject: Re: Bicubic patch with 3 corners ?
Date: 7 Dec 2000 14:40:42
Message: <3a2fe7ba$1@news.povray.org>
here's a patch to get you started:

bicubic_patch {
  type 1
  flatness 0
  u_steps 8
  v_steps 8
  <-1, 0, 0> <-1, 0.5, 0> <-0.5, 1, 0> <0, 1, 0>
  <-1, 0, 0> <-1, 0.5, -0.5> <-0.5, 1, -0.5> <0, 1, -0.5>
  <-1, 0, 0> <-1, 0.5, -0.5> <-0.5, 0.5, -1> <0, 0.5, -1>
  <-1, 0, 0> <-1, 0, -0.5> <-0.5, 0, -1> <0, 0, -1>
 }

that's the left forward quad of the upper hemisphere
--
Dan D.

"Through the Eye of a Needle"
http://filebox.vt.edu/users/ddombrow/


Post a reply to this message

From: Alexander Enzmann
Subject: Re: Bicubic patch with 3 corners ?
Date: 7 Dec 2000 14:42:11
Message: <3A2FE895.541040B1@mitre.org>
Rune wrote:
> 
> I have learned myself how to handcode bicubic patches that fits seamlessly
> together. However, I never get the result I want when I try to make a patch
> where two of the corners lie in the same point.

If you have a degenerate edge, you will probably get really nasty
normals out of POV-Ray.  As I recall, there's no code to think about
that case.

> 
> Say I want to make a unit-sphere made of 8 bicubic patches. Could you show
> me what one of those patches would look like in POV-code? It doesn't have to
> be a 100% perfect sphere, but I don't want any "folds" anywhere.

You can't make a sphere out of (non-rational) bicubic Bezier patches. 
It will always have some under or overshoot.

I'd suggest 6 sets of patches.  Think of a cube that's been inflated. 
You don't want to use just 6 patches, since you won't get the tangency
conditions right (well, not and also get something that looks
spherical).  Make each of the 6 faces out of at least 3x3 patches.

For tangency across two patches, remember that the control point on the
edge of the two patches, plus the one that is one step over from the
edge of the two patches have to be in a line.

Xander


Post a reply to this message

From: Chris Colefax
Subject: Re: Bicubic patch with 3 corners ?
Date: 7 Dec 2000 20:18:47
Message: <3a3036f7@news.povray.org>
Rune <run### [at] inamecom> wrote:
> I have learned myself how to handcode bicubic patches that fits seamlessly
> together. However, I never get the result I want when I try to make a
patch
> where two of the corners lie in the same point.
>
> Say I want to make a unit-sphere made of 8 bicubic patches. Could you show
> me what one of those patches would look like in POV-code? It doesn't have
to
> be a 100% perfect sphere, but I don't want any "folds" anywhere.

You certainly won't get a perfect sphere, firstly because Bezier splines
aren't capable of producing exact spherical arcs, and secondly because the
patches use a triangle mesh approximation.

You can, however, get pretty close.  As you've no doubt found, making the
tangent points of adjacent patches co-linear gives smooth joins without
folds.  For three-cornered patches, the trick is to make sure you don't use
tangent points that are the same as your corner points.  With a little trial
and error, this code seems to create a pretty good sphere:

#declare Q = bicubic_patch {
   type 1 u_steps 3 v_steps 3 flatness .01
   <0, 0, 1>, <.5, 0, 1>, <1, 0, .5>, <1, 0, 0>,
   <0, .5, 1>, <.5, .5, 1>, <1, .5, .5>, <1, .5, 0>,
   <0, 1, .5>, <.3, 1, .5>, <.5, 1, .3>, <.5, 1, 0>,
   y, <.001, 1, .002>, <.002, 1, .001>, y
   }

union {
   object {Q} object {Q scale <1, 1, -1>}
   object {Q scale <-1, 1, -1>} object {Q scale <-1, 1, 1>}
   object {Q scale <1, -1, 1>} object {Q scale <1, -1, -1>}
   object {Q scale <-1, -1, -1>} object {Q scale <-1, -1, 1>}
   pigment {onion color_map {[0 rgb x] [.5 rgb y] [1 rgb z]} frequency 20}
   }

The onion pigment allows you to see the margin of error - the entire surface
is within 1/20 of the unit radius, so it's reasonably close.  The last row
of the patch points is at the pole - as you can see, I've used the same
point for the actual corners, but I've used different tangent points so
there's no pinching at the poles of the finished sphere.


Post a reply to this message

From: Rune
Subject: Re: Bicubic patch with 3 corners ?
Date: 9 Dec 2000 06:20:42
Message: <3a32158a@news.povray.org>
Thank you all for your help!

My real problem was not to create a sphere; it was merely an example.
But just for the fun of it I tried to make a unit sphere as perfect as
possible.
Here's one that has a radius ranging from 0.999 to 1.001.

#declare Patch =
bicubic_patch {
   type 1 flatness 0 u_steps 4 v_steps 4
   <-1,0.000,-0.000>, <-1,0.553, 0.000>, <-0.553,1.000, 0.000>, <0,1.000,
0.000>,
   <-1,0.006,-0.003>, <-1,0.553,-0.300>, <-0.553,1.000,-0.553>,
<0,1.000,-0.553>,
   <-1,0.003,-0.006>, <-1,0.300,-0.553>, <-0.553,0.553,-1.000>,
<0,0.553,-1.000>,
   <-1,0.000,-0.000>, <-1,0.000,-0.553>, <-0.553,0.000,-1.000>,
<0,0.000,-1.000>
}

union {
   object {Patch scale <+1,+1,+1>}
   object {Patch scale <-1,+1,+1>}
   object {Patch scale <+1,-1,+1>}
   object {Patch scale <-1,-1,+1>}
   object {Patch scale <+1,+1,-1>}
   object {Patch scale <-1,+1,-1>}
   object {Patch scale <+1,-1,-1>}
   object {Patch scale <-1,-1,-1>}
   pigment {color rgb 1}
}

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated October 9)
/ Also visit http://www.povrayusers.org


Post a reply to this message

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