POV-Ray : Newsgroups : povray.general : Could Pov-Ray render these dark edge lines? : Re: Could Pov-Ray render these dark edge lines? Server Time
29 Jul 2024 04:26:35 EDT (-0400)
  Re: Could Pov-Ray render these dark edge lines?  
From: Samuel Benge
Date: 22 Jan 2013 14:30:01
Message: <web.50fee856c4eac8c2d92b408d0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
>
> Also, for smoothly curved objects you can highlight their
> outer contours using the aoi pattern.

That might work in theory, but in practice it usually looks terrible.

Here's something I've used that works fairly well for outlining an object:

#declare MyObj =
 union{
  box{-1, 1 scale <1, .2, .2>}
  box{-1, 1 scale <.2, 1, .2>}
  box{-1, 1 scale <.2, .2, 1>}
 }

#declare NPts = 32; // number of "samples"
#declare Rad = .04; // outline thickness

// the object rendered normally
object{MyObj pigment{rgb 1}}

// the object's outline
merge{
 // the Golden Spiral laid out onto a sphere
 #local Inc = pi * (3 - sqrt(5));
 #local Off = 2 / NPts;
 #for(K, 0, NPts-1)
  #local Y = K * Off - 1 + (Off / 2);
  #local R = sqrt(1 - Y*Y);
  #local Phi = K * Inc;
  object{
   MyObj
   translate <cos(Phi)*R, Y, sin(Phi)*R>*Rad
  }
 #end
 texture{pigment{rgbt 1}}
 // the color of the outline
 interior_texture{
  pigment{rgb z/4}
  finish{ambient 1 diffuse 0}
 }
 no_shadow
}

There will be artifacts which may or may not be eliminated by choosing points
throughout a sphere, not just on the surface of one.

Speaking of which... if one of you math geniuses out there could produce a means
for distributing points /within/ a sphere using the Golden Spiral, that would
help a lot (it would help make a great proximity pattern).

Sam


Post a reply to this message

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