POV-Ray : Newsgroups : povray.newusers : (vector) sum of two objects Server Time
13 Nov 2026 05:30:41 EST (-0500)
  (vector) sum of two objects (Message 1 to 50 of 52)  
Goto Latest 50 Messages Next 2 Messages >>>
From: Achill
Subject: (vector) sum of two objects
Date: 23 Apr 2003 11:10:11
Message: <web.3ea6ac9f97d4f590e54f3efb0@news.povray.org>
Is there a (CSG-like?) possibility to create the vector sum of objects or at
least of simple solids?

Thanks for your help.

Achill


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 11:11:50
Message: <e5bdav85ocv9r6vskit389p7ftvhqtlr6r@4ax.com>
On Wed, 23 Apr 2003 11:09:19 EDT, "Achill" <ach### [at] matumde> wrote:
> Is there a (CSG-like?) possibility to create the vector sum of objects or at
> least of simple solids?

Before answer, can you describe more? Example with description of two components
and expected result...

ABX


Post a reply to this message

From: Achill Schuermann
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 12:33:01
Message: <3EA6C026.6010005@ma.tum.de>
> Before answer, can you describe more? Example with description of two components
> and expected result...

Mathematically, the (vector) sum A+B of two sets A and B is defined as 
the set of all points x=a+b with a in A and b in B.
A+B = { x : x=a+b, a in A and b in B }.

A "simple" example is the sum of two convex polyhedra (cube, 
tetrahedron, octahedron, etc.) which is again a polyhedron.

Another example is the sum of a set A with a sphere of radius r, 
centered at <0,0,0>, which gives the set of all points "within distance 
r of A". This would give a nice "rounding effect".

I hope this gives a little idea of what i had in mind.

Achill


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 12:45:02
Message: <r7gdavcrboohskhfqaniuo3dai0tgd8s9k@4ax.com>
On Wed, 23 Apr 2003 18:32:38 +0200, Achill Schuermann <ach### [at] matumde> wrote:
> > Before answer, can you describe more? Example with description of two components
> > and expected result...
>
> Mathematically, the (vector) sum A+B of two sets A and B is defined as 
> the set of all points x=a+b with a in A and b in B.
> A+B = { x : x=a+b, a in A and b in B }.

In my knowledge sum of sets is
A+B = { x : x in A or x in B }
which can be union{} or merge{} object in POV.

> A "simple" example is the sum of two convex polyhedra (cube, 
> tetrahedron, octahedron, etc.) which is again a polyhedron.
>
> Another example is the sum of a set A with a sphere of radius r, 
> centered at <0,0,0>, which gives the set of all points "within distance 
> r of A". This would give a nice "rounding effect".
>
> I hope this gives a little idea of what i had in mind.

