POV-Ray : Newsgroups : povray.newusers : (vector) sum of two objects : Re: (vector) sum of two objects Server Time
31 Jul 2024 06:14:27 EDT (-0400)
  Re: (vector) sum of two objects  
From: Christopher James Huff
Date: 25 Apr 2003 16:11:44
Message: <cjameshuff-AA9970.16121325042003@netplex.aussie.org>
In article <3ea91586$1@news.povray.org>,


> The same concept is used for pen styles in 2D drawing programs: the center
> of the pen is moved along a path, and all points reachable with the pen
> shape from the current location on this path are painted with the drawing
> color, i.e. all painted points are obtained by location_vector+shape_vector
> for all possible location_vectors and shape_vectors.

Summing an object with a single point is easy:

#macro MinkSumPO(Point, Object) object {Object translate Point} #end

;-)

I guess you *could* do it with arbitrary objects by positioning a large 
enough number of copies of one object so they overlap the other object:
Sum objects A and B:
for(big number of iterations)
    find random point pA on object A
    find random point pB on object B
    translate copy of object B by pA - pB
repeat until you have enough copies of B that overlap the area of A to 
get a smooth appearance. A few million should do for some simple smooth 
shapes...at least to give an idea of what the result should be.


> At least for meshes this should be possible, especially for convex shapes.

Not entirely right. You still end up with a bunch of points, and the 
mesh you reconstruct from them may not be what you would expect from 
looking at the original meshes. You can't take just the vertex 
information and exactly reconstruct the original mesh...you can have 
several meshes with the same vertices, though you can often get 
something reasonable looking. Also, large triangles will result in large 
areas without any points, so you may want to subdivide large triangles 
before doing the sum.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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