+ Reply to Thread
Results 1 to 5 of 5

Need a VBA func. that tells if a point lies above/below 3D polygon surface

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Need a VBA func. that tells if a point lies above/below 3D polygon surface

    dqqqqqqqqqqqqqqqqqqqqqqqqqq
    dqqqqqqqqqqqqqqqqqqqqqqqqqqdqqqqqqqqqqqqqqqqqqqqqqqqqq
    dqqqqqqqqqqqqqqqqqqqqqqqqqq
    dqqqqqqqqqqqqqqqqqqqqqqqqqq
    Last edited by gonurvia; 03-30-2017 at 04:25 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,955

    Re: Need a VBA func. that tells if a point lies above/below 3D polygon surface

    cross-posted here don't know if there are more: http://www.msofficeforums.com/excel-...oint-lies.html Note that cross-posting is not necessarily a bad thing, but you can create a lot of bad feelings on forums like this (and risk getting your topic locked) if you do not include links to your cross-posts.

    Do you have any more descriptions of this algorithm? The mathworks link really only shows how convenient it is to call the "inpolyhedron" function in MATLAB as part of a larger procedure that plots a surface and filters several random points for those that are inside the polyhedron, with no real discussion of the actual code or algorithm inpolyhedron uses.

    Other results of my search suggest that there is a lot of "linear algebra" in this (dot products, cross products, etc.). Can we assume that you are familiar with these linear algebra topics? This could be a useful review, though it stops at the much simpler "convex polyhedron" example: https://www.cs.oberlin.edu/~bob/cs35...orGeometry.pdf
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Need a VBA func. that tells if a point lies above/below 3D polygon surface

    dqqqqqqqqqqqqqqqqqqqqqqqqqqdqdqqqqqqqqqqqqqqqqqqqqqqqqqq
    dqqqqqqqqqqqqqqqqqqqqqqqqqqdqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdqqqqqqqqqqqqqqqqqqqqqqqqqq
    Last edited by gonurvia; 03-30-2017 at 04:26 AM.

  4. #4
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Need a VBA func. that tells if a point lies above/below 3D polygon surface

    Inside 3D is what I’m looking for, except I want it to consider only x and y coord. (2D surface, as in Inside function) when calculating if its inside/outside and the Z coordinate to know if its wither above or below. Let me set an example. Say I have the following 3D plane;
    (0,0,0)
    (0,4,1)
    (4,4,3)
    (4,0,1)
    (0,0,0)
    and a point with (2,2,8)
    In this example, Inside function would tell me its inside (only x&y coord. taken into account), while Inside3D would say its outside, as it is designed for it. How could I get it to tell me it is Inside and, in this example, ABOVE the plane??

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,955

    Re: Need a VBA func. that tells if a point lies above/below 3D polygon surface

    This sounds like a different problem from what was originally requested.

    Here's what I see:

    1) Is the point above the plane's projection in the XY plane.
    1a) Is minx<=x<=maxx -- In this case, is 0<=2<=4 -- and Is miny<=y<=maxy -- in this case is 0<=2<=4. Note that this plane is a rectangle and the projection onto the XY plane is also a rectangle -- Will that always be the case?? Because this gets more complicated for non-rectangles.
    2) Is the point above, on, or below the plane.
    2a) It is obvious in this case that z is above the plane because z>=maxz. Likewise, if z<=minz, then it would be obvious that the point is below the plane.
    2b) The tricky part is when minz<=z<=maxz. In those cases, yoiu probably need to regress on the points that define the plane to get zplane=f(x,y). then compute zplane from f, and compare it to z. If z>zplane, then it is above.

    Does that sound like the right kind of algorithm?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fill Polygon on a Chart to Match Existing Series Colors
    By JMC_T in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-14-2017, 12:06 PM
  2. [SOLVED] create polygon/FREE FORM by cell inputs
    By riz4u in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2016, 01:45 PM
  3. [SOLVED] Formula to label the points of a polygon.
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-17-2013, 08:51 AM
  4. When Cell Value lies between two values?
    By Stirly in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2006, 06:18 AM
  5. Replies: 1
    Last Post: 05-22-2006, 03:15 PM
  6. Cell lies within range
    By Kaval in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2005, 08:05 AM
  7. CAD surface from EXCEL surface plot
    By tombemis in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-12-2005, 05:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1