Not for me :-(
A I said initially as a 'sum' i thought you mean union{}
http://www.povray.org/documentation/view/171/
http://www.povray.org/documentation/view/40/
but in above text you seam expect that sphere+box=rounded box. This link can
help http://www.povray.org/documentation/view/261/#round_box_union

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 13:07:03
Message: <3EA6C837.BB38782A@gmx.de>
Achill Schuermann wrote:
> 
> Mathematically, the (vector) sum A+B of two sets A and B is defined as
> the set of all points x=a+b with a in A and b in B.
> A+B = { x : x=a+b, a in A and b in B }.

I have no idea what you are talking about but we are not dealing with sets
of points but with surfaces.  Your definition of a vector sum does not
seem to be applicable for surfaces.  

> A "simple" example is the sum of two convex polyhedra (cube,
> tetrahedron, octahedron, etc.) which is again a polyhedron.

That's not an example.  

Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
<0,0,0> with radius 1.  What is the 'vector sum' of these objects?

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 13:07:21
Message: <3EA6C82F.1070205@ma.tum.de>
>>A+B = { x : x=a+b, a in A and b in B }.
> 
> 
> In my knowledge sum of sets is
> A+B = { x : x in A or x in B }
> which can be union{} or merge{} object in POV.

I did not mean "union". Although, the (vector) sum can be viewed as the 
union of all possible vector additions a+b with vectors a in A and b in B.


>>I hope this gives a little idea of what i had in mind. 
> 
> Not for me :-(
 > ...
> but in above text you seam expect that sphere+box=rounded box. This link can
> help http://www.povray.org/documentation/view/261/#round_box_union

Thank you for the hint. The macros
   Round_Box_Union(PtA, PtB, EdgeRadius),
   Round_Box_Merge(PtA, PtB, EdgeRadius),
   Round_Cylinder_Union(PtA, PtB, Radius, EdgeRadius),
   Round_Cylinder_Merge(PtA, PtB, Radius, EdgeRadius),
   Round_Cone_Union(PtA, RadiusA, PtB, RadiusB, EdgeRadius),
   Round_Cone_Merge(PtA, RadiusA, PtB, RadiusB, EdgeRadius)
with Radius=EdgeRadius and RadiusB=EdgeRadius respectively seem to give 
special examples of sums with a sphere.

Still, it would be nice to have a general "sum" or at least a "sum with 
a sphere"...

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 13:33:13
Message: <3EA6CE43.2060102@ma.tum.de>
>>Mathematically, the (vector) sum A+B of two sets A and B is defined as
>>the set of all points x=a+b with a in A and b in B.
>>A+B = { x : x=a+b, a in A and b in B }.
> 
> 
> I have no idea what you are talking about but we are not dealing with sets
> of points but with surfaces.  Your definition of a vector sum does not
> seem to be applicable for surfaces.  

The defintion is applyable to arbitrary pointsets --- also too surfaces.
Besides, I thought povray is using solids also.



> 
>>A "simple" example is the sum of two convex polyhedra (cube,
>>tetrahedron, octahedron, etc.) which is again a polyhedron.
> 
> That's not an example.  

Well, ok.
A concrete example would be the sum of the tetrahedron T with vertices
<0,0,0>, <1,0,0>, <0,1,0> and <0,0,1> with "its negative" -T with 
vertices <0,0,0>, <-1,0,0>, <0,-1,0> and <0,0,-1>.
The outcome is a polyhedron (polytope) with vertices
<-1, 0, 0>, <0, -1, 0>, <0, 0, -1>, <1, 0, 0>, <1, -1, 0>, <1, 0, -1>, 
<0, 1, 0>, <-1, 1, 0>, <0, 1, -1>, <0, 0, 1>, <-1, 0, 1>, <0, -1, 1>.

Generally, such vector sums of polytopes can be evaluated for example 
with the program "polymake" (www.math.tu-berlin.de/polymake/)


> Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
> <0,0,0> with radius 1.  What is the 'vector sum' of these objects?

As far as I understand the macro
"Round_Box_Union(PtA, PtB, EdgeRadius)",
it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".


Achill


Post a reply to this message

From: Christoph Hormann
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 14:07:24
Message: <3EA6D65B.4BAB8280@gmx.de>
Achill wrote:
> 
> [...]
> 
> Well, ok.
> A concrete example would be the sum of the tetrahedron T with vertices
> <0,0,0>, <1,0,0>, <0,1,0> and <0,0,1> with "its negative" -T with
> vertices <0,0,0>, <-1,0,0>, <0,-1,0> and <0,0,-1>.
> The outcome is a polyhedron (polytope) with vertices
> <-1, 0, 0>, <0, -1, 0>, <0, 0, -1>, <1, 0, 0>, <1, -1, 0>, <1, 0, -1>,
> <0, 1, 0>, <-1, 1, 0>, <0, 1, -1>, <0, 0, 1>, <-1, 0, 1>, <0, -1, 1>.
> 
> Generally, such vector sums of polytopes can be evaluated for example
> with the program "polymake" (www.math.tu-berlin.de/polymake/)

Well, so much for polyhedra - you can surely create any polyhedron you
want with meshes.  

> > Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
> > <0,0,0> with radius 1.  What is the 'vector sum' of these objects?
> 
> As far as I understand the macro
> "Round_Box_Union(PtA, PtB, EdgeRadius)",
> it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".

So the vector sum of an arbitrary surface and a sphere at <0,0,0> with
radius 1 is the same as with any other sphere with the radius 1?  Sounds
strange.  Furthermore this means that this sum is not commutative.  

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: (vector) sum of two objects
Date: 23 Apr 2003 15:44:28
Message: <Xns9366DDB084CCEtorolavkhotmailcom@204.213.191.226>
Achill <ach### [at] matumde> wrote in news:3EA### [at] matumde:

> 
>>>Mathematically, the (vector) sum A+B of two sets A and B is defined
>>>as the set of all points x=a+b with a in A and b in B.
>>>A+B = { x : x=a+b, a in A and b in B }.

...

> A concrete example would be the sum of the tetrahedron T with vertices
> <0,0,0>, <1,0,0>, <0,1,0> and <0,0,1> with "its negative" -T with 
> vertices <0,0,0>, <-1,0,0>, <0,-1,0> and <0,0,-1>.
> The outcome is a polyhedron (polytope) with vertices
> <-1, 0, 0>, <0, -1, 0>, <0, 0, -1>, <1, 0, 0>, <1, -1, 0>, <1, 0, -1>,
> <0, 1, 0>, <-1, 1, 0>, <0, 1, -1>, <0, 0, 1>, <-1, 0, 1>, <0, -1, 1>.
...

Why isn't <0, 0, 0> in the outcome list ?


Tor Olav


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 01:50:40
Message: <7fueavs379noqouu7nvbj2vck3mojfa1u6@4ax.com>
On Wed, 23 Apr 2003 19:06:55 +0200, Achill <ach### [at] matumde> wrote:
> > In my knowledge sum of sets is
> > A+B = { x : x in A or x in B }
> > which can be union{} or merge{} object in POV.
>
> I did not mean "union". Although, the (vector) sum can be viewed as the 
> union of all possible vector additions a+b with vectors a in A and b in B.

I have never seen practical usage of it (can you deliver some url references ?)
but the only solution I can imagine is script based solution. First make some
smart macro to achive array with grid of points of result based on two input
patterns/objects/arrays. Then turn it into density file and render as
media/isosurface.

ABX


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 03:54:02
Message: <3EA79802.1050002@ma.tum.de>
>>>In my knowledge sum of sets is
>>>A+B = { x : x in A or x in B }
>>>which can be union{} or merge{} object in POV.
>>
>>I did not mean "union". Although, the (vector) sum can be viewed as the 
>>union of all possible vector additions a+b with vectors a in A and b in B.
> 
> 
> I have never seen practical usage of it (can you deliver some url references ?)

I do not know of a concrete "practical usage" either. My main idea was 
to visualize the mathematical defintion of the vector sum (also known as 
Minkowski sum, see http://mathworld.wolfram.com/MinkowskiSum.html) of 
two arbitrary sets.

Besides I think this would give some nice effects. For example a general 
"rounding" by adding a sphere.


> but the only solution I can imagine is script based solution. First make some
> smart macro to achive array with grid of points of result based on two input
> patterns/objects/arrays. Then turn it into density file and render as
> media/isosurface.

I am not familiar with "povray's insides". Nevertheless, thank you very 
much for these hints. I will further think about your suggestions, after 
  I know more...

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 03:54:13
Message: <3EA7980C.8010602@ma.tum.de>
>>A concrete example would be the sum of the tetrahedron T with vertices
>><0,0,0>, <1,0,0>, <0,1,0> and <0,0,1> with "its negative" -T with
>>vertices <0,0,0>, <-1,0,0>, <0,-1,0> and <0,0,-1>.
>>The outcome is a polyhedron (polytope) with vertices
>><-1, 0, 0>, <0, -1, 0>, <0, 0, -1>, <1, 0, 0>, <1, -1, 0>, <1, 0, -1>,
>><0, 1, 0>, <-1, 1, 0>, <0, 1, -1>, <0, 0, 1>, <-1, 0, 1>, <0, -1, 1>.
>>
>>Generally, such vector sums of polytopes can be evaluated for example
>>with the program "polymake" (www.math.tu-berlin.de/polymake/)
> 
> 
> Well, so much for polyhedra - you can surely create any polyhedron you
> want with meshes.  
> 

That is a possible way to describe the surface of a "convex polytope".

To attain a solid, it is possible to take an intersection of planes 
(http://www.f-lohmueller.de/pov_tut/shapes/plane1e.htm) plane { n, d } 
where n runs through the "outer normal vectors" of the "facets" (2 dim. 
faces) of the polytope. The values n and d can be evaluated from the 
vertices of a polytope with "polymake" for example.

Nevertheless, I mentioned polytopes only as an example of possible sets 
to be combined via a "(vector) sum operation".

My main idea was to visualize the mathematical defintion of the vector 
sum (also known as Minkowski sum, see 
http://mathworld.wolfram.com/MinkowskiSum.html) of two arbitrary sets.



>>>Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
>>><0,0,0> with radius 1.  What is the 'vector sum' of these objects?
>>
>>As far as I understand the macro
>>"Round_Box_Union(PtA, PtB, EdgeRadius)",
>>it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".
> 
> 
> So the vector sum of an arbitrary surface and a sphere at <0,0,0> with
> radius 1 is the same as with any other sphere with the radius 1?  Sounds
> strange.  Furthermore this means that this sum is not commutative.  
> 

The sum of a set with any sphere of the same radius is the same, up to a 
translation. Moreover, the operation is commutative.

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 03:54:20
Message: <3EA79814.6090900@ma.tum.de>
>>A concrete example would be the sum of the tetrahedron T with vertices
>><0,0,0>, <1,0,0>, <0,1,0> and <0,0,1> with "its negative" -T with 
>>vertices <0,0,0>, <-1,0,0>, <0,-1,0> and <0,0,-1>.
>>The outcome is a polyhedron (polytope) with vertices
>><-1, 0, 0>, <0, -1, 0>, <0, 0, -1>, <1, 0, 0>, <1, -1, 0>, <1, 0, -1>,
>><0, 1, 0>, <-1, 1, 0>, <0, 1, -1>, <0, 0, 1>, <-1, 0, 1>, <0, -1, 1>.
> 
> ...
> 
> Why isn't <0, 0, 0> in the outcome list ?
> 

Thinking of a polytopes as the "convex hulls" 
(http://mathworld.wolfram.com/ConvexHull.html) of their vertices, the 
sum of two polytopes A and B is the convex hull of all points a+b, where 
a is a vertex of A and b is a vertex of B.

In the example above <0, 0, 0> is a point a+b (of 16 possible 
combinations) in the interior of the convex hull. So it is not one of 
the 12 vertices of this polytope.

I hope this explains it.

Achill


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 04:18:23
Message: <316favcektaae8lguclk8ad8s4jmp08bkr@4ax.com>
On Thu, 24 Apr 2003 09:53:38 +0200, Achill <ach### [at] matumde> wrote:
> I do not know of a concrete "practical usage" either. My main idea was 
> to visualize the mathematical defintion of the vector sum (also known as 
> Minkowski sum, see http://mathworld.wolfram.com/MinkowskiSum.html) of 
> two arbitrary sets.

Using this mathematical name from begining of this thread could help. I wonder
why you prefered to deliver some spaghetti-like explanation without this direct
link :-)

> Besides I think this would give some nice effects. For example a general 
> "rounding" by adding a sphere.

As for adding sphere into objects there is another solution/workaround (but not
perfect). You can look into my 'rounded' extension to isocsg library
http://www-public.tu-bs.de:8080/~y0013390/pov/ic/
If you define some object with rounded version of macros and this object is not
very complicated you can then use threshold to achive object almost identical to
adding sphere (http://news.povray.org/povray.binaries.images/23003/).

I imagine you could write macro to do similiar operation for meshes but it is
obiously harder task than using already made macros from isocsg library. But
isosurfaces are usually (always ?) slower than meshes.

Except adding sphere, is there any other 3D application where you can add two
any objects?

> > but the only solution I can imagine is script based solution. First make some
> > smart macro to achive array with grid of points of result based on two input
> > patterns/objects/arrays. Then turn it into density file and render as
> > media/isosurface.
>
> I am not familiar with "povray's insides".

If you are talking about using POV-Ray SDL (scene description language) things
like macro, pattern, array or object are not "povray's insides". Otherwise I
hardly see what can be "povray's outsides" ;-)

ABX


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 04:50:46
Message: <3EA7A54C.3010602@ma.tum.de>
>>Minkowski sum, see http://mathworld.wolfram.com/MinkowskiSum.html)  
> 
> Using this mathematical name from begining of this thread could help. I wonder
> why you prefered to deliver some spaghetti-like explanation without this direct
> link :-)
> 

I thought "vector sum" is more familiar.
Sorry for that... :-)



> 
>>Besides I think this would give some nice effects. For example a general 
>>"rounding" by adding a sphere.
> 
> 
> As for adding sphere into objects there is another solution/workaround (but not
> perfect). You can look into my 'rounded' extension to isocsg library
> http://www-public.tu-bs.de:8080/~y0013390/pov/ic/
> If you define some object with rounded version of macros and this object is not
> very complicated you can then use threshold to achive object almost identical to
> adding sphere (http://news.povray.org/povray.binaries.images/23003/).
> 
> I imagine you could write macro to do similiar operation for meshes but it is
> obiously harder task than using already made macros from isocsg library. But
> isosurfaces are usually (always ?) slower than meshes.

Thank you very much for all the hints.

My original idea was to program a CSG "sum", since given two objects 
with an "inside" and an "outside", it should be possible to "describe" 
the "inside" and "outside" of the sum?!?

As I said before, I do not know povray too well. So this might be an 
impossible or even extremly stupid idea?!?




> Except adding sphere, is there any other 3D application where you can add two
> any objects?

Adding an ellipsoid rounds objects in different directions differently 
--- could be useful?

It is hard to imagine (at least for me) what adding of arbitrary objects 
would look like --- but maybe there are some interesting effects possible?



>>I am not familiar with "povray's insides".
> 
> 
> If you are talking about using POV-Ray SDL (scene description language) things
> like macro, pattern, array or object are not "povray's insides". Otherwise I
> hardly see what can be "povray's outsides" ;-)

yepp :-)


Achill


Post a reply to this message

From: Christoph Hormann
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 06:28:06
Message: <3EA7BC35.1E395139@gmx.de>
Achill wrote:
> 
> [...]
> >
> >
> > So the vector sum of an arbitrary surface and a sphere at <0,0,0> with
> > radius 1 is the same as with any other sphere with the radius 1?  Sounds
> > strange.  Furthermore this means that this sum is not commutative.
> >
> 
> The sum of a set with any sphere of the same radius is the same, up to a
> translation. Moreover, the operation is commutative.

So the sum of a 

sphere { <1,0,0>, 0.1 }

and a

sphere { <0,0,2>, 0.1 }

would be a 

sphere { <0,0,0>, 0.2 }

???

Now that's a really strange idea for combining shapes...

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 07:11:21
Message: <7fhfavc3mrgal9p3oa9ft8mmeop3ta9go6@4ax.com>
On Thu, 24 Apr 2003 12:28:05 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> So the sum of a 
>   sphere { <1,0,0>, 0.1 }
> and a
>   sphere { <0,0,2>, 0.1 }
> would be a 
>   sphere { <0,0,0>, 0.2 }
> ???

Call it "rounded sphere" ;-)

ABX


Post a reply to this message

From: Peter Popov
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 08:28:47
Message: <unlfavs5ssm5vkufb24ugl877u2k275phe@4ax.com>
On Wed, 23 Apr 2003 11:09:19 EDT, "Achill" <ach### [at] matumde> wrote:

>Is there a (CSG-like?) possibility to create the vector sum of objects or at
>least of simple solids?
>
>Thanks for your help.

I have just written a number of macros to introduce sets in POV.
Currently the macros include: AddToSet, DeleteFromSet, FindInSet,
ElementsInSet, IntersectSets, UnionSets, DifferenceSets and a number
of utility macros (PrintSet, SetToFile, SetFromFile etc.)

I'll clean up the code and release them these days. I hope it helps
your situation.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 08:38:40
Message: <3EA7DAB6.6050008@ma.tum.de>
Christoph Hormann wrote:
> 
> Achill wrote:
> 
>>[...]
>>
>>>
>>>So the vector sum of an arbitrary surface and a sphere at <0,0,0> with
>>>radius 1 is the same as with any other sphere with the radius 1?  Sounds
>>>strange.  Furthermore this means that this sum is not commutative.
>>>
>>
>>The sum of a set with any sphere of the same radius is the same, up to a
>>translation. Moreover, the operation is commutative.
> 
> 
> So the sum of a 
> 
> sphere { <1,0,0>, 0.1 }
> 
> and a
> 
> sphere { <0,0,2>, 0.1 }
> 
> would be a 
> 
> sphere { <0,0,0>, 0.2 }
> 
> ???
> 
> Now that's a really strange idea for combining shapes...


It would give a

sphere { <1,0,2>, 0.2 }

Generally, if you have a convex (see 
http://mathworld.wolfram.com/Convex.html) solid A and skalar values x,y, 
then x*A + y*A = (x+y)*A.

Note also that a translation of a set A by a vector t may be regarded as 
a special sum {t}+A.

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 08:48:17
Message: <3EA7DCF7.6050408@ma.tum.de>
Peter Popov wrote:
> On Wed, 23 Apr 2003 11:09:19 EDT, "Achill" <ach### [at] matumde> wrote:
> 
> 
>>Is there a (CSG-like?) possibility to create the vector sum of objects or at
>>least of simple solids?
>>
>>Thanks for your help.
> 
> 
> I have just written a number of macros to introduce sets in POV.
> Currently the macros include: AddToSet, DeleteFromSet, FindInSet,
> ElementsInSet, IntersectSets, UnionSets, DifferenceSets and a number
> of utility macros (PrintSet, SetToFile, SetFromFile etc.)
> 
> I'll clean up the code and release them these days. I hope it helps
> your situation.
> 

That sounds great!

I am very curious... :-)

Achill


Post a reply to this message

From: SAS
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 09:22:05
Message: <MPG.1911f552ac74fc49896a3@news.povray.org>
Achill wrote:

> > Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
> > <0,0,0> with radius 1.  What is the 'vector sum' of these objects?
> 
> As far as I understand the macro
> "Round_Box_Union(PtA, PtB, EdgeRadius)",
> it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".

It would be Round_Box_Union(<-1,-1,-1>, <2,2,2>, 1), because the 
Round_Box macros cut away from the specified box, rather than 
adding to it.


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 09:48:25
Message: <cjameshuff-0C4912.09481524042003@netplex.aussie.org>
In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
wrote:

> I do not know of a concrete "practical usage" either. My main idea was 
> to visualize the mathematical defintion of the vector sum (also known as 
> Minkowski sum, see http://mathworld.wolfram.com/MinkowskiSum.html) of 
> two arbitrary sets.
> 
> Besides I think this would give some nice effects. For example a general 
> "rounding" by adding a sphere.

I think you need to learn more about how raytracing works. POV can not 
take the "vector sum of all points on an object", because it doesn't 
know all points on the object. Raytracing works by finding the 
intersection point of rays with surfaces, the various shape types use a 
wide variety of methods to do this, ranging from simple geometric 
formulas to complex root-finding algorithms. You can't just add these 
intersection finding algorithms together to get a new one.

Your idea seems to depend on having two sets of points and resulting in 
a third set, POV does not have the first two sets and wouldn't be able 
to do anything with the third (though there is a method for raytracing 
point fields that might be useful with this, it is not currently 
implemented in POV).

Yes, a general rounding algorithm would be nice sometimes, but it is not 
possible without completely changing the way POV handles shapes. If it 
is ever added to POV, it will probably be a mesh processing feature.

-- 
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

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 09:50:54
Message: <3EA7EBA5.5000601@ma.tum.de>
SAS wrote:
> Achill wrote:
> 
> 
>>>Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
>>><0,0,0> with radius 1.  What is the 'vector sum' of these objects?
>>
>>As far as I understand the macro
>>"Round_Box_Union(PtA, PtB, EdgeRadius)",
>>it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".
> 
> 
> It would be Round_Box_Union(<-1,-1,-1>, <2,2,2>, 1), because the 
> Round_Box macros cut away from the specified box, rather than 
> adding to it.

So I did not understand the macro too far... :-)
Should have tried before mailing...

Achill


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 09:53:47
Message: <cjameshuff-EFB98A.09533124042003@netplex.aussie.org>
In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
wrote:

> > Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
> > <0,0,0> with radius 1.  What is the 'vector sum' of these objects?
> 
> As far as I understand the macro
> "Round_Box_Union(PtA, PtB, EdgeRadius)",
> it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".

The vector sum of a sphere and a box is 3 boxes, 8 spheres, and 12 
cylinders?

-- 
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

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 10:06:14
Message: <3EA7EF3C.5000008@ma.tum.de>
Christopher James Huff wrote:
> In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
> wrote:
> 
> 
>>>Let's say we have a unit cube between <0,0,0> and <1,1,1> and a sphere at
>>><0,0,0> with radius 1.  What is the 'vector sum' of these objects?
>>
>>As far as I understand the macro
>>"Round_Box_Union(PtA, PtB, EdgeRadius)",
>>it would be "Round_Box_Union(<0,0,0>, <1,1,1>, 1)".
> 
> 
> The vector sum of a sphere and a box is 3 boxes, 8 spheres, and 12 
> cylinders?

Its the union of them, yes.
That is a consequence of the so called "Steiner Theorem" in "convex 
geometry".

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 10:11:57
Message: <3EA7F092.4010402@ma.tum.de>
Christopher James Huff wrote:
> In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
> wrote:
> 
> I think you need to learn more about how raytracing works. 

That is certainly true --- as it is with most things... :-)
(That's why I am posting to "newusers".)


> POV can not 
> take the "vector sum of all points on an object", because it doesn't 
> know all points on the object. Raytracing works by finding the 
> intersection point of rays with surfaces, the various shape types use a 
> wide variety of methods to do this, ranging from simple geometric 
> formulas to complex root-finding algorithms. You can't just add these 
> intersection finding algorithms together to get a new one.
 >
> Your idea seems to depend on having two sets of points and resulting in 
> a third set, POV does not have the first two sets and wouldn't be able 
> to do anything with the third (though there is a method for raytracing 
> point fields that might be useful with this, it is not currently 
> implemented in POV).

I saw on http://www.f-lohmueller.de/pov_tut/csg/povcsg1e.htm that CSG 
operations may be used with all shapes which have a clear defined 
"inside" and "outside", in particular with solids. My idea was that it 
should be possible to determine "inside" and "outside" of the sum (at 
least for the sum of solids) as well...?!?

I must admit, I do not know how povray "knows" to distiguish "inside" 
and "outside".



> Yes, a general rounding algorithm would be nice sometimes, but it is not 
> possible without completely changing the way POV handles shapes. If it 
> is ever added to POV, it will probably be a mesh processing feature.


I see that I will have to learn much more about povray and raytracing in 
general... :-)

Achill


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 10:18:51
Message: <4dsfavsgv7emj49rr7irlfv9j7cfvf6mkr@4ax.com>
On Thu, 24 Apr 2003 16:11:30 +0200, Achill <ach### [at] matumde> wrote:
> I must admit, I do not know how povray "knows" to distiguish "inside" 
> and "outside".

It's hardcoded definition of each primitive object. Like math representation of
its surface, function to calculate normal vectors, mapping uv space on its
surface etc.

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 11:51:22
Message: <cjameshuff-9DB8F5.11510924042003@netplex.aussie.org>
In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
wrote:

> Its the union of them, yes.
> That is a consequence of the so called "Steiner Theorem" in "convex 
> geometry".

And how do you compute a union of primitives equivalent to a given "sum" 
of objects? Your reasoning process seems to have been "it will make a 
rounded box, and here's a rounded box macro".

-- 
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

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 11:54:27
Message: <cjameshuff-C4BC2A.11541624042003@netplex.aussie.org>
In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
wrote:

> I saw on http://www.f-lohmueller.de/pov_tut/csg/povcsg1e.htm that CSG 
> operations may be used with all shapes which have a clear defined 
> "inside" and "outside", in particular with solids. My idea was that it 
> should be possible to determine "inside" and "outside" of the sum (at 
> least for the sum of solids) as well...?!?
> 
> I must admit, I do not know how povray "knows" to distiguish "inside" 
> and "outside".

It can check whether a given point is inside or outside the object, 
using a hard-coded object-specific algorithm. How does that help? It 
doesn't get you any closer to summing objects.

-- 
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

From: ABX
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 12:05:03
Message: <h32gavo8csv7vcgefdsi0fl3ei8orr0cdq@4ax.com>
On Thu, 24 Apr 2003 11:51:09 -0400, Christopher James Huff
<cja### [at] earthlinknet> wrote:
> Your reasoning process seems to have been "it will make a 
> rounded box, and here's a rounded box macro".

That's me who suggested that macro. When I refered to it I wasn't sure if he is
interested in METHOD or RESULT of his description. Since there was no way to
duplicate METHOD in universal way I could only help with referring tool where
similiar RESULT he described was achived. As to the newuser who come here to
achive something I showed him shortest way to achive RESULT he described in
example. I thought it could save him learning of full POV SDL power.
I'm still not sure if he is rather interested in RESULT of specific case of his
sum or in general METHOD. I hope my hints helped him and I hope you are not
angry that I answered instead of licensed TAG member ;-)

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 14:34:50
Message: <cjameshuff-E8C94E.14344324042003@netplex.aussie.org>
In article <h32gavo8csv7vcgefdsi0fl3ei8orr0cdq@4ax.com>,
 ABX <abx### [at] abxartpl> wrote:

