Tag Info

Hot answers tagged

10

Using Composition I can apply RotationTransform, TranslationTransform , ShearingTransform one after the other. Graphics3D[{ Opacity[1] , Red , Arrow[{{0, 0, 0}, {1, 0, 0}}] , Green , Arrow[{{0, 0, 0}, {0, 1, 0}}] , Blue , Arrow[{{0, 0, 0}, {0, 0, 1}}] , Opacity[0.2] , GeometricTransformation[Cuboid[-{1, 1, 1}/4, {1, 1, 1}/4], ...


7

Here is how it works. If you have a volume in 3d it is essential, that you use connected component labeling in 3d so that components that are connected over layers stick together and get the same label. Lucky for us that MorphologicalComponents can do this. Let's create a test volume data = With[{init = RandomChoice[{0, 0, 1}, {10, 10}]}, NestList[ ...


6

You can set Texture before each polygon t = ImageResize[ExampleData@#, {100, 100}] & /@ ExampleData["ColorTexture"][[;; 6]]; vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, ...


6

Using ComponentMeasurements twice, on the original matrix m and on Transpose/@m we can get all Neighbors: mat = RandomInteger[{0, 1}, {3, 3, 3}]; m = Module[{i = 1}, mat /. 1 :> i++]; v = ComponentMeasurements[m, "Label"][[All, 1]] (*{1,2,3,4,5,6,7,8,9,10,11,12,13,14}*) vcoords = ComponentMeasurements[m, "Centroid"][[All, -1]] ...


4

Just wrap ParametricPlot3D with Normal. The problem is that Mathematica starting from version 6 introduces more advanced data type GraphicsComplex. Normal converts to good old Graphics3D. Michael Trott's "Mathematica Guidebook for Graphics" was written for version 5. polys = Cases[ Normal[ ParametricPlot3D[#1, Evaluate[Sequence @@ #2], PlotPoints -> ...


1

My output looks a little bit different sphere = {Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}; MeanCurvature[f_] := With[{du = D[f, u], dv = D[f, v]}, Simplify[(Det[{D[du, u], du, dv}] * dv.dv - 2 Det[{D[f, u, v], du, dv}] * du.dv + Det[{D[dv, v], du, dv}] * du.du) / (2 Simplify[(du.du * dv.dv - (du.dv)^2)]^(3/2))]]; mean = ...



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