# Questions tagged [mesh]

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

736 questions
Filter by
Sorted by
Tagged with
1 vote
27 views

### How to create an ElementMesh with at least two triangle elements at each corner?

Based on this simple example of a triangle mesh ...
1 vote
48 views

### RegionUnion looses MeshRegion's Markers

The following code shows the prescripted MeshCellMarkers 1 and 2 as expected : ...
• 17.2k
247 views

### Fast Segmentation

Imagine I have an image of a segmented tissue as follows what is the fastest way of converting such an image into a mesh-type object in Mathematica? I am familiar with ...
• 4,250
103 views

### Steady state heat equation/Laplace's equation special geometry

I would like to solve the Laplace's equation in between the square domain and a disk. However, using the code below, I was able to generate mesh but not able to obtain results with correct boundary ...
• 63
87 views

### RegionIntersection extremely slow before throwing error

I am dealing with polygons admitted by using other region functions (like RegionDifference), some of which have insidious problems. Consider those below; ...
• 1,113
29 views

### Crash when repeatedly calling RegionIntersection (and/or Mesh functions)

My kernel (v13.1.0 Windows 64-bit) crashes when repeatedly (~9 times) calling Region functions like RegionIntersection upon ...
• 1,113
107 views

### 3D FEM - How to define Point-Markers for an ElementMesh object created with ElementMeshRegionProduct

I want to create a 3D grid based on a 2D mesh, on the surface of which I want to assign point-marker for certain regions. The mesh created in the sample code is a fluidic Y-structure, at whose inputs (...
• 31
158 views

### Region between finite lines or extracting a finite tesselation

EDIT2 the answers here (How to compute intersections of circles on a lattice) seem like they could help or solve the problem. EDIT: I saw this question about finding regions between lines before I ...
• 3,397
1 vote
150 views

### Unify Polyhedrons into a single Polyhedron

Consider these two simple Polyhedrons which share a sub-face: ...
• 1,113
137 views

### Packing triangles into a rectangle

I'm working on packing a set of triangles into a rectangle but I'm unable to get them to pack dense enough or even touch. I found a post from 3 years ago called "Packing arbitrary shapes" ...
183 views

### What's wrong with Volume[] of 3D-DelaunyMesh?

For a DelaunayMesh of a set of points ...
86 views

### Can't verify MomentOfInertia of a MeshRegion

In this simple modified(thanks @DanielHuber) example I create a volumemesh of a region ...
45 views

### Volume-mesh of a closed Surface-Region?

For an examplary given surface mesh (example from documentation DiscretizeRegion ) ...
1 vote
75 views

### How to find the regions corresponding to a given data set?

I have a data set corresponding to some problem. The data set is just a numerical sampling of $(x,y,z)$ where a particular formula is valid( this thing is analytically intractable that's why I ...
• 177
90 views

...
• 8,389
88 views

...
• 8,389
66 views

### Bug of RandomPoint or Bug of Region?

Mathematica 13.1 on Mac In the help page of RandomPoint, it says: RandomPoint can generate random points for any RegionQ region that is also ConstantRegionQ. The data of mesh is here ...
• 8,389
102 views

### Pattern not matching BoundaryMeshRegion

Mathematica 13.1 on Windows 10. Can someone explain why the following does not match: MatchQ[BoundaryMeshRegion[Cube[]], BoundaryMeshRegion[__]] (* False *)
• 32.4k
1 vote
45 views

### Draw Meshlines for specific z-coordinate and where x==y

I want to draw a Meshline where x==y and where z==4. The following code does neither. (The x==y line is horribly jagged and the ...
• 1,182
98 views

### Create a domain for an Hexahedron with the floor replaced with an Indian Burial Mound

I am trying to create an acoustic model domain for a small park that contains an Indian burial mound. The park is laid out using a 3D cartesian coordinate system in units of meters. A Hexahedron ...
• 2,147
88 views

...
• 8,389
92 views

### Why BoundingRegion so weak in such cases?

Each time, when I use FastCylinder option in BoundingRegion, I'll get this kind result. This problem lasts for many years, since ...
• 8,389
230 views

### How to get the cross sectional area of a wine bottle picture/photo by doing an appropiate image processing on it?

We are working on a PDE Acoustic model in which the geometry of analysis is the cross-sectional area of a wine bottle. We want to get the geometry from a wine bottle image by doing an appropriate ...
124 views

### Select part of an ElementMesh

modified For an, examplary simple, ElementMesh ...
1 vote
66 views

### Building a structure out of cubes one block at a time

I have simplified code in which the motion of a point charge is simulated N times (one particle at a time) in a static electric field. When the point charge comes to rest (using WhenEvent boundary ...
• 363
166 views

### BoundaryMeshRegion Error: Boundary surface is not closed

I am trying to create a BoundaryMeshRegion comprised of many cubes with random locations, in a relatively small region. I have had success implementing my technique for a smaller number of cubes (say,...
• 363
114 views

### How to import and render this OBJ file with correct texture?

Here's the output of a 3D scan of a bike, I need to render it in color with the texture file provided. Here are the files: ...
• 30.9k
332 views

### How to reconstruct 3d meshes from 2d images of a scene?

The new ImageStitch was nice functionality added in v13, but is there anything available for constructing meshes (with color textures) from a bag of 2D images (...
• 30.9k
231 views

### Extract 2D quad mesh from 3D hexahedral mesh

I would like to extract 2D mesh of outer surface of 3D meshed object. Let's say I have 3D mesh data from here and I import the data into Mathematica. ...
• 579
130 views

### How to refine FEM mesh for steady state 1D problem?

I am solving a system of 3 steady state 1D ODEs, however the system consists of component that has sharp changes at x = 1, which is very hard to capture. Is there a way to specifically increase the ...
• 181
85 views

### 3D Mesh refinement near sphere boundary and on surface revolutions

I am trying to solve an advection-diffusion problem inside surface of revolutions. I have high velocity gradients near the boundary of the bounding surface. Is there a way to refine the mesh near the ...
• 75
87 views

### Error Meshing with ToElementMesh (ToElementMesh: Cannot set region holes.) for certain objects

I have had a problem properly meshing certain .obj files, where others are meshed successfully. Here is an example of a successfully meshed .obj: Whereas, using the code at the bottom which includes ...
• 363
65 views

### RegionDifference Fails at Two Simple Cubes

Or, maybe, I just dont get it right. I got two simple mesh cubes: ...
• 303
75 views

### Keeping mesh coordinates unchanged for Implict Region [duplicate]

I am trying to generate a 3D mesh for Finite Element simulations. I need to provide some precomputed inputs to the mesh points and will like my mesh to be the same for a given shape. However, ...
• 75
127 views

### Finding sub-regions in an STL file for Finite Element

I use an external software (Amira) to segment X-ray tomography images and then create a surface mesh which I can then import into Mathematica as an STL file. This file has two enclosed regions, ...
• 3,660
106 views

### Finite Element NDSolve with input data at node points

I am trying to solve a steady-state advection-diffusion problem of the following form: $-D \nabla^2 T + \nabla \cdot (\mathbf{u} T) = -1$. I will be solving this problem in a 3D geometry (typically ...
• 75
65 views

...
• 23
187 views

### Generating a non-convex polyhedron from polygons and normals

I am working on developing "directional offset" module, which requires pretty tricky mesh generation: offset values vary in different directions. Suppose I have list of points and polygons, ...
• 303
1 vote
194 views

### Properly Updating Particle Motion in 3D Electric Field Simulation

I have a code (very bottom of post) which plots a static electric field as it passed through some metal sheet with an aperture in it. I seek to observe the motion of some N charged particles (point ...
• 363
60 views

### 3D Parametric Plotting for N Charged Particles in a Nonuniform Electric Field

I have a code (very bottom of post) which plots a static electric field as it passed through some metal sheet with an aperture in it. I seek to observe the motion of some N charged particles (point ...
• 363
62 views

### Meshing Error on Imported obj file

I am trying to import a .obj file to be used in a static electric field simulation. I am able to successfully run the simulation with certain other aperture geometries (see here: < https://www....
• 363
247 views

### Coarse mesh of a sphere

I try to mesh a sphere (examplary) in different qualities, using MaxCellMeasure: ...
213 views

### Finding Mesh Cell Normals

I need to find a normal pointing outside for every face / cell of a closed Mesh Region. How can I do this? Here's what I have now - mesh + mesh cells centers and I'm stuck and puzzled. There's ...
• 303
103 views

### Defining Dirichlet Boundary Conditions on an Imported 3D Object with Apertures in it

I am trying to simulate a static electric field (in 2d and 3d) as it passes through a couple of apertures in a 3D "metal sheet" (model imported as a .obj file) given here: https://www....
• 363
1 vote
42 views

### Meaning of MeshCells for CantorMesh?

Let cantor2 = CantorMesh[2] As expected: RegionBounds[cantor2] (* {{0., 1.}} *) And as expected: ...
• 11.6k
73 views

### Difference between a region and its convex hull

I have a volume enclosing a certain region. The region is non-convex, and I calculate its convex hull with the built-in Mathematica function. I want to know the difference between the region and its ...
• 125
101 views

### Is it possible to solve a differential equation with a user-defined variable mesh in NDSolve?

For some differential equations, its solution may evolve to a cusp, for example, singular behavior. One may want to introduce additional mesh points near the cusp to accurately follow the solution ...
359 views

### How to generate a mesh in an area with curves inside

I would like to know how to generate a mesh inside an area, and be able to find the original curve outline inside the area from the mesh. For example: There is a rectangle inside which there is a ...
• 83