> That's me who suggested that macro. When I refered to it I wasn't sure if he 
> is interested in METHOD or RESULT of his description.

Oh, sorry about that then.


> I'm still not sure if he is rather interested in RESULT of specific 
> case of his sum or in general METHOD. I hope my hints helped him and 
> I hope you are not angry that I answered instead of licensed TAG 
> member ;-)

The TAG does not have any exclusive rights on giving help. ;-)

Anyway, I've been assuming he wants a general "sum" object similar to 
the CSG union object. In this case, a way of finding an intersection 
between a ray and the sum of the objects is necessary. The given 
descriptions involve adding points on the objects together to get new 
points, but POV doesn't have those points in the first place, it finds 
them as necessary using object-specific methods. The original poster 
asked about insideness testing...each object has a function that can 
determine if a given point is inside it, which doesn't seem at all 
helpful for this.

It might be possible to find a large enough number of points do get fair 
approximations of the surfaces by randomly tracing rays at the objects. 
You could then operate on these point fields and either patch POV to 
render them directly (there are algorithms for directly raytracing point 
fields) or convert them into a mesh. I'm not sure how good the results 
will look, and you will need to handle a *lot* of points. The original 
poster seems to be expecting something more like a CSG operation, which 
is just impossible as far as I can tell. The macro mentioned can do it, 
but it was created by hand...I see no way of telling a program to 
combine arbitrary shapes and get a composite of several objects of 
different types (spheres, boxes, and cylinders in this case) as a result.

