Excluding grid in calculations

27 views
Skip to first unread message

Antoine Thomas

unread,
Aug 20, 2020, 8:58:02 AM8/20/20
to bempp
Hello,

I'm trying to calculate HRTFs for various models with bempp. I'm using the sphere scattering tutorial as a reference. In the tutorial, we don't compute the results inside the sphere thanks to its equation on the plane. I've been looking all day for a way to do the same with models that are more complex, but haven't found any.

Is there a known way to do this ?

Thanks a lot,
Antoine THOMAS

Matthew Scroggs

unread,
Sep 1, 2020, 5:03:37 AM9/1/20
to bempp
Hello,

For shapes more complicated than a sphere or cube, you'll need a way to decide whether or not a point is inside (eg count the number of times a line from (-10,-10,-10) to the point crosses the surface. Once you've got this, something along the lines of:

```
def inside(x, y, z):
    # A function that returns True if (x, y, z) is inside shape
    

idx = []
for i, (x, y, z) in enumerate(points)
    if inside(x, y, z):
        idx.append(i)
```

Then using the potential operators as in the example.

Hope this helps,
Matthew
Reply all
Reply to author
Forward
0 new messages