POV-Ray : Newsgroups : povray.newusers : (vector) sum of two objects Server Time
31 Jul 2024 04:19:58 EDT (-0400)
  (vector) sum of two objects (Message 11 to 20 of 52)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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