POV-Ray : Newsgroups : povray.newusers : <no subject> : Re: <no subject> Server Time
18 Apr 2024 20:32:36 EDT (-0400)
  Re: <no subject>  
From: William F Pokorny
Date: 25 Nov 2018 11:00:53
Message: <5bfac735$1@news.povray.org>
On 11/24/18 10:09 PM, j13r wrote:
> Hi all,
> 
> I would like to make a image of magnetic field loops (similar to these:
>
https://ichef.bbci.co.uk/news/304/media/images/58947000/jpg/_58947314_162169main_trace_solar_flare_lg-1.jpg
> https://martianchronicles.files.wordpress.com/2010/05/loops.gif
> http://www.space.com/images/i/000/015/747/original/sun-as-art-swirls.jpg
> more information here: https://en.wikipedia.org/wiki/Coronal_loop
> )
> The only difference is that I want them on a disk.
> 
...
> I was wondering if you could suggest a smarter technique?
> 
> It would also be good to be more flexible than with the torus.
> I attached my code below.
> 
> Cheers,
>         Johannes
> 

Hello.

With respect to performance and the current approach you can speed 
things up some by not having a light source in each of your glowarc 
shapes. At 130 of them I think you might be near the limit for light 
sources - but I don't immediately remember that limit. In any case some 
method to use fewer lights would help. These are only to light the disk.

You can also speed things up by not doing the differences to create half 
torus shapes(1). Instead of:

#declare arc=
difference {
  torus {
   5, 0.04           // major and minor radius
   rotate -90*x      // make vertical
   }
  box {<-6,-6,-1>, <6,0,1>}
}

use:

#declare arc=
   torus {
    5, 0.04           // major and minor radius
    rotate -90*x      // make vertical
   }

(1) - Your approach 'would' avoid a potential shadow calculation issue 
with POV-Ray where surfaces intersect, but you have clear textures so it 
shouldn't matter to use the torus shapes straight up.

With respect to better approaches, I cannot think of any at the moment 
which are easier.

Rather than many lights using radiosity with your emitting media will at 
some point be the better way to go. Further, using df3 files to create 
complex media would give you the flexibility in density control - even 
color with some set ups - but you have to figure you how to create the 
df3 files. There have been several threads related to df3's used in such 
a fashion in the last year or two.

As another idea. Given you have started with torus shapes there was a 
macro posted by Bruno Cabasson back in March of 2006 which can create a 
blob based torus shape. If you are running a pre-release of v3.8, blobs 
now support a potential pattern which can be used to create glowing 
media. I posted an image to povray.binaries.images (p.b.i) under the 
subject "Example of potential pattern use with emitting media" in 
October of 2016 which makes use of this newer technique. Combining the 
macro and potential pattern might be a way to handle the media as one 
large blob contained and blob-potential for the media density.

That rambling done, the bad news is your scene is a pretty good example 
showing current POV-Ray solver/solver set up issues with secondary rays.
In all approaches where the media density is not at 0.0 near surface 
tangents(2) we today too often get media artifacts due the media 
intervals being wrongly determined and mostly that gets to how the 
solvers are working. I've been working most of this year with the 
solvers and related code trying to clean up some of these long standing 
issues. I'll post comparison of the existing master branch to my 
'better' working branch to p.b.i. and add your scene as one of my test 
scenes. Today, you can 'sometimes' clean up many of the artifacts by 
scaling the entire scene up (or down) by 100 or 1000x.

(2) - The full story is much more complicated.

Bill P.


Post a reply to this message

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