POV-Ray : Newsgroups : povray.general : Is this an optimum outline for Mesh_Smoothing macro? Server Time
20 Nov 2024 00:38:46 EST (-0500)
  Is this an optimum outline for Mesh_Smoothing macro? (Message 1 to 9 of 9)  
From: Shay
Subject: Is this an optimum outline for Mesh_Smoothing macro?
Date: 28 Dec 2001 15:45:12
Message: <3c2cd9d8$1@news.povray.org>
I was looking at bicubic patches, but they seem pretty limiting so I want to
try modeling with mesh2. I want to write a macro that will figure the normal
vertices. I am assuming that I created the triangles myself, so all faces
will be defined clockwise. This is the best idea I could come up with. Is
there a faster way? Unfortunately, I know very little of programming outside
of Povray.


#macro Mesh_Smooth (VERTICES_array, FACES_array)

Make a 1D array (VCOUNT_array) to store the number of times each element in
VERTICES_array appears in FACES_array

Make a 1D array (NFACES_array) to store the normals of each face in
FACES_array

Make a 1D array (CHECKED_array) to store the number of times a faces normal
has been used to determine a vertex normal

************

Start with VERTICES_array[n]

Create 1D array (USEDFACES_array) with VCOUNT_array[n] elements to store the
NFACES.array positions used in determining the vertex normal

Create 1D array (FVNORMS_array) with VCOUNT_array[n] elements to store the
NFACES.array content used in determining the vertex normal

Make a loop from 0 to VCOUNT_array[n]-1

Search in FACES_array for occurances of VERTEX_array[n]

When found, check for normal in NFACES_array and if not present, calculate
the normal of the face and store it in NFACES_array and in FVNORMS._array.
Also, increase CHECKED_array[n] by one and store "n" in USEDFACES_array.

When appropriate number of faces have been calculated, calculate vertex
normal and output it to a file

Use USEDFACES_array to check CHECKED_array for faces which have been used
three times. Remove any which have from FACES_array, NFACES_array, and
CHECKED_array.

Repeat.


Post a reply to this message

From: John VanSickle
Subject: Re: Is this an optimum outline for Mesh_Smoothing macro?
Date: 30 Dec 2001 03:32:30
Message: <3C2ED20F.C887BBCA@hotmail.com>
Shay wrote:
> 
> I was looking at bicubic patches, but they seem pretty limiting so I
> want to try modeling with mesh2. I want to write a macro that will
> figure the normal vertices. I am assuming that I created the triangles
> myself, so all faces will be defined clockwise. This is the best idea
> I could come up with. Is there a faster way? Unfortunately, I know
> very little of programming outside of Povray.

If you download the Subdivision Surface Suite at:

  http://enphilistor.users4.50megs.com/sss.htm

You can find code that will help you.

Although the code I have at the above location doesn't support sharp
edges, you might want to do so.  It requires maintaining the state of
each edge, and the calculations get a bit more complicated, but
allows much more flexibility in the models you can support.

-- 
ICQ: 46085459


Post a reply to this message

From: Shay
Subject: Re: Is this an optimum outline for Mesh_Smoothing macro?
Date: 31 Dec 2001 17:14:27
Message: <3c30e343@news.povray.org>
Thank you,
 I have enjoyed studying your macros.


Post a reply to this message

From: Michael Andrews
Subject: Why can I not download sss.zip?
Date: 2 Jan 2002 11:41:48
Message: <3C3339BC.6020507@reading.ac.uk>
John VanSickle wrote:

> If you download the Subdivision Surface Suite at:
> 
>   http://enphilistor.users4.50megs.com/sss.htm
> 


Clicking on the sss.zip link I get a screen that shows:

"Forbidden


Remote Host: [xxx.xxx.xxx.xxx]

You do not have permission to access http://enphilistor.users4.50megs.com/sss.zip

Data files must be stored on the same site they are linked from.

Thank you for using 50megs"

with (I assume) the local proxy IP address where the 'x's are.

Any idea what's wrong? I'm using Netscape 6.2 on NT4 sp6.

Bye for now,
	Mike Andrews.


Post a reply to this message

From: Tom Melly
Subject: Re: Why can I not download sss.zip?
Date: 2 Jan 2002 12:13:37
Message: <3c333fc1$1@news.povray.org>
"Michael Andrews" <M.C### [at] readingacuk> wrote in message
news:3C3### [at] readingacuk...
> John VanSickle wrote:
>
> > If you download the Subdivision Surface Suite at:
> >
> >   http://enphilistor.users4.50megs.com/sss.htm
> >
>
>
> Clicking on the sss.zip link I get a screen that shows:
>
> "Forbidden
>

Try the link on: http://enphilistor.users4.50megs.com/sss.htm

Basically, you are being told that you can only download the file from a link on
a html page on that server (this is to stop people linking to that resource from
other domains).

Oops, I just noticed that that was the link John gave you - have you got some
setting that says "open links in new window" or similiar?


Post a reply to this message

From: Michael Andrews
Subject: Re: Why can I not download sss.zip?
Date: 2 Jan 2002 12:38:12
Message: <3C3346F4.5060901@reading.ac.uk>
Hi Tom,

Tom Melly wrote:

> Oops, I just noticed that that was the link John gave you - have you got some
> setting that says "open links in new window" or similiar?

Hmm, not sure. It's a fairly new install of NS6.2 and I'm trying to 
think whether I've used it to download other things ...

In this case I've tried left-click which should bring up a 'save as' for 
things it can't display, and right-click -> save as which saves the html 
  response masquerading as the .zip file 8-/

I'll have to peer into the settings, I guess ...

Bye for now,
	Mike Andrews.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Why can I not download sss.zip?
Date: 2 Jan 2002 13:08:35
Message: <3c334ca3@news.povray.org>
In article <3c333fc1$1@news.povray.org> , "Tom Melly" <tom### [at] tomandlucouk>
wrote:

> Try the link on: http://enphilistor.users4.50megs.com/sss.htm
>
> Basically, you are being told that you can only download the file from a link
on
> a html page on that server (this is to stop people linking to that resource
from
> other domains).
>
> Oops, I just noticed that that was the link John gave you - have you got some
> setting that says "open links in new window" or similiar?

No, the only way the server can know you linked from its own page is if your
browser sends the referrer information.  While it is in no way required and
supplying it violates the user's privacy most browsers send it by default.
Maybe it was accidentally turned off.  Checking the prefs will help...

    Thorsten


Post a reply to this message

From: ingo
Subject: Re: Why can I not download sss.zip?
Date: 2 Jan 2002 13:08:41
Message: <Xns918AC2F6D602Dseed7@povray.org>
in news:3C3### [at] readingacuk Michael Andrews wrote:

> I'll have to peer into the settings, I guess ...
> 

Are you running Junkbuster or something else that pretevents sending a 
HTTP-Referrer header?

Ingo


Post a reply to this message

From: Michael Andrews
Subject: Problem fixed: Re: Why can I not download sss.zip?
Date: 3 Jan 2002 04:53:31
Message: <3C342B6A.90706@reading.ac.uk>
Hi folks,

I'm still not sure just what the problem was, but after making a few 
changes in the preferences I could download the zip file.

ingo wrote:

> Are you running Junkbuster or something else that pretevents sending a 
> HTTP-Referrer header?
 

I think it was something odd in the file-download preferences. One of 
the things i tried was to hit the 'reset' on the helper applications 
tab. Whether this is what fixed the problem, I'm not sure ...

Thanks to all for the suggestions,

	Mike Andrews.


Post a reply to this message

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