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

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

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