POV-Ray : Newsgroups : povray.general : Curved Triangles Server Time
7 Nov 2024 04:52:51 EST (-0500)
  Curved Triangles (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Ben Chambers
Subject: Curved Triangles
Date: 14 Apr 2002 19:57:25
Message: <3cba1764@news.povray.org>
I've written a small demo program which takes a normal triangle (three 
vertices, three normals), and draws a smooth curve between them 
("smooth" being defined as a variable LOD).  The smooths are both 
continuous (no holes formed) and patch-able (two adjacent triangles, 
sharing an edge, will smoothly mesh together).  Because it operates 
with traditional triangle data (vertices & normals), it is extremely 
easy to switch between a discrete mesh and my LOD triangles.

Would anyone be interested in a POV-Ray macro to draw such things?  The 
syntax would be something like:

curved_triangle(v1, n1, v2, n2, v3, n3)

If so, let me know.

...Chambers


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Curved Triangles
Date: 14 Apr 2002 20:40:42
Message: <3cba218a$1@news.povray.org>
> Would anyone be interested in a POV-Ray macro to draw such things?  The
> syntax would be something like:
>
> curved_triangle(v1, n1, v2, n2, v3, n3)
>
> If so, let me know.
I would!

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

From: Hugo
Subject: Re: Curved Triangles
Date: 15 Apr 2002 03:33:20
Message: <3cba8240@news.povray.org>
> Would anyone be interested in a POV-Ray macro to draw such things?

Definitely!! Very much actually, but it's usability will depend on speed,
and how closely the smooth shape corresponds to the original, intended
shape. Will hard edges that are supposed to be hard, become fully round? It
might be good with a parameter to control smoothness... Do you use a kind of
subdivision so that you stick to using triangles? Or maybe bezier patches is
preferred.

It's a great idea and I am eagerly waiting. Someone already posted code for
making "biquadratic interpolation of heightfield data"  (some time ago. You
could find the code by searching the newsgroup). It's made of quadric, cubic
and quartic patches, and consumes a LOT of memory, but works nicely, though
it's limited to heightfields.

Regards,
Hugo


Post a reply to this message

From: Christoph Hormann
Subject: Re: Curved Triangles
Date: 16 Apr 2002 00:56:20
Message: <3CBBAEF1.A4A8CE99@gmx.de>
Ben Chambers wrote:
> 
> I have here my curvetri.inc file -
> 
>   --------------------------------------------------------------------------
>                    Name: curvetri.inc
>    curvetri.inc    Type: Plain Text (text/plain)
>                Encoding: 8Bit
> 
>                    Name: curvetri.txt
>    curvetri.txt    Type: Plain Text (text/plain)
>                Encoding: 8Bit

*You* should know that you are not supposed to post binaries here.  It
would be good to repost in povray.binaries.scene-files and cancel it here.

BTW, it would be interesting to do this on whole meshes for example using
the hooks the tesselation patch supplies (i.e. access to the mesh data
from within POV-Script).

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 14 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Hugo
Subject: Re: Curved Triangles
Date: 16 Apr 2002 05:50:48
Message: <3cbbf3f8@news.povray.org>
Thank you!!
I'll try to make it work on a mesh2 file.

Regards,
Hugo


Post a reply to this message

From: Hugo
Subject: Re: Curved Triangles
Date: 16 Apr 2002 06:29:18
Message: <3cbbfcfe@news.povray.org>
It probably works - except I have to raise the array sizes vlist and
nlist? - but even with lowest LOD setting the amount of triangles are huge.
I have a mesh2 with just 600 faces, but when I "curve" 40 of them, the
result is over 22000 triangles. Needless to say, 600 faces will eat too much
memory.

Regards,
Hugo


Post a reply to this message

From: Ben Chambers
Subject: Re: Curved Triangles
Date: 16 Apr 2002 13:54:36
Message: <3cbc655c@news.povray.org>
Hugo wrote:

> It probably works - except I have to raise the array sizes vlist and
> nlist? - but even with lowest LOD setting the amount of triangles are
> huge. I have a mesh2 with just 600 faces, but when I "curve" 40 of
> them, the result is over 22000 triangles. Needless to say, 600 faces
> will eat too much memory.

IIRC, the number of faces is something like LOD^2.  What LOD did you 
use?  I find that 5-10 is usually enough, especially with small 
triangles.

I'd like to patch it into POV-Ray itself, for more efficient memory 
usage, but that will take me a while.

...Chambers


Post a reply to this message

From: Ben Chambers
Subject: Re: Curved Triangles
Date: 16 Apr 2002 14:00:13
Message: <3cbc66a4@news.povray.org>
Christoph Hormann wrote:

> 
> 
> Ben Chambers wrote:
>> 
>> I have here my curvetri.inc file -
>
> *You* should know that you are not supposed to post binaries here.  It
> would be good to repost in povray.binaries.scene-files and cancel it
> here.

Done.  Sorry :(

> BTW, it would be interesting to do this on whole meshes for example
> using the hooks the tesselation patch supplies (i.e. access to the
> mesh data from within POV-Script).

I'll see if I get the time - I'd like to do something like that, as it 
would (hopefully) lower memory usage and parsing time.

...Chambers


Post a reply to this message

From: Hugo
Subject: Re: Curved Triangles
Date: 17 Apr 2002 04:11:33
Message: <3cbd2e35$1@news.povray.org>
> IIRC, the number of faces is something like LOD^2.  What LOD did you
> use?  I find that 5-10 is usually enough, especially with small
> triangles.

I use LOD 1 (your minimum) and only tried low numbers.. I would like LOD 1
to mean the double amount of triangles as the input data... The amount you
use is too high for my purposes, and my machine.. It also seems not
necessary because my input files are usually "almost" smooth enough..

Nevertheless you're doing some great things here, that would be quite useful
for anyone playing with meshes and/or imports meshes from modelling
software.

Regards,
Hugo


Post a reply to this message

From: Ben Chambers
Subject: Re: Curved Triangles
Date: 18 Apr 2002 12:59:40
Message: <3cbefb7b@news.povray.org>
Hugo wrote:

>> IIRC, the number of faces is something like LOD^2.  What LOD did you
>> use?  I find that 5-10 is usually enough, especially with small
>> triangles.
> 
> I use LOD 1 (your minimum) and only tried low numbers.. I would like
> LOD 1 to mean the double amount of triangles as the input data...

LOD 1 *should* mean one triangle is used (2 = 4 triangles, 3 = 9 etc).  
I'll look into what's going on here...

 The
> amount you use is too high for my purposes, and my machine.. It also
> seems not necessary because my input files are usually "almost" smooth
> enough..

Well, for high-res meshes, it's not too useful.  The point is that you 
can model curves with many fewer "triangles" with this method.

...Chambers


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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