POV-Ray : Newsgroups : povray.general : rounded_objects: a new feature? : rounded_objects: a new feature? Server Time
3 May 2024 03:33:21 EDT (-0400)
  rounded_objects: a new feature?  
From: John Greenwood
Date: 13 Sep 2016 12:10:00
Message: <web.57d824b06e16d4fda7cafab50@news.povray.org>
The way this would work is, as I understand it, basically the same as blobs,
but, to avoid confusion, I will describe what I have in mind without using blob
terminology.

rounded_object command would followed by a surface count scalar, normally an
integer and a number of element definitions of different types.

One type of element will be an infinite plane with an inside and an outside. It
could be defined either by a vector for a point in the plane and a direction
vector defining the normal and the side, or by three vectors for points in the
plane, with the inside defined by the handedness of these points. There would be
a scalar value to define the radius of the corners

As each ray chugs through design space it will need to know its distance from
each of these planes and on which side it is. Associated with each plane is a
"field" which has the value of 1 at distances greater than the corner radius
from the inside and -1 at distances greater than the same distance outside.
Between these two the strength of the field follows a sine curve, going through
zero at the plane itself. The field values of all the elements are summed. (The
calculation might be faster with cubic; the corners would not be exactly
circular, but would anyone notice or care?)

A simple tetrahedral rounded object can be created with four plane elements. The
ray decides it has encountered a surface when the sum of the field values is
greater than the surface count number, which, in this case is 3. In general, for
convex polyhedra, it would be one less than the number of plane elements.

Other elements would be an infinite cylinder, an infinite cone and a sphere. So,
for example, a finite cylinder would be defined by adding two plane elements
with a surface count of 2. A finite cone needs a single additional plane and a
surface count of 1. A hemisphere would be defined by a sphere and a plane and a
surface count of 1. Two overlapping sphere elements with a surface count of 1
will give the intersection and a value of 0 the union.

These elements could be assigned a negative radius and be subtracted from the
rest of the elements in the rounded object.

I think it may be possible for an already defined rounded object to be used as
an element. The trick would be for the fields of its component elements to be
summed but its contribution to the overall sum to be limited to 1. Like the
other enclosed elements, the radius field could be reversed to subtract the
shape of the pre-defined object element from the rest.

The radii of elements in a rounded object do not have to be the same and I think
that, if the surface count was not an integer it may be possible to swell or
shrink the object by an amount less than the corner radius.

Am I thinking on the right lines?


Post a reply to this message

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