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
2
votes
1answer
41 views

RegionUnion works but RegionIntersection does not

I am trying to create an Alberti's window figure as described in this question, in which a (three-dimensional) polyhedron (e.g., dodecahedron) is projected onto a (two-dimensional) plane. I realized ...
2
votes
1answer
60 views

Unwanted mesh line in spherical plot

I am trying to create a spherical colour plot on which the mesh will rotate with manipulating the \phi1 variable. I read this solution and gave it a try with the following code: ...
1
vote
0answers
38 views

Combining MeshRegions of generated 3D shapes and RandomPolygons

I am interested in generating 3D a joint BoundaryMeshRegion or a MeshRegion from different shapes and polygons. This works for <...
6
votes
2answers
118 views

Make uniform mesh with quad elements

I have the following code that generates a finite element mesh with triangular elements which by using command ToQuadMesh I convert to the quadrilateral elements, but I am not able to make the uniform ...
1
vote
2answers
75 views

How to sample numerically a function using a mesh-grid function in 3D?

I am working on a problem where I want to sample a scalar function f[x,y,z]. The problem is how to obtain a mesh-grid in 3D (A grid of points in x,y, and z). In order to study this function. Of ...
1
vote
0answers
92 views

Calculate the intersection points of a line and a parametrically defined 3D surface

