![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
The convex hull would be correct for convex objects only. Used for the
Minkowski sum of a torus and a sphere, this would give a rounded disk,
not a "rounded torus", because the hole of the torus would be eliminated
by the construction of the convex hull.
Sputnik
--
-------------------------------------
e-mail: fr### [at] computermuseum fh-kiel de
-------------------------------------
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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.
A practical application of the Minkowski sum would be as a *great* morphing
device. For example
minkowski_sum {
object { StartObject scale 1-clock }
object { FinalObject scale clock }
}
would give a smooth transition from StartObject to FinalObject. The
transition could be controlled by more complex blending functions. Given
blending functions, usually with Blend(0)=0 and Blend(1)=1 or even
Blend(0)=<0,0,0> and Blend(1)=<1,1,1>, I'm dreaming of
minkowski { StartObject*(1-Blend1(clock)) + FinalObject*Blend2(clock) }
Another interesting effect would be
minkowski { BaseObject + object { PaddingObject rotate Rotation(clock) } }
At least for meshes this should be possible, especially for convex shapes.
Sputnik
--
-------------------------------------
e-mail: fr### [at] computermuseum fh-kiel de
-------------------------------------
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 24 Apr 2003 14:47:51 +0200, Achill <ach### [at] ma tum de> wrote:
>That sounds great!
>
>I am very curious... :-)
Reading through the thread I see it might not help your case much,
because I'm talking about discrete sets of scalars, vectors or
strings, and you're talking about continuous sets of points
(surfaces). Won't help much.
Why don't you just use merge instead? :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <5johavcb3rjtc792kr1v29f36h5sf5r3q4@4ax.com>,
ABX <abx### [at] abx art pl> wrote:
> If your set are "contignous" subsets of 3D space and you can express that set
> with some function where for elements (coordinates) from set this functions
> gives negative value then you can use isosurface{} object. parametric{} object
> can be also in area of your interest.
I don't see how you could do this...it wouldn't be the same as the sum
of the functions. Could you clarify? You mean deriving a function for
the object by hand and just using an isosurface to render it?
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
/*
The following scene is a quick-and-dirty brute force approximation
for Minkowski sums. Two arbitrary shapes are minkowski-added by
chosing many random points in the first given object, then adding
them to the second object, i.e. making a translated copy of the
second object. The number of copies should be high (1000 to 10000),
the objects should be simple, esp. the second object. Inner points
of the first object usually don't contribute anything visible to
the sum because they translate the second object to a place where
it will be surrounded by copies belonging to points in the vicinity
of this inner point. So it's a good idea to remove inner points of
the first object; this will increase parse time (because it's
difficult to find points of a thin object), but will greatly
increase the quality of the surface of the minkowski sum (because
no copies are wasted). Modify the #switch value to see the
examples.
Sputnik
*/
// Minkowski sum
// +SP8 +EP8 +D -F +W320 +H240
#macro Minkowski_sum (Copies, O1, O2)
// preparations for sampling the bounding box of O1
#local Min = min_extent (O1);
#local Size = max_extent (O1)-Min;
#local Rand = seed(123);
union {
#local I = 0; // counts inside-points
#local N = 0; // counts tested points
#while (I<Copies)
// get a random point in the bounding box of O1
#local Point = Min+Size*<rand(Rand),rand(Rand),rand(Rand)>;
#local N = N+1;
// if this point is inside O1 then ...
#if (inside(O1, Point))
// ... minkowski-add it to O2 and count it
object { O2 translate Point }
#local I = I+1;
#end//if
#end//while I
// no "}" for union to allow application of a texture
#debug concat ( str(I*100/N,10,2), "% successful inside tests\n" )
#end//macro Minkowski_sum
#switch (2) // <-- choose an example here (1 .. 3)
#case (1) // rounded box
Minkowski_sum ( 10000,
box { -4, 4 }
sphere { 0, 1 }
)
texture { pigment { color rgb 1 } }
}//the missing "}" for the union
#break//1
#case (2) // rounded box, improved
Minkowski_sum ( 2000,
difference { box { -4, 4 } box { -3.9, 3.9 } }
sphere { 0, 1 }
)
texture { pigment { color rgb 1 } }
}
#break//2
#case (3) // "coned" torus
Minkowski_sum ( 1000,
difference {
torus { 5, 1 }
torus { 5, 0.9 }
}
cone { 0, 2, 3*y, 0.5 }
)
texture { pigment { color rgb 1 } }
}
#break//3
#case (4) // "torused" cone = 1.0*cone + 1.0*torus
Minkowski_sum ( 1000,
difference {
cone { 0 *y, 2 , 3 *y, 0.5 }
cone { 0.1*y, 1.9, 2.9*y, 0.4 }
}
torus { 5, 1 }
)
texture { pigment { color rgb 1 } }
}
#break//4
#case (5) // 1.6*cone + 0.4*torus
Minkowski_sum ( 1000,
difference {
cone { 0 *y, 2 , 3 *y, 0.5 }
cone { 0.1*y, 1.9, 2.9*y, 0.4 }
scale 1.6
}
torus { 5, 1 scale 0.4 }
)
texture { pigment { color rgb 1 } }
}
#break//5
#case (6) // 0.4*cone + 1.6*torus
Minkowski_sum ( 1000,
difference {
cone { 0 *y, 2 , 3 *y, 0.5 }
cone { 0.1*y, 1.9, 2.9*y, 0.4 }
scale 0.4
}
torus { 5, 1 scale 1.6 }
)
texture { pigment { color rgb 1 } }
}
#break//6
#end//switch
light_source { <-100, 150, -50>, rgb 1 }
camera { location <-5, 10, -15> look_at -1.5*y }
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 25 Apr 2003 16:14:00 -0400, Christopher James Huff
<cja### [at] earthlink net> wrote:
> > If your set are "contignous" subsets of 3D space and you can express that set
> > with some function where for elements (coordinates) from set this functions
> > gives negative value then you can use isosurface{} object. parametric{} object
> > can be also in area of your interest.
>
> I don't see how you could do this...it wouldn't be the same as the sum
> of the functions.
Where I said I mean sum of functions? Where I said I mean any sum ?
For the opinion "Converting arbitrary point sets into meshes or surfaces is a
difficult task" I replaied that isosurface can be considered as set of points
where desription of set is a given function. Of course the difficult part is
finding that function for given set which is another task. I just wanted point
out that isosurface can be a tool in mentioned "conversion".
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <nahpav41nl0hkk6gvto0tkoq0381td0uvp@4ax.com>,
ABX <abx### [at] abx art pl> wrote:
> Where I said I mean sum of functions? Where I said I mean any sum ?
It was somewhat implied by your message, though it was too vague to mean
much of anything.
> For the opinion "Converting arbitrary point sets into meshes or surfaces is a
> difficult task" I replaied that isosurface can be considered as set of points
> where desription of set is a given function. Of course the difficult part is
> finding that function for given set which is another task. I just wanted
> point out that isosurface can be a tool in mentioned "conversion".
But you implied that knowing the functions would give you some way to
find the sum...or were you talking about writing a function by hand that
would give the same shape as the sum? Again, you haven't given a clear
description of what you mean by using an isosurface for "conversion".
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3ea9f404$1@news.povray.org>,
> The following scene is a quick-and-dirty brute force approximation
> for Minkowski sums.
Jeez...you actually wrote the thing? I was joking.
> of this inner point. So it's a good idea to remove inner points of
> the first object; this will increase parse time (because it's
> difficult to find points of a thin object), but will greatly
> increase the quality of the surface of the minkowski sum (because
> no copies are wasted). Modify the #switch value to see the
> examples.
You use insideness tests to find points inside the object. This will
fail for perfectly thin objects like triangles. Try tracing rays in
random directions from random points inside the bounding box instead.
Though this will probably not work for infinite objects, you shouldn't
even be thinking about summing those.
Untested:
#declare VRand_On_Obj_Bailout = 10000;
#declare Minkowski_Sum_Stream = seed(95173);
#macro VRand_On_Obj(Obj, RS)
#local Norm = < 0, 0, 0>;
#local Pt = < 0, 0, 0>;
#local Mn = min_extent(Obj);
#local Mx = max_extent(Obj);
#local J = 0;
#while(Norm.x = 0 & Norm.y = 0 & Norm.z = 0 & J <
VRand_On_Obj_Bailout)
#local Pt = trace(Obj, VRand_In_Box(Mn, Mx, RS),
VRand_On_Sphere(RS), Norm);
#local J = J + 1;
#end
(Pt)
#end
#macro Minkowski_Sum(Obj1, Obj2, Samples)
union {
#local I = 0;
#while(I < Samples)
object {Obj2 translate VRand_On_Obj(Obj1, Minkowski_Sum_Stream)}
#local I = I+1;
#end//while I
// no "}" for union to allow application of a texture
#end//macro Minkowski_sum
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Mon, 28 Apr 2003 21:00:51 -0400, Christopher James Huff
<cja### [at] earthlink net> wrote:
> > For the opinion "Converting arbitrary point sets into meshes or surfaces is a
> > difficult task" I replaied that isosurface can be considered as set of points
> > where desription of set is a given function. Of course the difficult part is
> > finding that function for given set which is another task. I just wanted
> > point out that isosurface can be a tool in mentioned "conversion".
>
> But you implied that knowing the functions would give you some way to
> find the sum...or were you talking about writing a function by hand that
> would give the same shape as the sum? Again, you haven't given a clear
> description of what you mean by using an isosurface for "conversion".
Ok, example: I have a set of points. The rule used to create this set is that
all points of this set have the same distance from center and all points have
their coordinates positive in value. So I can express this set as:
A={ P(x,y,z) : x^2+y^2+z^2=distance^2 , x>0 , y>0 , z>0 }
I can easly "convert" it into isosurface, can't I?
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |