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.

Filter by
Sorted by
Tagged with
8
votes
2answers
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: ...
8
votes
2answers
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.
8
votes
1answer
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 ...
8
votes
2answers
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: ...
8
votes
3answers
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 ...
8
votes
2answers
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: ...
8
votes
2answers
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 ...
8
votes
1answer
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 ...
8
votes
1answer
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 <...
8
votes
1answer
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 ...
8
votes
1answer
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:" <...
8
votes
1answer
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 ...
8
votes
0answers
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 ...
7
votes
2answers
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 ...
7
votes
4answers
348 views

Recalculate line coodinates

I have the following line: ...
7
votes
2answers
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 ...
7
votes
3answers
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 ...
7
votes
2answers
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. ...
7
votes
2answers
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 ...
7
votes
3answers
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 ...
7
votes
3answers
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 ...
7
votes
3answers
268 views

Problems with ImplictRegion

Through code: ...
7
votes
2answers
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 ...
7
votes
2answers
144 views

MomentOfInertia for Polyhedra incorrectly computed?

The moment of inertia for Regions seems to be wrongly calculated. Simple example: ...
7
votes
2answers
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: ...
7
votes
1answer
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, ...
7
votes
1answer
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 ...
7
votes
2answers
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 ...
7
votes
1answer
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 ...
7
votes
1answer
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: ...
7
votes
2answers
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 <...
7
votes
1answer
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 ...
7
votes
1answer
186 views

Getting random points on a mesh region

So I have a region defined by a MeshRegion,like ...
7
votes
3answers
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 ...
7
votes
2answers
155 views

DiscretizeGraphics issues with transformations

I noticed DiscretizeGraphics does not work correctly with transformed Graphics such as ...
7
votes
2answers
374 views

MeshRefinementFunction missing points

I'm doing some FEM on a rectangular region with a spherical cavity: ...
7
votes
1answer
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 ...
7
votes
1answer
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 ...
6
votes
2answers
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: ...
6
votes
3answers
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 ...
6
votes
3answers
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 ...
6
votes
5answers
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 ...
6
votes
2answers
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,...
6
votes
3answers
123 views

Sometimes Region can't build right region

During my work with NDSolveFEM I found strange behavior of function Region. ...
6
votes
2answers
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 ...
6
votes
2answers
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. ...
6
votes
1answer
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? ...
6
votes
1answer
366 views
6
votes
1answer
152 views

Given a cell in a Voronoi diagram, which point did it come from? [duplicate]

Given a set of points pts = Table[{RandomReal[], RandomReal[]}, {i, 1, 10}]; and their Voronoi diagram ...
6
votes
2answers
150 views

Inconsistent mesh generation from BoundaryDiscretizeRegion and ToBoundaryMesh at creases

I'm trying to use BoundaryDiscretizeRegion and/or ToBoundaryMesh to generate polygonal models for 3d printing, but I'm having ...