Thanks to Henrik Schumacher for advice to simplify the sample code: I would be grateful for any pointers on the following issue. A line from an external point intersects the surface at 2 points (...
0
votes
0answers
76 views

How to solve wave equation with finite elements when material properties vary continuously over a region

I am solving the one-dimensional wave equation over regions where the bulk modulus (and thus the wave speed) vary continuously over a region. The current version seems to assume that the material ...
6
votes
2answers
82 views

How to refine a linear FEM mesh in three regions?

I am trying to solve the one-dimensional wave equation with a frequency dependent source function over three intervals with varying velocity. I need to refine the mesh over the low velocity regions ...
4
votes
2answers
103 views

Automatic solution to label boundary elements with BoundaryMarkerFunction

Preparations Mathematica 11.3, Windows. Let us say I have a rectangular region with 10 little holes inside. Their coordinates are given by positionList. The ...
1
vote
0answers
46 views

Non-convex hull mesh from 3d points [duplicate]

I am trying to create a 3d mesh object from list of points, but the only options I see in Mathematica are ConvexHullMesh and ...
3
votes
1answer
62 views

Signed cell adjacency matrices (boundary operators)

In How to obtain the cell-adjacency graph of a mesh? there are some great answers that show how to obtain the cell adjacency matrix of a mesh. How would one generalize these to incorporate the ...
5
votes
2answers
132 views

Adjacent faces in a discrete mesh

I have a MeshRegion R and I want to extract all pairs of adjacent faces efficiently. The way that I've been computing this is demonstrated below: ...
3
votes
3answers
106 views

RegionMember does not work with RandomPolyhedron or Polyhedron object

According to the documentation RegionMember should work with regions that are true for ConstantRegionQ. However, the function ...
6
votes
2answers
190 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,...
1
vote
1answer
70 views

Set maximum space between elements in 3D mesh

A region in 3D space has been discretized to obtain a list of points. The resulting ListPointPlot3D plot is: I will like to obtain a mesh from these points, but ...
4
votes
1answer
42 views

Extra Lines in 3D ConvexHullMesh

I would like to make a picture of a truncated octahedron using ConvexHullMesh as follows: ...
6
votes
1answer
145 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 ...
1
vote
1answer
60 views

Mesh quality error with interpolation of table

I am trying to interpolate a table of the following form. {{x1,y1,z1},{x2,y2,z2}...} Where z depends on x and y, and x ranges from 0.01 to 1 in steps of 0.01, ...
4
votes
1answer
69 views

Find surrounding vertices (simplexes) of a given point for DelaunayMesh

Generating a Delaunay triangulation of some random points: pts = RandomReal[{-1, 1}, {50, 2}]; dm = DelaunayMesh[pts]; HighlightMesh[dm, Style[0, Black]] gives [...
0
votes
0answers
78 views

Create a tube from a section of a sphere using mesh

How does one make a meshed tube starting from a section of a sphere and later edit the tube's section parametrically.
4
votes
1answer
67 views

Difficulty in specifying mesh refinement

I am trying to give a region within a 3D volume a finer mesh than the rest of the volume. My problem is more complicated but here is a minimum working example. I define a 3D cuboid and try and have a ...
1
vote
1answer
62 views

Mesh mixes up markers in multiple curves

Following is my code: ...
4
votes
1answer
61 views

Make MeshRegion/BoundaryMeshRegion work as a graphics primitive in M11

Mathematica 12 has the nice feature that MeshRegion and BoundaryMeshRegion objects render nicely when included as a primitive in ...
5
votes
1answer
48 views

RandomPoint returns compiler errors on RegionIntersection of two Meshs?

Consider the intersection of two ConvexHullMesh's, m1 and m2. ...
4
votes
1answer
89 views

How to draw individual mesh lines in ArrayPlot

Consider the following ArrayPlot. ...
3
votes
1answer
67 views

Creating a mesh from a very thin layer

I have the following code which works just fine: ...
5
votes
2answers
117 views

Holes in ElementMesh with ToElementMesh of ImplicitRegion

I am trying to plot a function in a region below a level curve of the function and within a cell. I have been doing this by calculating an ElementMesh using ...
9
votes
2answers
308 views

Catmull-Clark and Doo-Sabin Subdivision Implementations

I want to work on subdivision surfaces. Unfortunately, I don’t have any source code to start with. I need some Mathematica codes for applying Catmull-Clark and Doo-Sabin methods. I would like to ...
2
votes
1answer
85 views

Meshing control of NDEigensystem

I have to solve an Eigenvalue problem originating from the Electrodynamics. It is a 2-D problem with a rectangular region. More specifically, there is a hole on a rectangle made by magnetic material. ...
3
votes
1answer
43 views

Is there a way to automatically use triangular elements in ToElementMesh [closed]

I have some simple code to generate a mesh over a rectangle. ...
1
vote
1answer
84 views

Converting .STL from Shell to Solid for stress analysis of wing

I'm new to Mathematica as this is the first class I've had to used it in my undergrad time as an aerospace engineer. Anyway, I have run into a problem that I can't figure out. I have created .STL's of ...
2
votes
1answer
115 views

Finding the tangents of the function in each mesh

I have a 2D graphic which contains a table of curves within a circular region. ...
5
votes
1answer
57 views

Mesh cell count for Voronoi mesh too low

I was trying to solve this question out of interest and thought perhaps creating a Voronoi mesh, cropping it to a circle, and colouring the mesh cells might work. However, if I ask ...
1
vote
1answer
40 views

Uneven distribution of nodes by ToElementMesh[]

We are using FEM package to generate mesh in a circular sector. Somehow mesh becomes dense in upper right corner. Is there any way to circumvent this uneven distribution? ...
4
votes
1answer
75 views

VoronoiMesh with custom distance function

I'm failing at reading the documentation. Is there a way to specify the distance function used by VoronoiMesh? As a stripped down example say I have a rank-1 lattice such as: ...
10
votes
2answers
137 views

ToElementMesh of Region with Hole

When I try to mesh the following region it fails. Why? Is there a workaround? ...
13
votes
2answers
582 views

Meshing the cow

As a simple example for applying stl-files I took "cow" out of MMA example data. I'm able to discretize the Graphic without problems ...
2
votes
1answer
77 views

Colorize mesh according to the nodepoint colors

Given a set p of points (2D), each with a unique color c, I can mesh these points easily ...
1
vote
2answers
91 views

Trouble with Calculating Area of Parametric Region

This question stems from an attempt to solve the following question: How to calculate specific area on surface of sphere? First, I parametrize a circular loop: ...
5
votes
3answers
255 views

How to create “Volumemesh” from closed “surfacemesh”?

Given a surface region (MesgRegion netz2D), for example ...
3
votes
2answers
96 views

Making NDSolve choosing by itself a spatial meshing leading to correct integrated results

In a previous post, I was asking how to force a fine spatial meshing in NDSolve using the FiniteElement method. The solution was ...
4
votes
3answers
92 views

Forcing at least $n$ spatial steps in solving a 1D spatio-temporal PDE problem with NDSolve

I want to solve the telegraph equation with a spatial discretization forced at 200 points. I tried: ...
4
votes
2answers
421 views

How would I define a region with multiple holes?

I would like to define a region consisting of a polygon with eight holes in it. This is essentially a stamped piece of metal with eight holes. ...
19
votes
3answers
429 views
0
votes
0answers
31 views

Using a mixture of QuadElement and TriangleElement in ElementMesh

TL;DR Is it possible to have a ElementMesh made of a mixture of a TriangleElements`` andQuadElements` Setup I've got the ...
5
votes
1answer
62 views

How to not show line mesh elements

Let's say I make a mesh from a collection of random points: SeedRandom[1234] points = RandomReal[1, {20, 2}]; mesh = VoronoiMesh[points] For the purposes of my ...
0
votes
1answer
46 views

How can I check to see if two cylinders overlap?

Is there a simple way for me to determine if a cylinder a and cylinder b overlap in the 3D space? I have spent a few hours ...
4
votes
1answer
60 views

Plotting a vector field embedded in a donut

I have the following code ...
3
votes
1answer
92 views

Creating a domain for NDSolveValue via ParametricRegion

A circular arc $R_2$ can be defined parametrically as $R_2 = \langle x(s),y(s) \rangle : s\in[-s_0,s_0]$ (see code below for specific $x,y$ definitions) where $s_0$ is given (I must make the arc this ...
0
votes
1answer
71 views

Understanding Energy Function [closed]

I am trying to implement as rigid as possible mesh interpolation solution provided in this article called "As-Rigid-As-Possible Surface Morphing" http://citeseerx.ist.psu.edu/viewdoc/download?doi=10....