POV-Ray : Newsgroups : povray.advanced-users : Density filling option for polygon : Re: Density filling option for polygon Server Time
29 Apr 2024 06:30:16 EDT (-0400)
  Re: Density filling option for polygon  
From: Le Forgeron
Date: 5 Jun 2018 14:18:07
Message: <5b16d3df$1@news.povray.org>
Le 05/06/2018 à 03:24, Hedrondude a écrit :
> clipka <ano### [at] anonymousorg> wrote:
>> Am 04.06.2018 um 04:29 schrieb Hedrondude:
>>
>>> Another cool feature would be to color polygons according to density or to leave
>>> some densities unfilled.
>>
>> I don't think the former would be possible /per se/ with reasonable
>> effort. The latter would probably be quite easy to implement (and could
>> then be used to emulate the former, by using copies of the polygon with
>> different colours and different density ranges), but we'd need to find a
>> neat syntax for such a feature.
> 
> ideas for syntax:
> 
> binary filling, leave as is:
> 
> polygon {n, v1,v2,v3,...v1}
> 
> density filling:
> 
> polygon {n, v1,v2,v3,...v1 density}
> 
> fill in one particular density
> 
> polygon {m,v1,v2,v3,...v1 density d}
> 
> fill in m particular densities:
> 
> polygon {n, v1,v2,v3,...v1 density {m,d1,d2,d3,..,dn}}
> 
> 
> 


I'd like to remember everyone that shape and pattern are two different
(and independent) items in Povray.
(well, usually... I tried a per-vertex colouring of polygon using
texture_list, with interpolation between vertices)

The shape (polygon) with "density" is actually a simplified polygon
without holes.

Applying a pattern based on polygon and "density" would be a discrete
function used as input of a map (texture_map, pigment_map, color_map, ...).

My main problem is that usual map goes from 0 to 1, but here we would
have integer values (the same issue that hexagon pattern has).
Either there is a user input of the max to reduce to 0..1, or the map is
warped as having entries at (n/n+1)
(density 0 at 0, density 1 at 1/2, density 2 at 2/3 and so on, never
reaching 1.0)


Diverging from general polygon, but probably still relevant for the
original poster: using interunion{} and its range{}
( http://wiki.povray.org/content/User:Le_Forgeron#Interunion )
whose domain is making easy the stellated polyhedron (despite the
default illustration) can be a path to explore.

On the other hand, adding a new object (not distracting the
hyper-optimised code of polygon) which would allow to handle the notion
of selected density as a bitmap, is also a possible path.
(but unlike interunion, negative number cannot be used as shortcut in range)


Post a reply to this message

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