-- 
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

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 15:45:26
Message: <3EA83EBC.3090802@ma.tum.de>
Christopher James Huff wrote:
> In article <h32gavo8csv7vcgefdsi0fl3ei8orr0cdq@4ax.com>,
>  ABX <abx### [at] abxartpl> wrote:
> 
> 
>>That's me who suggested that macro. When I refered to it I wasn't sure if he 
>>is interested in METHOD or RESULT of his description.
> 
> 
> Oh, sorry about that then.
> 
> 
> 
>>I'm still not sure if he is rather interested in RESULT of specific 
>>case of his sum or in general METHOD. I hope my hints helped him and 
>>I hope you are not angry that I answered instead of licensed TAG 
>>member ;-)
> 
> 
> The TAG does not have any exclusive rights on giving help. ;-)
> 
> Anyway, I've been assuming he wants a general "sum" object similar to 
> the CSG union object. In this case, a way of finding an intersection 
> between a ray and the sum of the objects is necessary. The given 
> descriptions involve adding points on the objects together to get new 
> points, but POV doesn't have those points in the first place, it finds 
> them as necessary using object-specific methods. The original poster 
> asked about insideness testing...each object has a function that can 
> determine if a given point is inside it, which doesn't seem at all 
> helpful for this.
> 
> It might be possible to find a large enough number of points do get fair 
> approximations of the surfaces by randomly tracing rays at the objects. 
> You could then operate on these point fields and either patch POV to 
> render them directly (there are algorithms for directly raytracing point 
> fields) or convert them into a mesh. 

