Hot answers tagged

14

One way is to compute the solid angle subtended by the cow viewed at the point by summing signed solid angles corresponding to the cow's polygonal faces. If the total is 4 pi, the point is inside the cow; if 0, outside. Background Quoting Wikipedia, "Solid angle is the two-dimensional angle in three-dimensional space that an object subtends at a point." ...


12

This is basically a rehash of code I posted in a prior thread on this topic. The underlying method is to shoot a ray from the point and see how many surface triangles it intersects. elsie = ExampleData[{"Geometry3D", "Cow"}]; verts = First[Cases[elsie, GraphicsComplex[a_, ___] :> a, Infinity]]; pgons = First[Cases[elsie, Polygon[x_, ___] :> x, ...


7

You may be looking for the option Appearance -> "Projected" which produces a different rendering: Graphics3D[{ Arrowheads[ConstantArray[0.05, 10], Appearance -> "Projected"], Arrow[{Cos[1 #] Sin[#], Sin[1 #] Sin[#], Cos[#]} & /@ Range[0, Pi, Pi/20]] }, BoxRatios -> 1 ] This does keep the arrow "in line" but the arrow will disappear ...


4

You can convert Raster3D into Image3D simply by applying Image3D and then use ImageValuePositions: whitePos = {1, 2, 3}; raster = Raster3D[ ReplacePart[RandomReal[1, {5, 5, 5, 3}], whitePos -> {1, 1, 1}]]; i3d = Image3D@raster xyz = ImageValuePositions[i3d, White] {{2.5, 1.5, 0.5}} PixelValuePositions[i3d, White] {{3, 2, 1}} As you ...


3

Your problem was that your line did not depend upon $y$. ParametricPlot3D functions use both variables and produces fundamentally two-dimensional surfaces when you have two variables. ParametricPlot3D[{ {x, y, 2 Sin[x]}, {x, 2 + y/50, 2 Sin[x]} }, {x, 0, 3 π}, {y, 0, 6}, PlotStyle -> {{Opacity[0.5], Pink}, {Black}}] Best is to make the plot of ...


2

You will want to set the automatic rescaling of the data passed to ColorFunction, then write your own ColorFunction that appropriately rescales the data so that a $z$ value of 25 is translated to an input of $0.5$ to the TemperatureMap color function: ParametricPlot3D[ yourFunction, yourParamValues, ColorFunctionScaling -> False, ColorFunction ...


2

You can also use the options Mesh and MeshFunctions with a single ParametricPlot3D: a = 2; b = 2 Pi; ParametricPlot3D[{u, v, 2 Sin[u]}, {u, 0, 3 Pi}, {v, 0, 6}, MeshFunctions -> {# &, #2 &, ConditionalExpression[#2 - 2, a <= # <= b] &}, Mesh -> { 15, Range[0, 6, .5], {{0, Directive[Thick, Red]}}}]


2

This is not entirely the same, as it changes coloring and z-scaling, but perhaps something similar may be of help. Essentially, the zero values are lifted by a small increment, while the original z-range is preserved. data = {{1, 1, 1, 1}, {1, 0, 3, 1}, {2, 0, 0, 1}}; ListPlot3D[data /. x_ /; x < .01 -> 0.01, Mesh -> None, InterpolationOrder ...


2

Perhaps this solution, which uses Tooltip, will work for you. I prefer this approach because it is simple and minimizes clutter in the plot. data = {{0.000, 0.000, 0.000}, {-1.612, 8.077, -2.474}, {-19.599, 186.849, -246.583}, {-29.000, -19.499, 12.157}, {-1.646, -1.375, -3.842}, {3.127, -19.235, 15.660}, {167.744, 834.512, -122.686}, {-5.353, ...


1

labels = {"Sun", "Sirius", "Canopus", "Arcturus", "Rigil K", "Vega", "Rigel", "Procyon", "Betelgeuse", "Bellatrix", "Capella", "Aldebaran", "Antares", "Pollux", "Castor", "Regulus", "VY Canis M", "Proxima C", "Barnard", "Wolf 359", "Lalande 21185", "Ross 154", "Epsilon Eri", "Tau Ceti", "Kruger 60", "Gliese 876", "55 Cancri", "61 ...



Only top voted, non community-wiki answers of a minimum length are eligible