50
votes
Can Mathematica solve Plateau's problem (finding a minimal surface with specified boundary)?
Edit: added Gradient -> grad[vars] option. Without this small option the code was several orders of magnitude slower.
Yes, it can! Unfortunately, not ...
43
votes
Accepted
How to perform Loop subdivision on a triangle mesh with Mathematica?
We need quite a bit of preparation. In the first place we need methods to compute cell adjacency matrices from here. I copied the code for completeness.
...
42
votes
Can I get the curvature at any point of a random curve?
I guess the first step would always be to find an ordered list of points along the middle of the curve. That I can help with:
First binarize and thin the image of the curve, so you get a 1-pixel wide ...
41
votes
Accepted
Numerically solving Helmholtz equation in 3D for arbitrary shapes
Version 11 has both symbolic and numeric eigensolvers, see here for an overview
Here is a slightly different way to do it. We write a function that converts any PDE (1D/2D/3D) into discretized system ...
38
votes
Accepted
Can Mathematica solve Plateau's problem (finding a minimal surface with specified boundary)?
Here is a method that utilizes $H^1$-gradient flows. This is far quicker than the $L^2$-gradient flow (a.k.a. mean curvature flow) or using FindMinimum and friends, ...
34
votes
How to create word clouds?
There is now a built-in version of an algorithm in v10.1: WordCloud. I wonder whether any of your nice algorithms introduced here had any influence on the built-in ...
34
votes
How to estimate geodesics on discrete surfaces?
Geodesics in Heat Algorithm
At the suggestion of @user21 I am splitting up my answers to help make the code(s) for calculating geodesics distances easier to find for other people interested in these ...
32
votes
Accepted
Faster way to compute the distance from a point to a surface in 3D
Well, you can use the undocumented RegionDistance which does exactly this as follows: (This answer, as written, only works for V9 as noted by Oska, for V10 see ...
32
votes
Accepted
How to speed up estimation of Mean and Gaussian curvatures on triangular meshes?
Note added 1/29/2020: the routines here have a bug where the mean curvature is sometimes computed with the opposite sign. I still need to work on how to fix this.
I guess I should not have been ...
29
votes
Accepted
Finding length of intersection of two surfaces
Fixed (see below)
Here's an approach:
r1 = Exp[-x^3 - y] - 1 == z;
r2 = y == z;
We create ImplicitRegions:
...
25
votes
Accepted
Catmull-Clark and Doo-Sabin Subdivision Implementations
Catmull-Clark Subdivision
Indeed, I have some code for Catmull-Clark subdivision and I planned to post it here for quite some time. This seems to be a good opportunity.
The code is optimized for ...
24
votes
Accepted
Better way to calculate angle between lines?
This passed all test cases, I think:
anglecalc[vec1_, vec2_] := Mod[(ArcTan @@ vec2) - (ArcTan @@ vec1), 2 π]
23
votes
Accepted
How to extract parts from atomic expressions like DelaunayMesh and Graph?
I'm going to take this as a general question, referring to all atomic objects, not just DelaunayMesh.
By design, atomic objects like ...
22
votes
Accepted
GeoGraphics : path within a country
Here is a solution I can think of. Idea is to take the FullPolygon of a given country and then triangulate the region. Once that is done take the underlying ...
22
votes
Accepted
How to estimate geodesics on discrete surfaces?
Nothing really new from my side. But since I really like the heat method and because the authors of the Geodesics-in-Heat paper are good friends of mine (Max Wardetzky is even my doctor father), here ...
22
votes
Accepted
Making a graph or network interactively over an image
There are many ways to do this, modifying, improving my method or doing a completely different thing. My goal here is to show a very basic idea that should give you a start. ...
21
votes
Site - Cell Correspondence in Voronoi Diagram obtained via VoronoiMesh
Of course it's not good that Mathematica forget initial points for Voronoi mesh. May be it is a bug. However one can easily recover all generating points directly from the mesh. It's interesting from ...
21
votes
Find duplicates in list of InfiniteLine
DeleteDuplicates[lines, RegionWithin]
{InfiniteLine[{{0, 0}, {1, 0}}], InfiniteLine[{{0, 1}, {1, 0}}]}
Also
...
21
votes
How to speed up estimation of Mean and Gaussian curvatures on triangular meshes?
It took me a while, but the suggestion of @Michael E2 was quite helpful, and especially the post (Optimize inner loops).
For those of you (like me) who are new to this style of programming in ...
21
votes
How to generate approximately equally spaced points efficiently
Many solutions similar to how to get $n$ equidistributed points on the unit sphere are possible, especially if one can accept that points are not on the edges of a region. For instance, one can use ...
20
votes
Site - Cell Correspondence in Voronoi Diagram obtained via VoronoiMesh
There is also a currently undocumented internal function that may be useful.
Region`Mesh`MeshMemberCellIndex[mr] generates a function which can be applied to list ...
20
votes
Accepted
How to get a specified number of points that are nearly equally spaced in a closed rectangle
There is a neat (and widely known) trick to produce n approximately evenly distributed points in a disk, or on any surface of revolution. Points are placed on a ...
20
votes
Accepted
How to generate approximately equally spaced points efficiently
Annealing
Found this to be an interesting question and immediately I thought it to be a good application for simulated annealing.
Here's a little unoptimized annealing function I wrote. The idea is ...
19
votes
Numerically solving Helmholtz equation in 3D for arbitrary shapes
This slightly modified function
...
19
votes
Determine whether points lie within a cow
One way is to compute the solid angle subtended by the cow viewed at the point by summing signed solid angles corresponding to the cow's polygonal faces. If the total is 4 pi, the point is inside the ...
19
votes
Converting a Sierpinski tetrahedron to a Graph
A natural and simple way to approach this problem, assuming that your SiPyramid function has been defined, is as follows:
...
19
votes
Accepted
How to construct a 3D 10-sided Die (Pentagonal trapezohedron) and Spin to a face?
Edit - forgot to add a necessary link
Coincidentally I had a little personal project trying to make a good dice roller in Mathematica a while back. Here's some of my code (note: this was before I ...
19
votes
Accepted
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
computational-geometry × 636mesh × 130
regions × 122
geometry × 99
plotting × 59
graphics × 58
graphics3d × 57
bugs × 33
finite-element-method × 33
performance-tuning × 31
graphs-and-networks × 28
intersection × 26
geometric-computation × 20
equation-solving × 18
polygons × 17
calculus-and-analysis × 16
image-processing × 16
geometric-transform × 14
differential-geometry × 14
list-manipulation × 13
random × 13
differential-equations × 12
mathematical-optimization × 12
polyhedra × 11
functions × 10