Converting arbitrary point sets into meshes or surfaces is a difficult 
task (known as "surface reconstruction"). Are there algorithms for this 
task used with (or in) povray?



> I'm not sure how good the results 
> will look, and you will need to handle a *lot* of points. The original 
> poster seems to be expecting something more like a CSG operation, which 
> is just impossible as far as I can tell. The macro mentioned can do it, 
> but it was created by hand...I see no way of telling a program to 
> combine arbitrary shapes and get a composite of several objects of 
> different types (spheres, boxes, and cylinders in this case) as a result.
> 

I agree... :-)

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 15:45:28
Message: <3EA83EBD.7030302@ma.tum.de>
ABX wrote:
> On Thu, 24 Apr 2003 11:51:09 -0400, Christopher James Huff
> <cja### [at] earthlinknet> wrote:
> 
>>Your reasoning process seems to have been "it will make a 
>>rounded box, and here's a rounded box macro".
> 
> 
> That's me who suggested that macro. When I refered to it I wasn't sure if he is
> interested in METHOD or RESULT of his description. Since there was no way to
> duplicate METHOD in universal way I could only help with referring tool where
> similiar RESULT he described was achived. As to the newuser who come here to
> achive something I showed him shortest way to achive RESULT he described in
> example. I thought it could save him learning of full POV SDL power.
> I'm still not sure if he is rather interested in RESULT of specific case of his
> sum or in general METHOD. I hope my hints helped him and I hope you are not
> angry that I answered instead of licensed TAG member ;-)
> 
> ABX


