comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » point inside/outside of 3D object.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: point inside/outside of 3D object. [message #91364 is a reply to message #76626] Sat, 04 July 2015 12:55 Go to previous messageGo to previous message
Guneshwar Thangjam is currently offline  Guneshwar Thangjam
Messages: 9
Registered: March 2015
Junior Member
On Tuesday, 21 June 2011 11:24:01 UTC+2, Wox wrote:
> On Sat, 18 Jun 2011 11:34:42 -0700 (PDT), Junum <junshikum@gmail.com>
> wrote:
>
>> Thanks Karl.
>> I wanted know whether IDLanROI::ContainsPoints can be applied to 3D
>> case.
>
> I'd guess the answer is no. You should implement this yourself (as
> Karl suggested) or you could do something like below. I'm not sure
> whether this is the best way, but it seems to work.
>
>
> ; Generate vertices
> v=TetrahedronVertices(r=10,phideg=-20)
>
> ; Connectivity list: [n,i[0],...,i[n-1],n,j[0],...,j[n-1],...]
> ; n: number of vertices for each face
> ; i[0],...,i[n-1]: vertices for face 1, ordered so that the normal
> ; points outwards (right-hand rule)
> ; j[0],...,j[n-1]: vertices for face 2, ordered so that the normal
> ; points outwards (right-hand rule)
> conn=[3,0,3,1, 3,0,1,2, 3,0,2,3, 3,1,3,2]
>
> ; Remark: if the number of vertices > 4 then you could generate
> ; the list like this:
> ;Qhull, v, tr, /delaunay
> ;conn=tetra_surface(v, tr)
>
> ; Point
> p=[0,0,0.]
>
> ; Volume of the polyhedron
> volume=tetra_volume(v,conn)
>
> ; Expanded polyhedron (including your point)
> ; vertices and connectivity list
> v2=[[v],[p]]
> Qhull, v2, tr, /delaunay
> conn2=tetra_surface(v2, tr)
>
> ; Volume of the expanded polyhedron
> volumeexp=tetra_volume(v2,conn2)
>
> ; If the "expanded volume" is larger, the point lies outside
> if volumeexp gt volume then print,'Exterior' else print,'Interior'

Hi Wox,
I am using this approach to find out points inside or outside of a 3d polyhedron. It is working and I used it in some of my analysis. Can you please give me a reference or literature where I can find some more details of this?
Thanks,
Guni
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting a sub field image..
Next Topic: ENVI: Overlay in 3D SurfaceView

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:44:53 PDT 2025

Total time taken to generate the page: 0.32016 seconds