The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [mesh]

Questions on the use and creation of meshes including the use of MeshRegion, ElementMesh, and TetGenLink.

425 questions
Filter by
Sorted by
Tagged with
369 views

How to assign Element marker at boundary edges

How to assign marker at the boundary edges as 1, 2, 3, 4 respectively and set all of the inside elements of region as 0? for example: Code: ...
870 views

Finding concave hull for separated small clusters

Data : data3D = Import[file, "VertexData"]; Graphics3D[Point[data3D]] How to find concave polygon for separated small clusters.
282 views

How to mesh part of sphere

A quite arbitrarily closed curve k[φ](on the sphere) defines two parts of a sphere. How can I mesh for example the smaller surface part? I intend to use the mesh ...
837 views

How to color the triangles of a mesh?

Given a mesh, I want to assign each triangle a color. I tried to do it in this way: ...
347 views

How to find ids in a curved line in a finite element mesh?

Previous discussion about this problem has already occurred in this link: How to get the node id in a specific coordinate in a finite element mesh? I have the following code that generates a finite ...
252 views

How to create a mesh of convex polygons (of maximal size) from a boundary mesh region

I can create a boundary mesh region that consists of a rectangular region with two independently-rotated pentagonal regions excluded using the following code: ...
643 views

How do I get ConvexHullMesh to return polygons instead of triangle as surface mesh?

I would need to identify the types of regular polygons forming the surface of a convex hull of 3D points. If I e.g. take the following example of a regular polyhedron ...
272 views

Can I trust area calculations over discrete MeshRegions? Flipped triangles, possible visual bug

The following code produces a MeshRegion in two different ways. Unfortunately, the first method produces weird artifacts in ...
205 views

FEM-ception: Using output of NDSolve FEM as input in another FEM problem

After having solved a Stokes flow problem in Mathematica on a subdomain RegionCapillary, I would like to solve an advection-diffusion problem on a larger domain <...
134 views

Make polygons visible in MeshRegions in v11, as they were in v10

In versions 10.x, polygons in mesh regions were clearly outlines: In version 11.0 they aren't by default. How do I get back the v10 display so I can see where my polygons are, even in flat faces ...
189 views

ParametricPlot MeshStyle bug in v10?

Bug introduced in 10.0.1 or earlier and fixed in 10.0.2.0 Original Post The documentation gives the following code and says "Use a red mesh in the x direction and a blue mesh in the y direction:" <...
528 views

ListContourPlot3D doesn't use all points

Edited thanks to @Kuba: In the following example, ListContourPlot3D accepts an array of points spaced at intervals 0.1 apart throughout the volume, but seems to choose an arbitrary number of points ...
407 views

FEM Mesh for pipes and tubes

I work with pipe systems and would like to use finite elements within NDSolve for regions inside or exterior to a pipe. How to do I make a mesh of the region ...
2k views

How can I mesh a solid cylinder with triangular or tetrahedral elements

I need to plot triangular mesh on a cylinder. However the function Cylinder doesn't have a Mesh option. By using ...
348 views

Recalculate line coodinates

I have the following line: ...
194 views

Reflection colors are lost on high resolution MeshRegion

Mathematica is able to manage two kinds of reflections : With a simple color directive (Blue, RBGColor[...]...), one can ...
363 views

Can one use MeshRefinementFunction to obtain a nonobtuse triangulation?

I have a planar convex polygonal region Rc. I would like to triangulate it such that every triangle is nonobtuse. I was hoping that the ...
257 views

Meshing a cylindrical geometry with a notch

I have been trying to mesh a cylindrical geometry with a notch. To generate the geometry i use the following command. ...
272 views

Contourplots on discrete surfaces

Does anyone know how one can plot contour lines on a meshed surface? For example I would like to be able to plot contour lines indicating lines of equal distance from a given point such as data coming ...
243 views

Visualising Finite Element Mesh in 3D with MeshRefinementFunction

How do you check that a MeshRefinementFunction is doing what you want in a 3D mesh where you only see the boundary mesh? I started by making a block with a hole as ...
299 views

How to Discretize the Following Region Using Reasonable Bounds?

I want to accurately discretize the implicit equation $x^2+x+y^2+\sin(4xy)+\sin(3xy)=3.9$. To get the whole discretized shape, I'm forced to use oversized bounds ...
268 views

Problems with ImplictRegion

Through code: ...
225 views

ToElementMesh ignores Boundaries and MeshRefinemet

I'm building a mesh of a pit storage in Mathematica which I then export to another FEM-software. I follow the workflow for creating a ElementMesh from the documentation, but it won't work in the way ...
144 views