Actually I was interested in the general possibility of suming up 
objects, so rather in METHOD. The general interest grew out of some 
special RESULTS, as for example adding a sphere to a polytope. This can 
be achieved with unions (merges) of plane intersections, cylinders and 
spheres.

Achill


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 15:45:30
Message: <3EA83EBF.1070000@ma.tum.de>
Christopher James Huff wrote:
> In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
> wrote:
> 
> 
>>I saw on http://www.f-lohmueller.de/pov_tut/csg/povcsg1e.htm that CSG 
>>operations may be used with all shapes which have a clear defined 
>>"inside" and "outside", in particular with solids. My idea was that it 
>>should be possible to determine "inside" and "outside" of the sum (at 
>>least for the sum of solids) as well...?!?
>>
>>I must admit, I do not know how povray "knows" to distiguish "inside" 
>>and "outside".
> 
> 
> It can check whether a given point is inside or outside the object, 
> using a hard-coded object-specific algorithm. How does that help? It 
> doesn't get you any closer to summing objects.
> 

Knowing now that inside and outside are determined by an individual 
"hard-coded" algorithm, I see why there is propably no way (at least 
none I can think of) to write a general sum for objects.

Thank you very much for your patience and helpful explanations.

Achill


Post a reply to this message

From: Alan Walkington
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 15:50:12
Message: <3ea83ff4@news.povray.org>
This might actually be approximated in the following manner:

