Tag Info

New answers tagged

5

Here's one way. I'm going to use the contourRegionPlot3D function from here. I include the function definition here for convenience: contourRegionPlot3D[region_, {x_, x0_, x1_}, {y_, y0_, y1_}, {z_, z0_, z1_}, opts : OptionsPattern[]] := Module[{reg, preds}, reg = LogicalExpand[region && x0 <= x <= x1 && y0 <= y <= y1 ...


4

This is a repost of Wolfram Community answer Let's start from your code: cub1 = Cuboid[{0, 0, 0}, {20, 2, 20}]; cub2 = Cuboid[{12, 0, 8}, {17, 2, 17}]; Graphics3D[{cub1, cub2}]; reg = DiscretizeRegion[RegionDifference[cub1, cub2]] You have a lot of tetrahedrons: MeshCells[reg, 3] // Length 10093 And a lot of polygons: MeshCells[reg, 2] // ...


0

Try this: ListPlot3D[values, MeshFunctions -> {Function[{x, y, z}, Sin[x]^2 + 2 y]}] This produces a pretty low-quality output for the given example, but the more points you have in the ListPlot the more points are used in calculating the contours for the mesh. For example: ListPlot3D[ Join @@ Table[{x, y, Abs[Sin[x + I y]]}, {x, -Pi, +Pi, ...


3

Using @MichaelE2's example, a combination of Glow and Lighting->None produces a similar picture: Show[PolyhedronData["Icosahedron"] /. Polygon[p_] :> MapIndexed[{Glow[Hue[Mod[3*First[#2], 20]/20]], Polygon[#1]} &, p], Lighting -> None] Alternatively: A surface can be specified as having an absolute color col by giving the ...


5

Perhaps Lighting -> {{"Ambient", White}? Show[ PolyhedronData["Icosahedron"] /. Polygon[p_] :> MapIndexed[{Hue[Mod[3*First[#2], 20]/20], Polygon[#1]} &, p], Lighting -> {{"Ambient", White}} ]


1

Tak a closer look at documentation: data = RandomReal[1, {100, 2}]; Histogram3D[data, {{.2}, {.5}}] The following bin specifications bpsec can be given: {w} use bins of width w (...) {xspec,yspec} give different x and y specifications ergo: {{wx}, {wy}}


1

Somehow turning on Selectable does what you need: DialogInput[Graphics3D[Cuboid[]], Deployed -> False, Selectable -> True]


0

Data type You wrote: Many MRI volumes, however, have values ranging from 0-256 or higher. I want to returning an Image3D object in which the data has not been modified, so I would like to keep the values between 0 and 256 in this case. If integer values [0, 255] are acceptable you can specify the "Byte" data type for Image3D: ...


2

You haven't defined Axes3D[]. Nevertheless: n = ListPointPlot3D[{{4, 5, 6}, {3, -3, -6}, {2, 2, 5}}, PlotLegends -> Automatic, ImageSize -> 400, PlotStyle -> PointSize[0.03], PlotRange -> {-10, 10}]; o = Graphics3D[{Red, Arrow[{{4, 5, 6}, {3, -3, -6}}]}, Axes -> True, Boxed -> False]; r = Graphics3D[{Blue, Arrow[{{4, 5, 6}, ...


4

myThumb = Import["...../15809_Thumbs_Up_v1_v4.stl"]; Show[myThumb, Graphics3D[ { {Red, Thick, Arrow[{{0, 0, 0}, {0, 0, -20}}]}, {Green, Thick, Arrow[{{0, 0, 0}, {0, -20, 0}}]}, {Blue, Thick, Arrow[{{0, 0, 0}, {-20, 0, 0}}]}, {Text[Style["x", Italic, Blue, 24], {-22, 0, 0}]}, {Text[Style["y", Italic, Red, 24], {0, 0, -22}]}, ...


7

It's easiest to control the position and size of all 3D objects if they are combined in the same Graphics3D. For an STL file, this could be done as follows (I didn't want to look for a hand model, so I chose the seashell model built into ExampleData, since it's also chiral): Export["g.stl", ExampleData[{"Geometry3D", "Seashell"}]]; g = Import["g.stl"]; ...


2

ListPlot3D usually produces a surface mesh , but you seem to want points as output. It is easy to produce those just using Point. clrs = RGBColor /@ Sort@RandomReal[1, {50, 3}]; pts = Sort@RandomInteger[10, {50, 3}]; Show[Graphics3D@MapThread[{PointSize@Large, #2, Point[#1]} &, {pts, clrs}],Axes->True]


0

I drew a contour plot by defining Contours as 5,If it looks something like what your are expecting we may be on the right track.However I can't do the List Plot because gs5Matrix5 is not defined. Rm5[θ_, v_] = Rm0 + dR1*f[θ, v] + dR2*g[θ]; g[θ_] = If[θ >= 90, Cos[(θ*π)/180]^2, 0]; m5[θ_, v_] = m0 + dm*f[θ, v]; m5values = {ϵ0 -> 180.51, dϵ1 -> ...


1

With some bells and whistles: Manipulate[ fun := x^2 + y^2; Show[ Plot3D[fun, {x, -rng, rng}, {y, -rng, rng}, ColorFunction -> Function[{x, y, z}, Hue[z]], PlotStyle -> Opacity[opac]], Graphics3D[ {Blue, AbsolutePointSize[pt], Point[{1, 1, 1}]}]], {{rng, 2, "x & y Range"}, 1.5, 10, Appearance -> "Labeled"}, ...


0

Perhaps something like: f[a_, b_, c_][x_, y_] := a + {b, c}.{x, y}; disp = {{1, 1, 0}, {1, -1, 0}, {-1, -1, 0}, {-1, 1, 0}}; Manipulate[With[{p1 = {px, py, f[a, b, c][px, py]}, p0 = {px, py, pz}}, Show[ParametricPlot3D[{x, y, f[a, b, c][x, y]}, {x, -10, 10}, {y, -10, 10}, MeshFunctions -> {#1 &, #2 &}, Mesh -> {{px}, {py}}, ...


3

There's a related question, A problem on generating convex hull, and I can adapt my answer there to this case. The basic approach is to map the points in the plane to a 2D coordinate system, find the hull in 2D, and embed the hull in the plane in 3D. I inserted an extra point in the interior, because that sometimes causes trouble when it is dropped in the ...


3

If you generate random points using p = RandomReal[{-1, 1}, {5, 3}] then your code works fine -- suggesting that the problem has to do with the fact that all your points lie in a plane. A simple solution is to perturb one of the points slightly outside the plane: alfa = 0.75; p = {{1,0,0}, {alfa,0,1-alfa}, {alfa,1-alfa,0}, {0,alfa,1-alfa}, ...


3

Here is a version that takes as a reference a Plot of the two functions. It will only work if the x-range and the y-range are of the same magnitude. If not the placement of the axes labels will be screwed. (* Plot the original function *) X[ϵ_] := 1 - 0.5 ϵ x[r_] := -0.5 + 0.5 r p = Plot[{X[r], x[r]}, {r, -1, 1}]; (* Get the attributes of the plot p *) pl = ...


2

Xf[ϵ_] := 1 - 0.5 ϵ xf[r_] := -.5 + 0.5 r; blueaxis = {Directive[Blue, Thick, Arrowheads[{0, .05}]], Arrow @@ # &}; redaxis = {Directive[Red, Thick, Arrowheads[{-.05, 0}]], Arrow @@ # &}; txtF = Text[Style[#, 20, Italic], #2] &; axeslabels = txtF @@@ Transpose[{{"ε", "r", "+X", "-X", "-(-X)", "+(-X)"}, {{.1, 2.7}, {-.1, -.7}, {.8, .3}, ...


5

Following Stelios suggestion without = ContourPlot3D[ x^4 + y^4 + z^4 - (x^2 + y^2 + z^2)^2 + 3 (x^2 + y^2 + z^2) == 3, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, RegionFunction -> Function[{x, y, z}, x^2 + y^2 + z^2 > 1.5^2]]


12

My approach is based on the basic Frenet Trihedron formulas (which were implemented in v.10) and also some basic geometric transformations (matrix rotation and translation). It can be applied to extrude any 2D polygon. 1. Choice of the path I modified a little bit the OP's path for the sake of keeping the 3D graphics simple to view. path[u_] := {Sin[u], ...


6

The faster/slower controls can be controlled using AppearanceElements. The following values can be used in Manipulate: "StepLeftButton", "StepRightButton", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton" Take the ones you want to use (you wanted to drop "FasterSlowerButtons"): Manipulate[ Graphics3D[{Hue[.12], {Sphere[{0, 0, 0}, .1]}, ...


4

Change the AnimationRate in the iterator: Manipulate[ Graphics3D[{Hue[.12], {Sphere[{0, 0, 0}, .1]}, {FaceForm[], Sphere[{0, 0, 0}, .8 + .02]}, Gray, Table[Line[ Table[{.8}[[i]] {Cos[tt], Sin[tt], 0}, {tt, 0, 2 Pi, 2 Pi/100.}]], {i, 1}], Blue, Sphere[.8 {Cos[t], Sin[t], 0}, .02]}, PlotRange -> All, ImageSize -> {400, ...



Top 50 recent answers are included