Tag Info

New answers tagged

1

Is ColorFunction what you want? (The input is automatically rescaled from 0 to 1, so Rescale is unnecessary; see also ColorFunctionScaling.) GrapheMagnetique[n_] := ParametricPlot3D[ Evaluate[{x[s], y[s], z[s]} /. CourbeMagnetique[n]], {s, Smin[n], Smax[n]}, PlotStyle -> {Directive[AbsoluteThickness[1]](*,Blue*)}, ColorFunction -> ...


1

Something like ListPlot3D just that I want it to show those cuboids. If you need to place the same shape at multiple points either in 2D or 3D, the best solution is Translate. It can take more than one translation vector as the second argument. Example: pts = RandomReal[10, {20, 3}]; Graphics3D[ Translate[ Cuboid[], pts ] ]


4

Its difficult to work with your question since you don't define your functions and variables but hopefully this example will be enough. Let's first make a table of cuboids with different z values (but using the same z-value within each cuboid so they are still rectangles). This examples uses the same x and y values for every Cuboid for simplicity, but you ...


2

Kind of a part answer: It is quite easy to convert a quaternion to a Mathematica RotationMatrix. First normalize the quaternion. The first element will then be the cosine of half the rotation angle. The last 3 elements together describes the axis of rotation. q = Normalize@{1, 1, 1, 1} rm = RotationMatrix[2 ArcCos[First@q], Rest@q]


5

I was trying to do something similar and created a useful solution. This answer uses Mathematica version 10.2.0.0. First define a region, e.g. a sphere region: region = ImplicitRegion[x^2 + y^2 + z^2 <= 10, {x, y, z}]; Now we can generate random points within this region using the function RandomPoint: pts = RandomPoint[region, 20];(*this generates ...


2

Relabeling to avoid conflict with in-bulit symbols: a = {0, 0, 0}; b = {400, 0, 0}; c = {200, 400, 200}; d = {226, 137, 62}; aprime = {22, 36, 0}; bprime = {382, 33, 0}; cprime = {240, 357, 200}; c0 = {40, 0, 0}; c1 = {360, 0, 0}; c2 = {200, 360, 200}; r = 40; arc just to deal with desired arcs. Sphere for illustration. arc[p1_, p2_, p3_, n_] := With[{v1 ...


7

This is the result of Plot Themes. This restores the old behavior: SetOptions[ParametricPlot3D, PlotTheme -> None]; More specifically the default Theme results in embedded Lighting values: Cases[ ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z}, {t, -Pi, Pi}, {z, 0.35 Pi, Pi}, Mesh -> None, PlotStyle -> Specularity[0], PlotTheme -> ...


8

It appears to be a bug in computing the vertex normals at the step. Here's are the vertex normals: c = cylinderPlot3D[f, 0.6]; normals = FirstCase[c, GraphicsComplex[pts_, __, VertexNormals -> vn_, ___] :> Line[Transpose@{pts, pts + vn}], -1]; Show[c, Graphics3D[{Opacity[0.1], normals}]] It looks like the HeavisideTheta function is not being ...


0

Export["test.eps", g] FileByteCount["test.eps"]/1024^2 // N 204.9 Export["test.eps", Rasterize[g, RasterSize -> 2048]]; FileByteCount["test.eps"]/1024^2 // N 1.38359 (much faster too) You will need to see for yourself the quality is quite good.


0

Here is a quick answer (based on @GuessWhoItIs's comment) for a basic rotation: STLdata = Import["MyFile.stl", "GraphicsComplex"]; RotatedSTL = Graphics3D[ GeometricTransformation[STLdata, RotationTransform[30 Degree, {1, 1, 1}]], Axes -> True] Export["MyFileRotated.stl", RotatedSTL, {"STL","BinaryFormat" -> False}]


6

You could also do: g[z_] := ParametricPlot3D[{{2 Cos[t] + Cos[z t], 2 Sin[t] - Sin[z t], z}, {3 Cos[t], 3 Sin[t], z}, {Cos[t], Sin[t], z}}, {t, 0, 2 Pi}, PlotStyle -> {{Thick, Hue[z/5]}, Black, Black}]; then, plt = Show[Table[g@z, {z, 2, 5}], PlotRange -> All] You can rescale as desired wrt box ratios or z. The following is a ...


7

One way to do this is to covert the 2D graphics primitives to an equivalent 3D primitive using a set of rules. It's not so simple as tacking on the z-coordinate to every list of two numbers. Sometimes your list of two numbers might not be a 2D point. So these rules must specifically target the bits which we know are coordinates. As a start we can transform ...


0

Possibly you are looking for something like LiveGraphics3D, a Java applet for interactive rotation of 3D graphics. Three different summaries: http://mathworld.wolfram.com/about/live.html http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/ http://reference.wolfram.com/webMathematica/tutorial/AppendixLiveGraphics.html


5

Considering the use of the old utility MakePolygons[] by Roman Maeder, as well as the year Hanson's paper appeared, I believe this was done during the time one still had to load a package to be able to use ParametricPlot3D[]. Since ParametricPlot3D[] has been built-in for quite a while now, please allow me to present a modernized plot of the Fermat surface ...


0

Would n't the simple egg-crate suffice? Plot3D[- Sin[x]^4 Sin[y]^4, {x, -3 Pi, 3 Pi }, {y, -2 Pi, 2 Pi }, PlotRange -> {-5, 5}, Mesh -> {80, 80}, Axes -> None, Boxed -> False, PlotStyle -> Yellow]


5

Confirmed. These have already been implemented, but did not make it in time for the 10.2 release. DiscretizeRegion should work, however.


10

Changing the rendering engine to BSPTree seems to help for me: SetOptions[$FrontEnd, RenderingOptions -> {"Graphics3DRenderingEngine" -> "BSPTree"}] Not sure if this is the best solution, but do try it out.


2

Using the above solution of user21 you might look at the StreamPlot as follows: Show[{ StreamPlot[ Evaluate[{D[Potential, x], D[Potential, y]} /. z -> 0], {x, -1, 1}, {y, -1, 1}] // Quiet, RegionPlot[RegionDifference[Rectangle[{-1, -1}, {1, 1}], Disk[]], PlotStyle -> Opacity[1]] }] yielding the following: Here the code ...


4

This works for me: R2 = Cylinder[{{0, 0, -0.1}, {0, 0, 0.1}}, 1]; DBC1 = {DirichletCondition[ u[x, y, z] == 0, (-1 <= x <= -0.8 \[And] Abs[y] <= 0.6 \[And] Abs[z] == 0.1)], DirichletCondition[ u[x, y, z] == 1, (0.8 <= x <= 1 \[And] Abs[y] <= 0.6 \[And] Abs[z] == 0.1)]}; Potential = NDSolveValue[{Laplacian[u[x, y, ...


2

pts = Table[{t, Sin[t]}, {t, 0, 2 \[Pi], \[Pi]/4}]; Graphics[{Arrow[BSplineCurve[pts]]}] For you then: z = 0.09; c = Table[{0.03 Sin[20 \[Phi]], \[Phi], 0.05}, {\[Phi], 0.8, 1.1, 0.01}]; d = RotationMatrix[\[Theta], {0, 0, 1}]; e = Graphics3D[{Arrowheads[0], Red, Arrow[BSplineCurve[ Table[c.d, {\[Theta], 0, 2 \[Pi], \[Pi]/15}]]]}]; a = ...


2

With[{n = 5}, Module[{ prob = Union[ Table[ PDF[MultinomialDistribution[n, {.5, .5}], {k, n - k}], {k, -1, n}]], max}, max = Max[prob]; Row[{ DiscretePlot3D[ PDF[MultinomialDistribution[n, {.5, .5}], {x, y}], {y, 0, n}, {x, 0, n}, AxesLabel -> (Style[#, 12, Bold] & /@ {"y", "x", ...


8

RegionMeasure chooses a method which is slow when exact non-rational coefficients are present. I will correct this for a future version. Thanks for pointing it out. In Mathematica 10 the example works fast with approximate coefficients. In[1]:= Timing@RegionMeasure@N@ RegionIntersection[ Tetrahedron[{{0, 0, Sqrt[3/2]}, {2/Sqrt[3], 0, ...


1

I figure out another way that allows you to compose the display graphics objects. This feature will probably satisfy some different requirement. If you want to control the display of a molecule, this answer could help. The idea is similar to the discussion above. Manipulate[ Column[{ Graphics3D[ MapThread[ If[ FreeQ[u, #2[[1]]], ...


4

Edit In my opinion, what is asked for is more easily done when the button graphics and the model graphics are kept in separate lists. Manipulate[ Column[{ Graphics3D[ MapIndexed[ If[FreeQ[u, models[[#2[[1]]]]], Button[#[[1]], AppendTo[u, models[[#2[[1]]]]]], Button[#[[1]], u = DeleteCases[u, models[[#2[[1]]]]]]] ...



Top 50 recent answers are included