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
52 votes
2 answers
2k views

A geometric multigrid solver for Mathematica?

Cross posted to community.wolfram.com Mathematica ships a variety of linear solvers through the interface LinearSolve[A, b, Method -> method] the most ...
user avatar
41 votes
4 answers
7k views

Creating a 2D meshing algorithm in Mathematica

As what is proving to be a difficult, but entertaining task, I am attempting to adapt a 2D meshing algorithm created for MATLAB and port it to Mathematica. I understand meshing functions already exist ...
user avatar
  • 3,296
36 votes
1 answer
1k views

How to perform Loop subdivision on a triangle mesh with Mathematica?

(Cross posted on Wolfram Community) Every now and then, the question pops up how a given geometric mesh (e.g. a MeshRegion) can be refined to produce a (i) finer ...
user avatar
32 votes
7 answers
4k views

How to generate a mesh with quadrilateral elements?

I have the following code that generates a finite element mesh: ...
user avatar
  • 2,780
29 votes
2 answers
1k views

Smoothing 3D contours as post processing

Context Following this question (and great answer!), It would be nice to have a function which also smooths 3D contours plots once they have been done. There are various solutions which involve ...
user avatar
  • 21.8k
25 votes
3 answers
2k views

Convert binary voxel image to geometric region

I have a binary voxel image which described a contiguous region in space. Example: ...
user avatar
  • 227k
24 votes
3 answers
4k views

Removing unwanted appearance of underlying mesh

Let us first define two positive definite matrices: M1 = {{2, -6}, {4, 8}}; M2 = {{2, 3}, {4, 8}}; then set two points ...
user avatar
  • 1,821
24 votes
1 answer
859 views

Mismatch between Mathematica and COMSOL in 3D FEM problem

