Questions tagged [mesh]

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

67 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
17
votes
0answers
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 ...
11
votes
0answers
450 views

How to wrap a crumpled paper over a surface?

My initial question was about the making of a crumpled paper. After reading this article suggested by J.M. and little more browsing (kind of random walk you do on a Saturday) I thought about expanding ...
10
votes
0answers
220 views

Possible Bug with Options in DelaunayMesh

Bug introduced in 10.2 and persisting through 11.1 Update: It turns out after some testing, none of the Options work in ...
9
votes
0answers
273 views

How to label vertices on a mesh with user defined values?

I am trying to write a code to estimate geometric properties (i.e. Mean Curvature, Gaussian Curvature, Principle Curvatures) on a triangulated mesh. I would like to save the calculated data as a set ...
8
votes
0answers
479 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 ...
6
votes
0answers
374 views

How to increase boundary mesh quality?

Update: I tracked down the current issue to errors generated by numerically integrating over the boundary mesh. What's the proper way to integrate a function over the boundary of an implicit region? ...
6
votes
0answers
438 views

How to fit B-splines to unstructured grids (triangulated surfaces)?

As a continuation of trying to calculate curvature tensors on triangulated surfaces (here), I am interested in trying other methods. One approach is to use NURBS. To be more precise I would like to be ...
5
votes
0answers
51 views

DelauneyMesh in 4d and higher

Is there any way to find the DelauneyMesh in 4D (or higher)? Its documentation implies that it should be possible "A Delaunay mesh consists of intervals (in 1D), ...
5
votes
0answers
250 views

Volume Deformation

I want to do a volume deformation based on Bezier volumes. For example, if I have a triangle mesh, then I want to deform the mesh into a weird shape like the example image attached here. Can anyone ...
5
votes
0answers
690 views

Region Intersection for MeshRegion objects embedded in 3D

How can I create a logical intersection of MeshRegion objects that are three-dimensional? The RegionIntersection function will ...
4
votes
0answers
47 views

Drawing tools eyedropper crashes Mathematica 12.1 with MengerMesh

Mathematica 12.1.1 under macOS Catalina 10.15.7. In a new notebook, evaluate: MengerMesh[0, 3] Click once on the output's graphic image, which causes the bounding ...
4
votes
0answers
100 views

NIntegrate::ncvbr: How should we interpret and handle this error not mentioned in any documentation?

