POV-Ray : Newsgroups : povray.binaries.images : Bricks Library Example (wip) : Bricks Library Example (wip) Server Time
9 May 2024 03:29:34 EDT (-0400)
  Bricks Library Example (wip)  
From: Chris R
Date: 12 Jan 2024 09:45:00
Message: <web.65a14f4a7b00538217021f505cc1b6e@news.povray.org>
I took a little break developing the brick library to start a scene using it.
In all of my code-development life, I have found that creating libraries has to
be a constant interplay of creating the abstraction, using it, and then fine
tuning it for new use cases.

This scene shows a corner of a brick garden wall using the English Bond layout.
There are a total of 4 isosurfaces: one for the bricks on each wall, and one for
the mortar on each wall.

The library system takes care of generating the isosurface functions based on
various inputs, including:
   - Wall dimensions (length, number of courses, half-brick thickness)
   - Wall end types (flush or corner)
   - Brick and mortar sizes
   - Brick shape function

The system then generates a dictionary called a "Layout" that includes functions
that given an <x,y,z> coordinate figure out the origin (left, bottom, front
corner) of the brick/mortar containing that point, the size of the brick, and an
ordinal index into the wall for that brick.  The system uses these to generate
the isosurface functions, but they are also available for the modeler to use for
other purposes.

While creating this scene I decided to add some jitter to the brick locations to
keep them from lining up in an abnormally perfect way.  Originally I took the
isosurface function generated by the system for the bricks and wrapped it in
another function that added some noise to the position, but used the brick
origin functions in the layout so that the noise would be the same for all
points in the brick.  I quickly discovered that I needed to apply this same
jitter to the mortar isosurface function so the mortar joints would line up
correctly, and I needed it for the texture utility that ensures that bricks can
have random textures, but a single brick texture is smooth and consistent.  So,
I decided to add jitter as a first class element of the system.

There is still a fair amount of modeling code beyond calls to the system macros
for this scene.  Most of it is adapting the system's supplied brick shape
functions and mortar joint functions by adding textural noise to them, including
the cracks, as well as defining the textures for the bricks and the mortar.

I plan to develop this scene further and keep it as an example when I eventually
publish the brick library code.  I'm still working out the best way to do that.
I am finding I have to clean up a lot of library code I use so that it doesn't
end up pulling in my entire POV modeling tree.


-- Chris R.
-- Happily rendering since 2014


Post a reply to this message


Attachments:
Download 'corner_v2_2024-01-11.png' (845 KB)

Preview of image 'corner_v2_2024-01-11.png'
corner_v2_2024-01-11.png


 

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