New answers tagged

3

I suspect that the cells closest to the $z$ axis in your region did not get optimized because their volume was simply too small to trigger the mesh refinement function: the solid is so thin in the vicinity of the $z$ axis, and its thickness is changing so rapidly, that any constant volume requirement small enough not to trigger the generation of thousands of ...


3

NOT A ANSWER Once corrected, your code gives the following with Mathematica 10.3.1 (on the "Wolfram Development PlatForm") It looks like a little bit better than what you obtain. EDIT I can't investigate further : my code crashes on the "Wolfram Development Platform"


9

The approach I would take is the following: Clear definitions, load a sample image, find corners in the image using the method you indicated in the OP: Clear[img, points, dm, cells, nerve, nervenucleus] img = ExampleData[{"TestImage", "Aerial2"}]; points = ImageCorners[img, MaxFeatures -> 200]; Generate a Delaunay mesh from those points: dm = ...


5

Finding the points which correspond to the Voronoi cells with maximum number of neighboring cells is easy by sorting the VertexDegree on underlying DelanunayMesh. Lets find the indexes of the pts with maximum vertex degree which assures that they will be surrounded by most number of Voronoi cells. pts = RandomReal[{-1, 1}, {250, 2}]; Vmesh = ...


4

Here are the points at the centers of the Voronoi cells: myCenters = RandomReal[1, {100, 2}]; This creates a DelanunayMesh of the center points, i.e., the graph linking centers that is mathematically dual to the Voronoi cell representation: myDelaunayMesh = DelaunayMesh[myCenters]; This extracts the links that include the most surrounded point: ...


3

Perhaps this example could be helpful: pts = RandomReal[1, {10, 2}]; ch = VoronoiMesh[pts]; mp = MeshPrimitives[ch, 2]; ml = MeshPrimitives[ch, 1]; mpt = MeshPrimitives[ch, 0]; Graphics[Riffle[RandomColor[Length@mp], mp]~Join~{Red, Thick, ##} & @@ ml~Join~{Blue, PointSize[0.02], ##} & @@ mpt]


1

In my opinion the easy way to plot vectors over 1D curve is to used VectorPoints option: points = Table[{i, 1}, {i, 0, 1, .1}]; VectorPlot[{Sin[x], Cos[y]}, {x, 0, 1}, {y, -1, 2}, VectorPoints -> points, VectorScale -> {0.1, .2}, Epilog -> Point[points]]


2

Well, here's a way that works when the number of seconds since Jan. 1, 1970 is odd (that is, it crashes the kernel every other time I execute it): reg = MeshRegion[{{0, 1}, {1, 1.001}}, Line[{1, 2}]]; points = MeshCoordinates@ DiscretizeRegion[reg, MaxCellMeasure -> {"Length" -> 0.1}]; vf = Table[{p, {Sin[x], Cos[y]} /. Thread[{x, y} -> p]}, {p, ...


4

I don't know how to make this with RegionFunctions but you could show the vectors along the Line[{{0, 1}, {1, 1}}] like this: VectorPlot[{Sin[x], Cos[y]}, {x, 0, 1}, {y, 0.5, 1.5}, AspectRatio -> 1/5, FrameTicks -> {True, {0.95, 1, 1.05}, False, False}, GridLines -> {None, {1}}, GridLinesStyle -> {Blue, Dashed}, PlotRange -> {Automatic, ...



Top 50 recent answers are included