POV-Ray : Newsgroups : povray.binaries.scene-files : Isosurface Approximation macros rewrite : Re: Isosurface Approximation macros rewrite Server Time
25 Apr 2024 13:31:46 EDT (-0400)
  Re: Isosurface Approximation macros rewrite  
From: Tor Olav Kristensen
Date: 5 Mar 2008 21:25:04
Message: <47cf5600@news.povray.org>
Jaap Frank wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> schreef in bericht
> news:47cb52c2$1@news.povray.org...
>> nemesis wrote:
>>> great Tor!
>>>
>>> BTW, while we're at it, how about not letting the code simply eventually
>>> dying out as the previous ones?  Would you be ok about including these
>>> useful set of macros in the Povray Object Collection?  yes, it's about
>>> objects mainly, but I guess useful generic object-making macros would be
>>> a good idea too.  One of the main purposes of the collection is to get
>>> useful povray SDL code under an open-source license so anyone can later
>>> legally modify it.  Since this is a rewrite...
>> Releasing the code that I wrote for these macros under the "Creative
>> Commons - Lesser General Purpose License" is all ok for me.
>>
>> But I think that it is also necessary to get permission from Kevin Loney
>> and Jaap Frank for their contributions.
...
> Hello again Tor Olav,

Hi Jaap


> Thanks for the mail you send.
> I was a couple of years out of circulation, but I'm starting to do something
> with POV-Ray again.

It's good to see you back again !

=)

> I've studied your changes to the file today and you did a marvellous job.
> It's more readable and faster.

Thank you.


> Just a small flaw in the last line inside MakeMesh, it has to be
>     #declare TriCnt = TriCnt + Cnt.
> Now you get the triangle count, else it gives zero.

Ok. Good that you spotted that one.


> Of coarse I tested the last project I was doing with it too - I've put my
> test function crackle in the file - and I have add something to make the
> result more reliable although it makes it slower. Therefore I made a
> variable so you can choose to do this or not.
> It's the variable CenterCheck. It turned out that with a rough function ,
> many pieces and small islands are missed by the tests on inside/outside,
> because all corners are just outside or inside the structure. If you use an
> extra test point in the centre of the cell, you find more pieces of the
> puzzle
> because the grid is smaller. This was not enough for small islands, so I
> made it one level deeper still. It looks two levels deep if Level>=1 in
> the macro MakeMesh, else one level. Deeper probing makes it unac-
> ceptable slow.You can't miss it if you look at the macro.
> 
> Another change is the possibility to choose SubSegs for the recursions.
> If you start with isoSegs = <1,1,1>*6 and Depth = 2, you have to test
> 10 million cells for the surfaces, because all Cells are subdivided in
> 6*6*6 = 216 SubCells and all these cells again in 216 SubCells . Your
> number of cells grows explosively in this way.
> In the old file every Cell was subdivided into eight SubCells, so SubSegs
> was always equal to two. This way you can control the grow of Cells
> better. I've made several test with different combinations and came with
> the following conclusion:
> 1. Smaller SubSegs(2, 3) with higher Depth (3,4,5) is faster.
> 2. Greater SubSegs(4,5) with lower Depth (1,2) is a bit more accurate,
>     but alas it's slower.
> A trade off between accuracy and speed is:
>     isoSegs = <1,1,1>*6
>     SubSegs = 3 and Depth  = 3
>     CenterCheck = on.
> It took about 10 min for a good accurate mesh.
> If you are interested I can send you all the statistics and pictures so you
> can check for yourself. It is a bit too much for the news site, but I will
> show
> some examples.
> 
> POV just crashed on isoSegs=6, SubSegs=4, Depth=3 and CenterCheck
> = on after one and a half hour parsing with 'Out of memory'. The Mesh is
> already .5 Gbyte! It should test about 56 million Cells!
> I have 1 Gbyte of RAM, so it was huge.
> 
> With these new add-ons it gives splendid results and it is very fast, even
> for
> rough surfaces you get acceptable results.  Maybe you see possibilities for
> new streamlining of the code.

It looks promising, but I don't have much spare time these days, so I'll
have to look at your additions at a later moment. Sorry.


> Of coarse nemesis can use it for the Povray Object Collection, if Kevin
> agrees too, because he started it all.

Just for the record:

Does that also mean that you release your contributions to these macros
under the CC-GNU LGPL, as described in this page ?

   http://lib.povray.org/usersguide/04contributing.html

(There's a copy of the licensing section below my signature.)

If both you and Kevin do, then I'll go on and submit the macros to the
collection. (I haven't go any response from Kevin yet. I'm not sure
what his current email address is.)


> Example statistics (you can see the pictures):
> 
> Fn        Segs  SubSegs  Depth  Check      TriCnt       Time
> Correct?
> --------------------------------------------------------------------------
> 2Pi          5         5            1         off          38250
> 16s        holes
> 2Pi          5         5            1          on         52190
> 22s         +
> 8Pi          7         7            1          off       695190        3m
> 39s        holes
> 8Pi          7         7            1          on       778456        4m
> 8s          +
> Crackle   6         6            2          on       978552      13m 10s

> Crackle   6         6            2          on      1774660     26m 33s
> +++
> Crackle   6         2            5          on      1184460     13m 29s
> ++
> Crackle   6         3            3          on        919184     10m 53s

> 
> The 2Pi and 8Pi refer to the triple cosine functions.
> 
> You can test my files and see some results with it.

I'll do that.

-- 
Tor Olav
http://subcube.com


4.2  Licensing
In order to submit a contribution to this collection you must be willing 
and able to agree to the terms of use and distribution covering this 
collection. All of the files from this collection are currently governed 
by the Creative Commons - Lesser General Purpose License (CC-GNU 
LGPL). 	CC-GNU LGPL
Before submitting any files to this collection you must:

     * Verify that you are entitled to grant permission for the 
distribution and use of all the files you contribute
     * Grant the right to distribute the files you contribute under the 
terms of this license in perpetuity.
     * Grant the right in perpetuity for the use without restriction of 
images generated using the files you contribute.
     * Confirm that you have incorporated the following licensing 
statement into all .pov and .inc files that you submit:
          // This file is licensed under the terms of the CC-LGPL

The POV-Ray Team reserve the right to change the licensing conditions 
for the collection in the future, in which case anyone who has 
downloaded files under the CC-GNU LGPL will continue to be covered by 
that license or may choose to use the new license.


Post a reply to this message

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