New answers tagged mesh
6
What about this:
Import["ExampleData/wrench.obj.gz", "PolygonObjects"] // Graphics3D
You can use the FaceForm[None] trick as shown by @J.M. here just as well if you only want the wireframe looks.
7
At OP's behest:
The easiest approach to see the mesh lines is to remove the EdgeForm[] instruction that causes them not to appear. For instance,
DeleteCases[Import["ExampleData/wrench.obj.gz"], _EdgeForm, ∞]
As SEngstrom suggests, you can also use a replacement rule. If, for instance, you want a thick gray mesh, here's what you can do:
...
5
If you don't mind using undocumented functions, you can do it like this:
Graphics`Mesh`MeshInit[];
mesh = DensityPlot[4 Sin[2 Pi x] Cos[1.5 Pi y] (1 - x^2) (1 - y) y, {x, -1, 1}, {y, 0, 1},
Method -> {"ReturnMeshObject" -> True}];
Graph[mesh["Edges"], VertexCoordinates -> mesh["Coordinates"],
VertexShapeFunction -> (Point[#] &)]
3
My modest attempt:
dp = DensityPlot[4 Sin[2 Pi x] Cos[3 Pi y/2] (1 - x^2) (1 - y) y,
{x, -1, 1}, {y, 0, 1}, Mesh -> All]
{verts, edgs} = List @@ MapAt[Composition[Union, Flatten],
(Most[MapAt[Flatten[Cases[#, _Polygon, ∞]] &,
First[Cases[dp, _GraphicsComplex, ∞]], {2}]] /.
Polygon[p : ...
7
This will do
densPlot =
DensityPlot[
4 Sin[2 Pi x] Cos[1.5 Pi y] (1 - x^2) (1 - y) y, {x, -1, 1}, {y, 0,
1}, MeshStyle -> Thick, Mesh -> All];
vertexCoordinates = densPlot[[1, 1]];
length = Length[vertexCoordinates];
graphReadyConnections =
DeleteDuplicates@
Flatten[
Cases[#,
List[x_, y_, z_] :> {Sort[x ...
Top 50 recent answers are included