I have some user-defined module describing my integrand which has to be computed numerically (it's much more complicated than this but bear with me): ...
3
votes
0answers
64 views

Unfold/develop a RevolutionPlot3D mesh onto a 2D plane?

I'm making my own blimp out of emergency blankets (Mylar), and I want it to have a NACA0025 airfoil shape. I'm new to Mathematica, but I still managed to create the shape I wanted with ...
3
votes
0answers
122 views

Finding the shortest distance of two points and an area

So I have a region defined by something like MeshRegion[{{0, 0}, {1, 1}, {2, 1/2}, {2, -1/2}}, {Line[{1, 2}], Line[{2, 3}], Line[{3, 4}], Line[{4, 1}]}], and two ...
3
votes
0answers
265 views

Reducing a FEM 3D Interpolation Function to a 2D Interpolation Function

I'm trying to solve the heat equation in 3D using FEM and back out a slice in the xz plane. My problem is when I define a function that is a slice in the xz plane it uses the full 3D interpolation ...
3
votes
0answers
111 views

Delaunay link distance

I have a Delaunay mesh region. To start with, I give a simple example here: pts = RandomReal[{-1, 1}, {50, 2}]; R = DelaunayMesh[pts]; The next step I want to do ...
3
votes
0answers
129 views

Why is MeshRegion atomic?

I wanted to make some changes inside a MeshRegion today and found that unlike Graphics objects, it can't be done directly ...
2
votes
0answers
46 views

Graph embedding constrained to a surface?

Have been contemplating it for a while, but did not dare to post as I felt like this must be a major undertaking to implement. Then saw the excellent answers to a recent question RegionPlot3D KnotData ...
2
votes
0answers
54 views

Removing polygons from exported RegionPlot

I have the following code that runs a RegionPlot ...
2
votes
0answers
114 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 (...
2
votes
0answers
110 views

DiscretizeGraphics on a RegionDifference not returning a MeshRegion

I want to take region difference of a sub-mesh of a Delaunay Mesh and a discretized ImplicitRegion. However, Mathematica does not recognize the return as a MeshRegion. Moreover, Discretizing the ...
2
votes
0answers
314 views

Calculating Gaussian Curvature for an irregular surface

Below is an irregular surface generated from large data and plotted with ListSurfacePlot3D from this data file using columns {3,4,2}. I would like to calculate the ...
2
votes
0answers
537 views

Interpolation error: element mesh with insufficient quality

I'm trying to work with a numerical function as a list of elements: {{x1, y1}, f1}, {x2, y2}, f2}, ..., {xN, yN}, fN}} I've produced the list in other ...
2
votes
0answers
457 views

ContourPlot has extra mesh in PDF

When I create a contour plot it looks fine. When I copy as PDF, and paste into another document (e.g. Apple Mail, Keynote, etc.) it has an extra unwanted white mesh. This occurs even when the option ...
2
votes
0answers
186 views

ElementMesh (rendering?) issue

The appearance of the following ElementMesh is bad as you can see for example on the inside surface of the shell. The same problem happens converting to a ...
2
votes
0answers
101 views

Export Time-dependent STL Graphics

I have recently found that Mathematica may export files (.stl) which may be used for Blender (3D pictures and animations). However, I am interested in mathematics visualization, and I suppose that ...
2
votes
0answers
878 views

Doing local FFT on huge 3D vector data cell mesh and visualizing it spatially?

Simulation type: I'm running a simulation with the OOMMF micromagnetics package http://math.nist.gov/oommf/ where are magnet is represented by a mesh of 3 million cells, it gets excited by a ...
1
vote
0answers
44 views

Using DiscretizeGraphics on a Graphics3D object that is produced by combining multiple Graphics3D objects

Consider the following two Graphics3D objects that can individually be meshed using DiscretizeGraphics. The first is a cone (...
1
vote
0answers
58 views

MeshRegion automatically merges vertices that have the same position in space

I sometimes work with surface meshes that have self-intersections (immersions rather than embeddings). MeshRegion usually doesn't have any problems dealing with ...
1
vote
0answers
93 views

Why is there no heat being transfered in my program?

I have been working on this code and am new to this coding language. I have been trying to model the transfer of heat through a hot plastic being cooled in a water bath. For some reason I have not ...
1
vote
0answers
49 views

obtain the analytics region from mesh or vtk file

Is it possible to obtain the region inequalities from a mesh file (vtk-file). On gmsh I build a Sphere, and with Mathematica I would like to obtain the analytics region function, that's is possible?. ...
1
vote
0answers
51 views

Why does ConvexHullMesh give inconsistent output stuctures?

I know much of the stuff in ConvexHullMesh needs some TLC convexhullmesh-inconsistency But, can anyone see why this would produce inconsistent output: Case 1 (expected behavior): ...
1
vote
0answers
97 views

Periodic Voronoi Mesh in a box

Is it possible to generate a periodic Voronoi Mesh inside a rectangular domain? I would also like to obtain the coordinates of each cell separately so that I can perform further operations on each ...
1
vote
0answers
44 views

How to find intersection of higher dimensional convex hull?

I have often used ConvexHullMesh to obtain a convex hull for 2-d and 3-d points. But when I try to find it for 4-D points I encounter error even for simple cases. <...
1
vote
0answers
29 views

NearestMeshCells in Mathematica 11.3

Is there an efficient way of writing a function equivalent to NearestMeshCells (Mathematica 12.1) in Mathematica 11.3? I'm trying to write my own code, which I can ...
1
vote
0answers
53 views

How to implement meshing in DiscretePlot3D?

In this answer I show a method to use DiscretePlot3D to plot a numerical function which requires a discrete step-size to be plotted, making ...
1
vote
0answers
231 views

Converting .stl files to meshes for FEA

I'm trying to conduct finite element analysis on imported .stl models from SketchUp. I can't seem to generate an ElementMesh. I think it may be something to do with intersecting boundaries, and this ...
1
vote
0answers
69 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 <...
1
vote
0answers
39 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`` and QuadElements` Setup I've got the ...
1
vote
0answers
100 views

Regions, Mesh Regions, and Graphics

This behavior seems inconsistent to me: ...
1
vote
0answers
65 views

Options problem for 3D plots

If I'm not mistaken, the code below should produce two identical pictures of a torus. But it does not. The MeshStyle->Thick option seems to be ignored for the first. Obviously the second code ...
1
vote
0answers
1k views

Plot3D of multiple functions

I am trying to combine 3D plots of different functions. Usually, this works: Plot3D[{f1[x,y],f2[x,y]},{x,-1,1},{y,-1,1}] However, I am encountering a weird ...
1
vote
0answers
46 views

Can't find RegionIntersection of DelaunayMesh

I want to find the RegionIntersection of two DelaunayMesh (given below), but the evaluation never ends. Though when I plot them, their regions are valid and shown to intersect. Why is this? ...
1
vote
0answers
138 views

Creating a 3D mesh on an Image3D Figure

I have a stack of images that I compile with the Image3D function. The resulting figure is 360x360x93 pixels and named "X". My goal is to mesh the figure. I have defined points that correspond the ...
1
vote
0answers
136 views

Import[] .obj data with per-vertex colors?

There's a somewhat standard way of including per-vetex color with obj files: Geometric Vertex[edit] A vertex can be specified in a line starting with the letter "v". That is followed by (x,y,z[,w]...
1
vote
0answers
95 views

Find best convex approximation of an “almost convex” function

I've got values of a function of two variables at integer points inside a rectangle, that is, a rectangular table $f(i,j)$, $1\leqslant i\leqslant m$, $1\leqslant j\leqslant n$. The function is very ...
1
vote
0answers
183 views

Handling Self-Intersecting Regions

I am trying to test various parametric regions of a function for membership of the origin (point {0,0}). I generate the boundary by creating four parametric boundary curves, and then use RegionMember ...
0
votes
0answers
33 views

Constraints and Tolerance

So I'm running NMaximize for optimizing a value and for constraints, I need the parameters to belong to a discrete set of elements. Basically, the constraint looks ...
0
votes
0answers
158 views

colouring Voronoi cells by their properties

I put a couple of previous posts together How can find the 2D Voronoi cell area distribution? Color code Voronoi cell areas depending on number of vertices color voronoi cell based on area to make the ...
0
votes
0answers
34 views

Define BoundaryMeshRegion from matrix of data

Say I have a matrix 'm' with 2 columns and 'r' rows. I want to define a mesh region using each row in the matrix as a point coordinate. Something like the R=BoundaryMeshRegion[{m},Line[1,2,3....,r]] . ...