Given a sphere (A) and a cube(B) in CSG, normalise them at <0,0,0>.and
construct a mesh equivilent for each. Create an alogrithm that, for each
vertice in A, finds an equivelant vertice (or set of vertices) in B and
builds a new mesh using these results.  If I am visualing this properly,
this might give the effect of a 'rounded cube' for this example.

--
Alan Walkington
Technical Staff
United Defense, San Jose


"Achill" <ach### [at] matumde> wrote in message
news:web.3ea6ac9f97d4f590e54f3efb0@news.povray.org...
> Is there a (CSG-like?) possibility to create the vector sum of objects or
at
> least of simple solids?
>
> Thanks for your help.
>
> Achill
>
>


Post a reply to this message

From: Achill
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 16:04:29
Message: <3EA84332.50203@ma.tum.de>
Alan Walkington wrote:
> This might actually be approximated in the following manner:
> 
> Given a sphere (A) and a cube(B) in CSG, normalise them at <0,0,0>.and
> construct a mesh equivilent for each. Create an alogrithm that, for each
> vertice in A, finds an equivelant vertice (or set of vertices) in B and
> builds a new mesh using these results.  If I am visualing this properly,
> this might give the effect of a 'rounded cube' for this example.

Adding mesh approximations of solids should be possible, like adding 
polytopes. The "vertices" and some more useless points (which have to be 
excluded, for example with the help of a "convex hull algorithm") are 
given by all possible sums of vertices from the input sets.

That seems to be a bigger project though... :-)

Achill


Post a reply to this message

From: Alan Walkington
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 16:40:25
Message: <3ea84bb9$1@news.povray.org>
"Achill" <ach### [at] matumde> wrote in message
news:3EA### [at] matumde...
<snip>
> Adding mesh approximations of solids should be possible, like adding
> polytopes. The "vertices" and some more useless points (which have to be
> excluded, for example with the help of a "convex hull algorithm") are
> given by all possible sums of vertices from the input sets.
>
> That seems to be a bigger project though... :-)
>
Bigger than what?

You are suggesting to create a "sum of a set A with a sphere of radius r,
centered at <0,0,0>, which gives the set of all points "within distance
r of A".

Aren't there an infinite number of points within a solid, or for that
matter, on the surface of a solid?
That sounds like a pretty big project to me. ...

You will have to use some approximation ... some definition of a smallest
cell .. to give yourself a finite number of points within the solid.  A mesh
is just doing that to the surface rather than the volume. How is that more
complicated?

