Tag Info

Hot answers tagged

11

One very clean way to do this is via x3dom, which is a javascript framework for deploying the x3d standard. The library is well supported by modern browsers, and the output is an html file with a supporting archive of x3d files. It is generally very clean and fast, and it does not require any external plugins. The library can be called from the x3dom site or ...


8

topbottom = Graphics3D[{Opacity[.7], Polygon /@ {area1, area2}}]; sides = Graphics3D[{EdgeForm[], Opacity[.7], Polygon[Partition[Join @@ Transpose[{Join[area1, {First@area1}], Join[area2, {First@area2}]}], 3, 1]]}]; Show[topbottom, sides, ImageSize -> 600] Or, put everything in a single Graphics3D: Graphics3D[{Opacity[.7], Polygon ...


7

Here is an alternative to RegionPlot that potentially produces higher quality: it's based on Tube with varying radius, as I also used in this answer: With[ {a = 1, R = .7, n = 40, xMax = 1.5}, Manipulate[ Graphics3D[ GeometricTransformation[ {CapForm[None], {Opacity[.5], Pink, #, Cyan, GeometricTransformation[#, {{-1, 0, 0}, ...


6

I am answering my own question as I have discovered an undocumented Mathematica feature which does exactly what I wanted. While playing around with some plot options, I discovered that setting PlotTheme->"Monochrome" had precisely the effect that I wanted - it displayed only some of the edges of the box. So I started digging, and running ...


6

It think it is nice to know that with latest Computational Geometry it is very simple - just a an orthogonal RegionProduct. R2 = MeshRegion[area, Polygon[Range[Length[area]]]]; R3 = RegionProduct[R2, Line[{{0.}, {500.}}]]; Now you can for example: RegionMeasure[R3] or DiscretizeRegion[R3]


5

volume = Integrate[1, Element[{x, y, z}, ImplicitRegion[Abs[x] + Abs[y] + Abs[z] < 4, {x, y, z}]]] (*256/3*) ContourPlot3D[Abs[x] + Abs[y] + Abs[z] == 4, {x, -5, 5}, {y, -5, 5}, {z, -5, 5}]


4

You could simply use the function prism from my answer to How can this texture be inserted in the beginning and the end of cylinder?. The advantage is that it also allows you to add textures (optionally), and has vertex normals built in so that the shape appears smooth. Here it is just for fun: l = {{"Directional", Red, ImageScaled[{2, 2, 2}]}, ...


4

I found out that this is basically the same as @kguler's answer, but I want to mention that this can be easily functionized. Borrowing from this question, we can define something similar: Options[Extrude] = Join[ Options[Graphics3D], {Closed -> True, Capped -> True, Color -> Orange}]; Extrude[points_, {zmin_, zmax_}, opts : OptionsPattern[]] := ...


4

Here's an approach using ParametricPlot3D, in which spheres are plotted and then sliced off using the option RegionFunction. It's not clear to me how you intend to have the inner regions "blank" as they are occluded, but the options to Show let you vary the appearance. outerSphere[sphereCenter_: {0, 0, 0}, regionLimit_: 0.6, color_, opacity_] := Module[ ...


3

For the record, this can be solved by setting Exclusions -> None in Plot3D, which tells Mathematica not to exclude subregions of the domain that are associated with discontinuities. Generally, if you want that plot to look sharp, you will have to couple it with a largish number for MaxRecursions: Plot3D[E^-(x - Round[x])^2, {x, 0, 3}, {y, 0, 3}, ...


3

Mathematica doesn't actually render the graphics. It sends them to a system library that renders them. We can see this effect clearly by rendering glyphs: Image[Rasterize["0"], Magnification -> 16] Results in: Even though this letter should be entirely black, it has a variety of colors present in the magnified image. This is an effect of ...


2

Ok, I reproduced the crash ( v10/Linux). You have a huge amout of data almost all of which is out of the plot range. Try Select ing only the required points: xyz = N@ToExpression[Import["xyz.csv"]]; Length@xyz (* 150000 *) Length@Select[ xyz , 300 < #[[1]] < 600 & ] (* 117 *) Now this works. Style[Show[ ListPointPlot3D[Select[ xyz ...


2

The solution provided by @Edmund does not show the top (curved) face of the region. The following does: RegionPlot3D[z < Sqrt[x^2 + y^2 ] && y^2 - 2 y + x^2 < 0 && z > 0, {x, -1.5, 1.5}, {y, -.5, 2}, {z, 0, 2}, PlotPoints -> 100]


2

You can use the RegionFunction option on ContourPlot3D to only plot the cylinder above the plane and below the cone. ContourPlot3D[{y^2 - 2 y + x^2 == 0}, {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, RegionFunction -> Function[{x, y, z}, 0 <= z <= Sqrt[x^2 + y^2]]] Edit The above is correct, but the plot will look better if it is focused on the ...


2

You can always deploy your plot in the "CloudCDF" format. CloudDeploy[ ExportForm[ Plot3D[Abs[Gamma[x + I y]], {x, -4, 4}, {y, -3, 3}, PlotRange -> {0, 6}, Mesh -> None, ColorFunction -> "Rainbow", MaxRecursion -> 5, BoxRatios -> {4, 3, 3} ], "CloudCDF" ], Permissions -> "Public" ] ...


2

Another way with rectangular polygons on the sides: bottom = PadRight[area, {Automatic, 3}, 0]; top = PadRight[area, {Automatic, 3}, 400]; Graphics3D[{Opacity[0.7], EdgeForm[], Polygon[Join[ {bottom, top}, Join[ Partition[bottom, 2, 1, 1], RotateLeft@Reverse@Partition[top // Reverse, 2, 1, 1], 2] ]] } ]


2

A small addition from Mathematica v. 10 In his answer @Ivan has already nailed the most important part of the question, i.e. the formal representation of your region as an ImplicitRegion object: region = ImplicitRegion[Abs[x] + Abs[y] + Abs[z] < 4, {x, y, z}] I just wanted to add that, if you are on Mathematica 10 or newer, you can also use the ...


2

Maybe this will get you started. What's left is to use a 3D "locator" from the OP's linked question to connect a mouse click to setting the target of ViewVector. g = Graphics3D[ Table[{EdgeForm[Opacity[.3]], Opacity[.5], Hue[RandomReal[]], Cylinder[RandomReal[10, {2, 3}]]}, {5}]]; Manipulate[ Show[g, Graphics3D[{Sphere[target, 0.3]}], ...


2

As @Mr.Wizard pointed out, multiple interesting solutions to your problem have been proposed on this site. I just wanted to add an observation here. I realize that you did not say so explicitly, but I would think that many users would try some combination of ListPointPlot3D for this kind of task. However, it has been my impression when using the *3D list ...


2

This is not a full answer, but it, perhaps, deals with the hardest part: constructing a set of finite lines lying all in one plane, but not intersecting each other. appendLine[list_Symbol] := (list = RandomReal[10, {1, 2, 2}]) appendLine[list_List] := Module[{newline, test = True}, For[newline = RandomReal[10, {2, 2}], test, test = ! ...


2

As in my comment, I feel, it's cleaner to use Show[(Pick[HoldComplete[{regionPlot, contourPlot}], {{True, showQPlane}}])[[1]]] Additionaly I use SetDelayed in the definition of contourPlot to prevent evaluation at definition and HoldComplete makes sure that first Pick is run, and only then what's left is evaluated. [[1]] strips the result of Pick of the ...


1

data = {150, 148, 145, 144, 143, 80, -80, -81, -82, -83}; omega = Interpolation[data, InterpolationOrder -> 4]; omegaIntegrate := Integrate[omega[s], s]; Animate[Graphics3D[{Cuboid[{-20, -20, -1.01}, {20, 20, -1}], GeometricTransformation[{Green, Tube[{{0, 0, 0}, {0, 0, 0.15}}, {1.25, 0}], Cylinder[{{0, 0, 0}, {0, 0, 1}}, 1/4], Blue, ...


1

Graphics3D[ Table[ Translate[ Rotate[First@ChemicalData["Water", "MoleculePlot"], RandomReal[{0, \[Pi]}], {8, .5, 0}], {80 i, 160 RandomReal[{-1, 1}], 160 RandomReal[{-1, 1}]}], {i, 1, 20}] ]


1

This is a minimal example of how to do something like this: Manipulate[ plot1 = Graphics3D@Sphere[{0, 0, 0}, 1.3]; If[x, Print@"Calculating plot2"; plot2 = Graphics3D@Cylinder[]]; Show[{plot1, If[x, plot2, {}]}] , {{x, True}, {True, False}} ] Body of the Manipulate is inside Dynamic so if you want to be able to control what is sent to ...


1

Use Animate and define your curve.. Animate[Graphics3D[Sphere[{Sin[t], Cos[3 t], 0}, .1], PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}}], {t, 0, 2 Pi}]


1

As a cone (with a square base), the volume is one-third the base times the height: 1/3 * (4 Sqrt[2])^2 * 8. Another plot, based on the OP's coordinates: ConvexHullMesh@Join[4 IdentityMatrix[3], -4 IdentityMatrix[3]]


1

An alternate approach to calculating the volume Integrate[ Boole[Abs[x] + Abs[y] + Abs[z] < 4], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}, {z, -Infinity, Infinity}] 256/3


1

If you use Mathematica 10: plotrange = {{0, 1}, {0, 1}, {-1, 1}}; edges = Composition[ Part[#, {8, 7, 4, 6, 2, 10, 9, 5, 1, 3, 11, 12}] &, Delete[#, List /@ {1, 5, 6, 9, 11, 15}] &, MeshPrimitives[#, 1] &, BoundaryDiscretizeRegion, Apply[Cuboid], Transpose ][plotrange]; Show[ Plot3D[ Sin[Pi*x]*Sin[2 Pi*y], {x, 0, 1}, ...



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