3
$\begingroup$

I have some discrete points in 3D: https://www.dropbox.com/s/syl7w3s30tc30b9/amycoo.xlsx?dl=0

I have the following problem:

  1. I want to create a 3D surface from those points and need to somehow interpolate the "outer" points.

  2. I want to make this shape/surface a bit transparent and highlight some points on or in the interior of it, e.g. an arrow pointing at that point with a text label showing a value.

To make this more clear: Let's say the points describe a brain area and I want to create a continuous version of the shape of this area, but also highlight specific points which represent the result of some data analysis, i.e. select the first point which has a value of 10.

ListPointPlot3D was a first start, but then I get stuck and hope for some guidance.

Thanks!

$\endgroup$
2
  • $\begingroup$ Is something like ConvexHullMesh what you're looking for w.r.t. #1? $\endgroup$
    – N.J.Evans
    Commented Mar 29, 2017 at 13:48
  • $\begingroup$ Maybe look into ListSurfacePlot3D[] as well... $\endgroup$ Commented Mar 29, 2017 at 14:05

1 Answer 1

4
$\begingroup$

Here's a simple example:

(*This is just me getting your data into an array of triples since I copy-pasted it.*)

data = ToExpression /@ 
   Partition[StringSplit[a, WhitespaceCharacter], 3];

(*now data looks like {{x,y,z},{x,y,z},...}*)

You can use Show with ConvexHullMesh and Graphics3D for annotation, and HighlightMesh to change the style. I just plotted a point at the centroid and put an arrow pointing to that spot as an example:

hull = ConvexHullMesh@data;
Show[
 HighlightMesh[hull, Style[2, Opacity[0.5]]],
 Graphics3D[{
   Red, 
   Point[RegionCentroid@hull], 
   Arrow[{# + {5, 5, 5}, #}] &@(RegionCentroid@hull)
   }]
 ]

Which produces the following:

enter image description here

$\endgroup$
3
  • $\begingroup$ Wow! Thanks, thats exactly what I wanted! Two follow-up questions though: 1. How can I add a text at the beginning of the arrow? 2. Can I somehow get a list of the points that only lie on the outer surface? $\endgroup$
    – holistic
    Commented Mar 29, 2017 at 14:57
  • 1
    $\begingroup$ MeshCoordinates@hull will give you the coordinates of the vertices, and you can use Graphics3D[{Text["label",{x,y,z}],Arrow[...]...}]. That will be fairly basic, if you want something nicer, I'd suggest searching the site for info about annotating Graphics3D I'm pretty certain that's been discussed before. $\endgroup$
    – N.J.Evans
    Commented Mar 29, 2017 at 16:12
  • 1
    $\begingroup$ Great, thanks again! $\endgroup$
    – holistic
    Commented Mar 29, 2017 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.