MomentOfInertia for Polyhedra incorrectly computed?

The moment of inertia for Regions seems to be wrongly calculated. Simple example: ...
952 views

How to show wireframes on imported Object / Mesh (.obj file)

I've managed to import a Wavefront (.obj) file and store it in a variable like so: ...
512 views

Making a 2D hexagonal mesh

There are a lot of answers for how to make a hexagonal mesh on a 3D surface but nothing on how to make a hexagonal mesh on a 2D surface. Can any provide code on how to do so? I am new to mathematica, ...
517 views

How do I get a MeshRegion from an obj file, or from Geometry3D

How do I read in an obj file as a MeshRegion so I can e.g. compute its area? If I just import the object and try Area[O] it ...
390 views

Mesh at Ticks positions

In a ListPlot3D[ ] I want to have the Mesh at the same positions as the ticks. For some reason this isn't default if both are ...
179 views

How can I upload MeshRegions to Mathematica.SE?

I know how to upload images to Mathematica.StackExchange. But what about MeshRegions? That's something I'd like to do frequently. Best would also be a programmatic ...
193 views

Meshing a thin tube

I'd like to mesh a thin tube. The following gives a strange result when thickness becomes too small: ...
223 views

Poor/wrong sampling in 1D DiscretizeRegion of splines?

Bug introduced in 10.1 and persisting through 10.2 or later and Fixed in 11.3 Context In relation to this question I have would like to use splines to define a <...
883 views

Meshing the surface of a non-convex object

I would like to mesh the surface of a cloud of points that may not be completely convex, for example the points in this question. Mathematica does not provide triangulation of 3D points, but there is ...
186 views

Getting random points on a mesh region

So I have a region defined by a MeshRegion,like ...
177 views

Creating MeshRegions of various 2D lattices

This is a soft question about the best approach to design a function that creates MeshRegion objects of various 2D lattices, e.g. kagome or hexagonal, all through ...
155 views

DiscretizeGraphics issues with transformations

I noticed DiscretizeGraphics does not work correctly with transformed Graphics such as ...
374 views

MeshRefinementFunction missing points

I'm doing some FEM on a rectangular region with a spherical cavity: ...
591 views

how to create a FEM mesh with “RegionPlot” where the sample points are a function of the position

I need to resolve the diffusion equation in a domain with circular sources (holes). I've tried defining the whole region with holes but the result is very mesh-dependent and not symmetric, so at the ...
257 views

A serious bug in mathematica 11.2 during meshing in FEM modul

I realised that in the new version of mathematica (11.2.) there is a problem with boundary meshing. If I set the MeshOrder=2 the meshing procedure doesn't recognise the boundary elements between two ...
657 views

Color code Voronoi cell areas depending on number of vertices

The following question is similar to Colouring points in a Delaunay Mesh by the number of nearest neighbours ... but I do not know how adapt this answer to my problem. I have the following image: ...
448 views

Compare FEM mesh with the mesh created within Mathematica

This is a follow-up question to an earlier question: Make uniform mesh with quad elements Question: How to solve system of equations with NDsolve on the mesh created in Ansys in order to compare it ...
606 views

Volumes and moments of inertia of meshes in 3D

I came across puzzling results for certain 3D meshes, which I reduced to a minimal case. I made a 1-2-3 cuboid in Blender, exported it to this OBJ file, then ...
606 views

Colouring points in a Delaunay Mesh by the number of nearest neighbours

I apologise if this is a repeated question, but I've searched for a while and can't find anything. I'm doing some molecular dynamics simulations using Mathematica 10, and I've placed a ...
194 views

Extracting points from 3D plot that lie along an arbitrarily oriented line

Starting from i.e. the following 3d plot: d = RandomReal[1, {100, 3}]; ListPlot3D[d] Is it possible to extract points that lay along an arbitrarily oriented line,...
123 views

Sometimes Region can't build right region

During my work with NDSolveFEM I found strange behavior of function Region. ...
291 views

Automatically generating boundary meshes for region intersections

I am trying to solve a PDE having different coefficients in different regions. I have been having trouble getting Mathematica to do it automatically, so I have gone down the route of creating my own ...
250 views

Assigning Element Markers to 3D FEM Mesh

I have created a 3D graphic using GraphicsComplex and then use ToElementMesh to generate a 3D Mesh that I want to solve a PDE on, but I cannot figure out how to apply ElementMarkers to the Boundaries. ...
137 views

Efficient way to get adjacency information from MeshRegion

What is the most efficient way to get adjacency information from a MeshRegion, i.e. some efficient representation of which vertex is connected to which other one? ...
366 views

...