POV-Ray : Newsgroups : povray.advanced-users : Density filling option for polygon : Re: Density filling option for polygon Server Time
26 Apr 2024 10:45:52 EDT (-0400)
  Re: Density filling option for polygon  
From: Le Forgeron
Date: 4 Jun 2018 11:30:01
Message: <5b155af9$1@news.povray.org>
Le 04/06/2018 à 04:29, Hedrondude a écrit :

> Thanks for the replies everyone.
> 
> For density filling, take each edge (Xa,Ya)->(Xb,Yb) and it's direction (if
> heading downwards (clockwise) then direction=+1, if heading upwards (counter
> clockwise) then direction=-1) and test if it intersects the ray
> (Xp,Yp)->(+inf,Yp) - add up all of the direction values to get the density of
> the region.  That should do it.
> 
> Another cool feature would be to color polygons according to density or to leave
> some densities unfilled.
> 

After thought, I'm afraid there is a big problem: in Povray, polygon
(and actually triangle too) are not oriented. This is basically the root
of the non-handness commitment.

As long as "density" would need an orientation to work correctly, it
would be not-compatible with the parsing of polygon using 3D vectors.

On the other hand, the polygon of Povray allows the removal of inner
parts, something usual polygons do not allow without tricking (such as
zero-width links between outside perimeter and inner holes).

polygon { Number, V1, V2, ... Vk, V1,
H1, H2, ... Hm, H1 }

Vx being outside perimeter
Hx being inside hole perimeter (and holes can be repeated)


Post a reply to this message

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