Hello, And thanks for your reply. Unfortunately, the situation is not this easy. The dimer example was somehow misleading. It is not so straightforward to calculate the area of multiple overlapping circles (in particular when the intersection of 4-5 circles is not empty). I think I will have to resort to some Monte Carlo integration. Cheers Lorenzo On Mon, 01 Oct 2012 16:59:21 +0200, <scipy-user-request@scipy.org> wrote:
Dear All, I hope this is not too off-topic. I need to know if there is already some ready-to-use SciPy algorithm (or at least if this is easy to implement or not). Consider a dimer, i.e. 2 spheres with a single contact point. This dimer can have any orientation in the 3D and I have the (x,y,z) coordinates of the centre of the 2 spheres. For a given orientation, I want to project the dimer on, let's say, the xy plane and evaluate the area of the surface of its projection. I spoke about a dimer since it is easy to start discussing a simple case, but in general I will deal with objects consisting of several non-overlapping spheres such that any sphere has at least a contact point with another sphere. There is nothing implemented in scipy for this. For the case of spheres projected (orthographically?) onto a plane, the shadows are
On Mon, Oct 1, 2012 at 10:34 AM, Lorenzo Isella <lorenzo.isella@gmail.com> wrote: probably-overlapping circles (the contact point is irrelevant). It looks like there is an analytical solution to the area of the intersection for circles: http://mathworld.wolfram.com/Circle-CircleIntersection.html You can probably just add up the areas of each circle, then subtract out one copy of each area of intersection to get the area of the union.
On Mon, Oct 1, 2012 at 7:54 PM, Lorenzo Isella <lorenzo.isella@gmail.com> wrote:
I think I will have to resort to some Monte Carlo integration.
Not everything is lost. You could make a boolean 3D grid as big as your memory allows to, with True in the spheres and False in empty space. Rotate it is just matrix multiplication, and project over one axis with .any. The shape of the sphere doesn't have oscillations, so a regular grid is a good approach to the integration.
On 10/1/2012 10:54 AM, Lorenzo Isella wrote:
Hello, And thanks for your reply. Unfortunately, the situation is not this easy. The dimer example was somehow misleading. It is not so straightforward to calculate the area of multiple overlapping circles (in particular when the intersection of 4-5 circles is not empty). I think I will have to resort to some Monte Carlo integration. Cheers
Lorenzo
Try Shapely <http://toblerity.github.com/shapely/>, a geospatial library, to analyze planar geometric objects after projecting your 3D objects. Christoph
On Mon, 01 Oct 2012 16:59:21 +0200, <scipy-user-request@scipy.org> wrote:
Dear All, I hope this is not too off-topic. I need to know if there is already some ready-to-use SciPy algorithm (or at least if this is easy to implement or not). Consider a dimer, i.e. 2 spheres with a single contact point. This dimer can have any orientation in the 3D and I have the (x,y,z) coordinates of the centre of the 2 spheres. For a given orientation, I want to project the dimer on, let's say, the xy plane and evaluate the area of the surface of its projection. I spoke about a dimer since it is easy to start discussing a simple case, but in general I will deal with objects consisting of several non-overlapping spheres such that any sphere has at least a contact point with another sphere. There is nothing implemented in scipy for this. For the case of spheres projected (orthographically?) onto a plane, the shadows are
On Mon, Oct 1, 2012 at 10:34 AM, Lorenzo Isella <lorenzo.isella@gmail.com> wrote: probably-overlapping circles (the contact point is irrelevant). It looks like there is an analytical solution to the area of the intersection for circles: http://mathworld.wolfram.com/Circle-CircleIntersection.html You can probably just add up the areas of each circle, then subtract out one copy of each area of intersection to get the area of the union.
SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
Lorenzo, Were the previous suggestions not viable due to speed or precision? http://thread.gmane.org/gmane.comp.python.scientific.user/30450/focus=30464 Jonathan On Mon, Oct 1, 2012 at 11:54 AM, Lorenzo Isella <lorenzo.isella@gmail.com> wrote:
Hello, And thanks for your reply. Unfortunately, the situation is not this easy. The dimer example was somehow misleading. It is not so straightforward to calculate the area of multiple overlapping circles (in particular when the intersection of 4-5 circles is not empty). I think I will have to resort to some Monte Carlo integration. Cheers
Lorenzo
participants (4)
-
Christoph Gohlke -
Daπid -
jkhilmer@chemistry.montana.edu -
Lorenzo Isella