POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0) Server Time
14 Oct 2024 08:34:22 EDT (-0400)
  Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0) (Message 1 to 4 of 4)  
From: William F Pokorny
Subject: Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0)
Date: 28 May 2024 04:51:40
Message: <66559b1c@news.povray.org>
In short, make the brick discrete value pattern easier to use.

Move the 'brick_size' and 'mortar' keywords to the generic 'ip_size' and 
'ip_spacing' keywords respectively. The ip_size is now the actual 3D 
brick size and not the brick+mortar size. The ip_spacing is now a 3D 
vector indicating the brick to brick space (mortar thickness) in each of 
the three directions.

The ip_spacing vector components can be zero - in which case the brick 
effectively becomes infinite in that direction. This capability makes it 
easier to apply and map the 'brick' pattern.

In other words, being able to zero the mortar between bricks in one 
direction helps avoid the common issue of surfaces drifting into the 
mortar regions of the pattern. See attached image with the traditional 
'brick' pattern in the left column and the updated yuqk implementation 
in the right column.

Lastly, an internal pattern offset using the mortar value was removed as 
its aim now addressed by being able to zero spacing directions. This 
change should make the pattern somewhat more intuitive to use as well.

Bill P.


Post a reply to this message


Attachments:
Download 'brick_01.pov.txt' (3 KB) Download 'brickv4story.png' (124 KB)

Preview of image 'brickv4story.png'
brickv4story.png


 

From: tTh
Subject: Re: Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0)
Date: 28 May 2024 05:40:08
Message: <6655a678$1@news.povray.org>
On 5/28/24 10:51, William F Pokorny wrote:

> In short, make the brick discrete value pattern easier to use.
    Also in short, I like that :)

-- 
+---------------------------------------------------------------------+
|          https://tube.interhacker.space/a/tth/video-channels        |
+---------------------------------------------------------------------+


Post a reply to this message

From: Bald Eagle
Subject: Re: Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0)
Date: 28 May 2024 13:25:00
Message: <web.66561318b38f255fe21e5c0b25979125@news.povray.org>
Damn.
Nice job!

I'd like a look at the source for that little snippet, to see how you made the
improvements.  :)

Did you borrow your solution from somewhere, or is this home-rolled?

I like both examples - they really show how the changes make it BETTER.

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: Suggest v4.0 updates to 'brick'. (yuqk R15 v0.6.9.0)
Date: 29 May 2024 04:00:23
Message: <6656e097$1@news.povray.org>
On 5/28/24 13:23, Bald Eagle wrote:
> I'd like a look at the source for that little snippet, to see how you made the
> improvements.  🙂
> 
> Did you borrow your solution from somewhere, or is this home-rolled?

In this case, once I finally looked in detail at the core 'brick' code, 
I found it was mostly, already set up in a way to support the changes I 
made...

In the yuqk code base, and the file pattern.cpp (where there was already 
change relative to v3.8), the older code:

double BrickPattern::Evaluate(const Vector3d& EPoint,
   const Intersection* /*pIsection*/,
   const Ray* /*pRay*/, TraceThreadData* /*pThread*/) const
{
// pIsection, pRay, pThread not presently used.
// Commented to avoid -Wunused-parameter

     int ibrickx, ibricky, ibrickz;
     double brickheight, brickwidth, brickdepth;
     double brickmortar, mortarheight, mortarwidth, mortardepth;
     double brickx, bricky, brickz;
     double x, y, z, fudgit;

     fudgit = gkDBL_epsilon + mortar;

     x =  EPoint[X]+fudgit;
     y =  EPoint[Y]+fudgit;
     z =  EPoint[Z]+fudgit;

     brickwidth  = brickSize[X];
     brickheight = brickSize[Y];
     brickdepth  = brickSize[Z];
     brickmortar = mortar;

     mortarwidth  = brickmortar / brickwidth;
     mortarheight = brickmortar / brickheight;
     mortardepth  = brickmortar / brickdepth;
...

was changed to:

double BrickPattern::Evaluate(const Vector3d& EPoint,
   const Intersection* /*pIsection*/,
   const Ray* /*pRay*/, TraceThreadData* /*pThread*/) const
{
// pIsection, pRay, pThread not presently used.
// Commented to avoid -Wunused-parameter

     int ibrickx, ibricky, ibrickz;
     double brickheight, brickwidth, brickdepth;
     double mortarheight, mortarwidth, mortardepth;
     double brickx, bricky, brickz;
     double x, y, z;

     x = EPoint[X]+gkMinIsectDepthReturned;
     y = EPoint[Y]+gkMinIsectDepthReturned;
     z = EPoint[Z]+gkMinIsectDepthReturned;

     brickwidth  = brickSize[X] + brickSpacing[X];
     brickheight = brickSize[Y] + brickSpacing[Y];
     brickdepth  = brickSize[Z] + brickSpacing[Z];

     mortarwidth  = brickSpacing[X] / brickwidth;
     mortarheight = brickSpacing[Y] / brickheight;
     mortardepth  = brickSpacing[Z] / brickdepth;
...

The whole of the change covers roughly a half a dozen source code files 
and as many, or more, files related to documentation, examples and 
testing. All of that not being very interesting and amounting to the 
cost of almost any change in how stuff works! :-)

Bill P.


Post a reply to this message

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