Alan


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 24 Apr 2003 17:10:22
Message: <cjameshuff-B88E28.17102824042003@netplex.aussie.org>
In article <3EA### [at] matumde>, Achill <ach### [at] matumde> 
wrote:

> Converting arbitrary point sets into meshes or surfaces is a difficult 
> task (known as "surface reconstruction"). Are there algorithms for this 
> task used with (or in) povray?

I am aware of the difficulties, but there don't seem to be many 
alternatives...as far as I can tell, you would only be able to use the 
vertex information and would get a field of points, losing all 
"connectivity" information. POV does not use any algorithms like this 
and they would probably be difficult and slow to implement in the scene 
description language. As I mentioned, it is possible to test rays 
against a point field instead...this may be a better idea, but would 
require implementing a point field primitive for POV.

-- 
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

From: Achill
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 03:08:17
Message: <3EA8DEC5.7000403@ma.tum.de>
Alan Walkington wrote:
> "Achill" <ach### [at] matumde> wrote in message
> news:3EA### [at] matumde...
> <snip>
> 
>>Adding mesh approximations of solids should be possible, like adding
>>polytopes. The "vertices" and some more useless points (which have to be
>>excluded, for example with the help of a "convex hull algorithm") are
>>given by all possible sums of vertices from the input sets.
>>
>>That seems to be a bigger project though... :-)
>>
> 
> Bigger than what?

I guess it would take some time to implement and develop corresponding 
algorithms for meshes (with certain nice properties). So it is "bigger" 
than anything that I could realize within the next few years...



> You are suggesting to create a "sum of a set A with a sphere of radius r,
> centered at <0,0,0>, which gives the set of all points "within distance
> r of A".

That was only a very special example of a "sum of two sets".



> Aren't there an infinite number of points within a solid, or for that
> matter, on the surface of a solid?
> That sounds like a pretty big project to me. ...

That is why I suggested to use an approximation with meshes.


> You will have to use some approximation ... some definition of a smallest
> cell .. to give yourself a finite number of points within the solid.  A mesh
> is just doing that to the surface rather than the volume. How is that more
> complicated?

Mesh approximations of the surface of a solid is all you need to build 
an approximation of the sum. This is not "more complicated". It is the 
only idea I have for the moment, which could lead to a general sum 
(approximation) of solids. Might be an illusion...?!?

Achill


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 03:30:02
Message: <5johavcb3rjtc792kr1v29f36h5sf5r3q4@4ax.com>
On Thu, 24 Apr 2003 21:45:00 +0200, Achill <ach### [at] matumde> wrote:
> Converting arbitrary point sets into meshes or surfaces is a difficult 
> task (known as "surface reconstruction"). Are there algorithms for this 
> task used with (or in) povray?

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.

ABX


Post a reply to this message

From:
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 06:56:45
Message: <3ea9146d$1@news.povray.org>
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


--
-------------------------------------
Frank 'Sputnik' Rothfuß
e-mail: fr### [at] computermuseumfh-kielde
-------------------------------------


Post a reply to this message

From:
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 07:01:26
Message: <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.

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


--
-------------------------------------
Frank 'Sputnik' Rothfuß
e-mail: fr### [at] computermuseumfh-kielde
-------------------------------------


Post a reply to this message

From: Peter Popov
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 07:27:39
Message: <mp6iav4i5vf8s4ggpci0trm5rr8rga7134@4ax.com>
On Thu, 24 Apr 2003 14:47:51 +0200, Achill <ach### [at] matumde> 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] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 16:11:44
Message: <cjameshuff-AA9970.16121325042003@netplex.aussie.org>
In article <3ea91586$1@news.povray.org>,
 "Frank 'Sputnik' Rothfuß" <fr### [at] computermuseumfh-kielde> wrote:

> 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

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 25 Apr 2003 16:13:26
Message: <cjameshuff-119725.16140025042003@netplex.aussie.org>
In article <5johavcb3rjtc792kr1v29f36h5sf5r3q4@4ax.com>,
 ABX <abx### [at] abxartpl> 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] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From:
Subject: Re: (vector) sum of two objects: Q&D SDL
Date: 25 Apr 2003 22:50:44
Message: <3ea9f404$1@news.povray.org>
/*
    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

From: ABX
Subject: Re: (vector) sum of two objects
Date: 28 Apr 2003 02:19:32
Message: <nahpav41nl0hkk6gvto0tkoq0381td0uvp@4ax.com>
On Fri, 25 Apr 2003 16:14:00 -0400, Christopher James Huff
<cja### [at] earthlinknet> 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

From: Christopher James Huff
Subject: Re: (vector) sum of two objects
Date: 28 Apr 2003 21:02:11
Message: <cjameshuff-39A8DD.21005128042003@netplex.aussie.org>
In article <nahpav41nl0hkk6gvto0tkoq0381td0uvp@4ax.com>,
 ABX <abx### [at] abxartpl> 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] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: (vector) sum of two objects: Q&D SDL
Date: 28 Apr 2003 21:21:39
Message: <cjameshuff-D2E6CD.21201928042003@netplex.aussie.org>
In article <3ea9f404$1@news.povray.org>,
 "Frank 'Sputnik' Rothfuß" <fr### [at] computermuseumfh-kielde> wrote:

>     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] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: ABX
Subject: Re: (vector) sum of two objects
Date: 30 Apr 2003 09:52:59
Message: <r5lvavo37qbp1mreph4lq704ang28l28t7@4ax.com>
On Mon, 28 Apr 2003 21:00:51 -0400, Christopher James Huff
<cja### [at] earthlinknet> 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

Goto Latest 50 Messages Next 2 Messages >>>

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