POV-Ray : Newsgroups : povray.newusers : Artefact in lathe object using hollow and interior media emission Server Time
20 Apr 2024 04:31:38 EDT (-0400)
  Artefact in lathe object using hollow and interior media emission (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain Martel
Subject: Re: Artefact in lathe object using hollow and interior media emission
Date: 28 Jan 2021 12:15:35
Message: <6012f137$1@news.povray.org>
Le 2021-01-20 à 05:12, nj a écrit :
> Thanks a lot! That brings me closer to understanding the problem :)
> 
> I still have trouble converting it into a working solution for the spline that I
> actually want. So, if you don't mind, here's another -- less minimal -- example:
> 
> 
> #version 3.7;
> 
> camera {
>    location  <-1, 2, -4>
>    look_at   <-0, 0, 0>
> }
> 
> lathe {
>      cubic_spline
>      7,
>      <0, -20>, <1, -20>,
>      <0.5, -10>, <0.1, 0>, <0.5, 10>,
>      <1, 20>, <0, 20>
> 
>      hollow
>      pigment { rgbf 1 }
>      interior { media { emission <1, 1, 1> } }
> 
>      rotate <0, 0, 90>
> }
> 
> 
> What I still don't quite get is this: Why is the problem occurring where it
> occurs? Or better -- if it's solvable by inserting more points -- how do I know
> where to insert them?
> 
> Also, I would need to know where on the spline the inserted points need to be.
> For the cylinder, this was trivial. Now, I could calculate values on a spline
> (for instance, using scipy.interpolate.spline) and insert those. But I haven't
> really wrapped my mind around this idea, since I'd assume the spline algorithm
> in povray would do exactly the same already!?
> 
> 

You may want to use sturm here.
Your lathe will use a different, more accurate root solver. It's 
somewhat slower, but, in some cases, it can get rid of artifacts like yours.
It becomes something like this :

lathe {
     cubic_spline
     7,
     <0, -20>, <1, -20>,
     <0.5, -10>, <0.1, 0>, <0.5, 10>,
     <1, 20>, <0, 20>

    sturm // Use the Sturmian root solver.
	// Slower but more accurate.
     hollow
     pigment { rgbf 1 }
     interior { media { emission <1, 1, 1> } }

     rotate <0, 0, 90>
}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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