I would like to solve an advection-diffusion problem on a torus domain. There are three Dirichlet conditions: One at the inlet (concentration $c=0$), one at the outlet ($c=0.5$) and one at the wall ($...
user avatar
23 votes
4 answers
739 views

Making holes from maze generated Graphics3D

...
user avatar
  • 487
23 votes
3 answers
4k views

Finding a Concave Hull

I have 3D clustered data: Is there any other way to get the concave hull of 3D data points?
user avatar
23 votes
2 answers
1k views

How can the {x,y,z} points that fall on the outer boundary of a set of values be selected and smoothly surfaced?

For a given set of x,y,z values, that may, or may not form a uniform shape, how can the center of the data cloud be found, and the surface points be located and a solid smooth surface created from ...
user avatar
  • 4,376
22 votes
6 answers
2k views

How to obtain the cell-adjacency graph of a mesh?

In addition to the accepted answer, see also the answer by Chip Hurst. This functionality is built in, but not documented. Given an arbitrary mesh region, how can I efficiently obtain the graph ...
user avatar
  • 227k
21 votes
3 answers
2k views

Build a refined grid based on intersecting line

I honestly have no idea where to begin with this problem. In summary, I have a 2D coarse grid with an intersecting line. For an easy example, let's assume it's a 4x4 grid. I wish to pass through each ...
user avatar
  • 10.6k
21 votes
1 answer
1k views

How to access FEM shape functions

A couple of days ago I asked here about surface meshes and plotting on surfaces. Now I have another question: How can I access the surface or boundary element shape functions? I would like to ...
user avatar
  • 923
21 votes
1 answer
1k views

Eigenfunctions of the Laplacian on an arbitrary mesh

So, I've constructed a mesh over which I'd like to find eigenfunctions of Laplace's equation with a free boundary (a zero Neumann boundary condition along the edge). Mostly because I figured an ...
user avatar
20 votes
3 answers
844 views

How to get a specified number of points that are nearly equally spaced in a closed rectangle

TriangulateMesh is almost the right tool for this problem. For example, ...
user avatar
  • 6,760
20 votes
2 answers
2k views

DelaunayMesh in a specified closed region - creating a concave hull from a set of points

I have a list of discrete points wich I want to use as nodes for creating a 2D mesh. I used DelaunayMesh and it works fine. The problem that I have is that some elements/polygons are outside of the ...
user avatar
  • 201
19 votes
3 answers
954 views

Crop a Voronoi diagram and get a proper MeshRegion

How can I crop a VoronoiMesh (or any similar MeshRegion) to a non-rectangular region and receive the output as a ...
user avatar
  • 227k
19 votes
2 answers
3k views

Estimating Principal Curvature Directions on Discrete Surfaces

I am continuing with working on implementing curvature estimations on triangulated surfaces (See: here), using the algorithm of : Meyer, M., Desbrun, M., Schröder, P., & Barr, A. H. (2003). ...
user avatar
  • 3,606
18 votes
3 answers
745 views

Computing the surface area and volume of molecules

Here is a somewhat difficult problem I've had for a long while. Space-filling models of molecules can be easily generated by ChemicalData[], ...
user avatar
18 votes
0 answers
2k views

Using TetGen in Mathematica to get 3D Voronoi diagram

In this post, the use of TetGen for 3D Voronoi tesselation has been briefly discussed. However there is still no info about the use of TetGen to generate a 3D Voronoi diagram. The TetGen documentation ...
user avatar
  • 2,751
17 votes
3 answers
10k views

Create triangular mesh from random list of points

I have a list of points. I would like to take these points and create a mesh of triangles from them, making sure triangles don't overlap. So here's a list of points: ...
user avatar
  • 3,296
17 votes
2 answers
1k views

Smoother jelly / water effect on an image

I'm trying to achieve a jelly / water surface effect. I'd like it to be a bit smoother. Here I am taking a triangulated rectangle and perturbing all points by a little random noise for each frame. ...
user avatar
  • 20.5k
17 votes
3 answers
2k views

How to convert a surface into a solid

Context I am interested in converting surfaces into solids (so I can make a 3D mesh out of them using ToElementMesh) Say I have the following cool surface ...
user avatar
  • 21.8k
17 votes
4 answers
4k views

How to get actual triangles from DelaunayTriangulation[]?

The ComputationalGeometry package has a DelaunayTriangulation[] function. It returns a list of points connected to each point, ...
user avatar
  • 227k
17 votes
1 answer
622 views

Making a graph or network interactively over an image

Given an image, is it possible to manually draw a graph over it? For example, taking the following image: I want to manually pick the vertices and draw the edges in a "Paint-like" manner to get, for ...
user avatar
  • 4,358
16 votes
2 answers
739 views

Voronoi tessellations on meshed surfaces

Given a meshed surface, on which we can calculate geodesic distances between vertices, how can one calculate the Voronoi tessellation of a set of points located on this surface? This is somewhat ...
user avatar
  • 3,606
16 votes
2 answers
542 views

3D Inclusion with structured mesh and coarse and arbitrary matrix

I am wondering if there is a simple way to define a structured 3D mesh (inclusion) like e.g. that and surround it with a corse and unstructured Matrix. It should be possible to refine both more or ...
user avatar
  • 624
16 votes
2 answers
883 views

How to mesh a region using adaptive cubic elements

Assume a list of {x,y,z} coordinates. The coordinates are arranged in a regular fashion through a fixed raster size (called ...
user avatar
  • 975
16 votes
1 answer
1k views

Is it possible to re-mesh, downsample & upsample a DiscretizeRegion object?

In my project, I am importing a complex geometry from an STL file into Mathematica as a MeshRegion. I would like to edit this mesh significantly: For instance, drastically reduce or increase the ...
user avatar
16 votes
1 answer
332 views

Possible Bug in ArrayMesh

Bug introduced in V10.4 and fixed in 10.4.1 Suppose we have the following array from which we intend to create an ArrayMesh: ...
user avatar
  • 32.5k
16 votes
1 answer
456 views

Possible bug in RegionUnion or related functions?

Bug introduced in 11.2.0 Functions for derived geometric regions (RegionUnion and related) have been significantly updated in MMA 11.2 and now this simple example ...
user avatar
  • 6,403
15 votes
4 answers
2k views

Dashed mesh behind 3D object

I am trying to create a simple, almost transparent 3D sphere with a mesh that is made of solid lines if they are on the front surface (i.e. if they are directly visible) and of dashed lines if those ...
user avatar
  • 2,439
15 votes
3 answers
629 views

VoronoiMesh as a TogglerBar

Is it possible to use a VoronoiMesh to define a TogglerBar or SetterBar type ...
user avatar
  • 4,358
15 votes
2 answers
638 views

VoronoiMesh without edges

How can I remove the edges of a VoronoiMesh? I would like to display only the closed cells not touching the border of the image. This is my binarized source image (imgbw): I am doing this: ...
user avatar
  • 11.3k
15 votes
1 answer
1k views

Hexagonal Mesh on a 3D surface

I am new to Mathematica, and I am trying to create a 3D hexagonal mesh on a 3D surface. It is very similar to what was done in this post Create a torus with a hexagonal mesh for 3D-printing, but now ...
user avatar
  • 163
15 votes
1 answer
562 views

How to specify PDE Boundary condition on a B-spline?

Context I would like to solve a PDE on a boundary which is parametrized as a BSpline. I am trying to solve the force-free Grad-Shafranov equation on a boundary ...
user avatar
  • 21.8k
14 votes
5 answers
2k views

Triangular mesh of random points on a sphere

My employer has a new logo (shown below). I do not have information on how this was created (as it was done by an outside company), though I'm fairly sure it was not done in any formal mathematical ...
user avatar
  • 677
14 votes
2 answers
571 views

How to make a structured mesh with a hole and extrude it

I am trying to use the FEMAddOns package to make a structured mesh with a hole and then extrude it. As a warm up example this worked nicely. ...
user avatar
  • 14.8k
14 votes
2 answers
737 views

A Smooth and Round Voronoi Mesh

I want the edges of a VoronoiMesh to be smooth and round. I have found the following code from this answer ...
user avatar
  • 4,358
14 votes
2 answers
1k views

create an (almost) hexagonal mesh on an ellipsoid

EDIT I edited the question in order to take into @Kuba's comment. I want to create this figure with Mathematica (in particular an almost hexagonal mesh on an ellipsoid; thanks to @Kuba I know this ...
user avatar
  • 4,734
14 votes
2 answers
1k views

What are some useful (or hidden) properties of MeshRegion?

There is quite a bit of powerful functionality built in to MeshRegion, but it seems to be lacking in some areas. For example: extracting a list of edges that live ...
user avatar
  • 738
14 votes
2 answers
2k views

How to create subregions for the NDSolve FEM Solver

I am trying to create a 2d region consisting of two subregions. The inner region has several holes, where boundary conditions are applied. The figure shows the idea. I have tried to create this ...
user avatar
14 votes
1 answer
1k views

FEM: how to choose FEM element type

I am asking myself if there is any simple option for choosing the element type for the mesh generation WITHOUT explicitly creating coordinates and then the mesh. Minimal example: here I would like ...
user avatar
14 votes
2 answers
305 views

How to Interpolate a 3D MeshRegion?

If you were given some discrete MeshRegion called r (you don't know R): ...
user avatar
  • 30.5k
14 votes
3 answers
296 views

Ordering Problem With VoronoiMesh

Imagine I want to model 2D cells moving in a tissue. Consider, as an example, Lloyd's relaxation algorithm. Using VoronoiMesh I'm able to mimic some cell movement. ...
user avatar
  • 4,358
14 votes
2 answers
229 views

Stretching a mesh

Imagine I want to stretch a mesh with a 'rubberband-type' effect. That is, upon and elastic stretch from both side edges, the mesh centres simply scale as follows where the points are seeds for ...
user avatar
  • 4,358
14 votes
1 answer
1k views

Custom interpolation on unstructured grid (2D, 3D)

as I'm not satisfied with the way Mathematica interpolates data on unstructured grids, I would like to implement my own interpolation. I will aim for Crouzeix - Raviart type of (quadratic) triangular ...
user avatar
  • 2,234
13 votes
3 answers
1k views

Lloyd relaxation on VoronoiMesh

How can we apply Lloyd's relaxation algorithm to a VoronoiMesh? Thanks. UPDATE Thanks a lot KennyColnago for your answer. Based on Simon Woods suggestion of ...
user avatar
  • 415
13 votes
6 answers
1k views

Change appearance of ConvexHullMesh

I'm struggling to understand the behaviour of ConvexHullMesh (or rather the non-behaviour). I have a polygon p ...
user avatar

1
2 3 4 5
15