Questions tagged [computational-geometry]

Questions on constructing graphical objects using relatively complex computations relating to the mathematical structures defining those objects. Examples include convex hulls, Voronoi diagrams, Delaunay triangulations, mathematical constructions, symmetries, genuses of curves and graphs and programmatic constructions of polyhedra.

Filter by
Sorted by
Tagged with
4 votes
2 answers
206 views

Easiest way to obtain MeshRegion from CountryData

What is the easiest way to obtain MeshRegion objects from CountryData that I can use in geographic computations? For example, ...
user avatar
0 votes
0 answers
154 views

Why is regioncentroid not giving correct results?

I am trying to calculate and plot the x-axis of a volume centroid for the region between zx-plane and a function squared $u(t,x,z)$ from time $t=15$ to $25$. The function is a numerical solution to a ...
user avatar
  • 43
13 votes
5 answers
806 views

Divide a geometric region by (many) lines

Given a shape (e.g., a rectangle, a circle, etc.), how to divide it by $n$ randomly chosen lines. It is trivial to plot those lines (see figure below), using code like ...
user avatar
  • 417
4 votes
1 answer
120 views

How to find boundary of the intersection of two mesh regions in CW or CCW?

I have two lists of points as follow and they're not fixed. ...
user avatar
  • 1,686
7 votes
1 answer
180 views

How to union 3D region to calculate volume?

I have a Teapot likes: region = RepairMesh[ExampleData[{"Geometry3D", "UtahTeapot"}, "MeshRegion"]] I want to calculate the volume ...
user avatar
  • 23.1k
5 votes
1 answer
140 views

How to combine several surfaces into a solid and compute its volume?

plot1 is taken from the BSplineSurface document. I add two Disk ...
user avatar
5 votes
5 answers
409 views

Normal equation of plane through a point and line

I need to find the normal vector of the form Ax+By+C=0 of the plane that includes the point (6.82,1,5.56) and the line (7.82,6.82,6.56) +t(6,12,-6), with A=1. Of course, this is easy to do by hand, ...
user avatar
  • 127
13 votes
1 answer
345 views

GeometricTest doesn't work in ellipse

Let me look at a circle case: ...
user avatar
  • 23.1k
5 votes
0 answers
60 views

Memory leak in FindMinValue?

I was running some geometric optimisation code today using FindMinValue and for some reason at one point the memory usage goes upwards of 14GB, making the kernel ...
user avatar
1 vote
2 answers
104 views

why does the MomentOfInertia behave differently for ConvexHullMesh and ConvexHullRegion

I have a list of points of a convex polyhedron for which I need to compute the eigenvectors of the Moment of Inertia matrix. But, it seems like the built-in ...
user avatar
  • 8,528
1 vote
1 answer
86 views

Evaluate area of random region covered by disks

If I cover a square of side $L$ with $n$ unit disks at random (the disks may overlap the boundary), is there a standard way to evaluate the total covered area $A$? I am looking to observe the density $...
user avatar
  • 1,505
13 votes
4 answers
437 views

Group points which on several straight lines

I have some points, they are distributed on three straight lines, how to group points on the same line? I have tried FindCurvePath, but I got the wrong result. I ...
user avatar
  • 4,856
5 votes
1 answer
117 views

Avoiding Concave Polygons

In a vertex model, vertices in a lattice are modelled by a set of ODEs. A T1 transition is the following: when a certain edge becomes small enough (given a threshold), two cells stop being connected, ...
user avatar
  • 4,138
8 votes
2 answers
240 views

MorphologicalEulerNumber misbehaving in 3D?

Context I would like to compute the MorphologicalEulerNumber of 3D GaussianRandomField as a function of height above a given threshold. Attempt I proceed as follows:...
user avatar
  • 21.7k
2 votes
1 answer
81 views

Table of surface Parametric draw

I'm trying to reproduce this kind of graph for a spherical cap, with different span ratios. I tried with this: ...
user avatar
1 vote
1 answer
141 views

How to use VectorAngle[] in AnglePath3D[]?

Suppose I have a specific angle that I calculate from two vectors, in 3D: ...
user avatar
  • 1,303
5 votes
1 answer
146 views

Problem with RegionMember

I think there is potentially a bug in RegionMember function, particularly in the RegionMember[reg] form. Can you evaluate the ...
user avatar
  • 8,528
0 votes
2 answers
105 views

How to align two ellipsoids along center and long axes?

I'm struggling to understand rotation/translation transforms as applied to things like spheres and ellipsoids. Take the following silly example. Given this pair of random ellipsoids, how do I find a ...
user avatar
  • 1,303
1 vote
2 answers
94 views

Transfer distribution of points on a sphere to an Ellipsoid[]?

I've seen this cool function, which generates a given distribution of points on the unit sphere, known as Dimroth-Watson distribution: ...
user avatar
  • 1,303
0 votes
0 answers
84 views

Computations on differential geometry

I have to do some really long computations of basic riemannian geometry. I am trying to use Mathematica to check them. This is the kind of computations I want to do. Let $M$ be a riemannian manifold ...
user avatar
1 vote
0 answers
56 views

Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
user avatar
  • 1,576
3 votes
1 answer
110 views

Analogue of SpherePoints in higher dimensions?

I'm looking for an analogue of SpherePoints that works in dimensions higher than 3, has this been created already? A random sample from unit ball will be ...
user avatar
6 votes
1 answer
105 views

How to generate an heterogeneous mesh

I'd like to generate a mesh with a big variance in cell size. Something like I'd prefer not to rely on a vertex model and perhaps use something simpler, like ...
user avatar
  • 4,138
2 votes
1 answer
98 views

Efficient way to pick up pairwise vertices of certain Euclidean distance in arbitrarily dimensional coordinates? [closed]

I have a grid graph with x and y vertices in each direction. The 2-dimensional coordinates of the graph ...
user avatar
  • 1,546
2 votes
0 answers
81 views

Inner polygon approximation

Suppose you want to perform an inner approximation of a planar semialgebraic set by a finite set of polygons. The following is a quick way to yield an approximation but I am not convinced that it is ...
user avatar
3 votes
1 answer
84 views

Does DelaunayMesh use exact computations? What is the treatment of non-generic cases?

Computing Delaunay complexes can be sensitive to numerical instabilities, especially in higher dimensions. I would like to know how much I can rely on Mathematica's answers when using ...
user avatar
  • 311
5 votes
2 answers
301 views

Generate Aztec triangle of size n automatically?

In the paper titled "Perfect Matchings of Cellular Graphs" by Mihai Ciucu, the Aztec triangle of size n (n= 1, 2, 3, 4, 5, ...) is equivalent to a ...
user avatar
  • 1,546
6 votes
2 answers
163 views

Automatically get points in a given triangular lattice and vice versa?

Given a triangular lattice which grows with number n, as follows I want to list all the connected points in the lattice to form the ...
user avatar
  • 1,546
0 votes
1 answer
163 views

How do you calculate the area of a surface with edges in mathematica

Like the title indicates, how could I achieve this. Normally what I did for a closed surface is as follows: ...
user avatar
  • 367
0 votes
0 answers
54 views

Checking Membership of Conic Hull for Multiple Inputs

Suppose I have a given $10 \times 12$ matrix T, a $12 \times 1$ vector Subscript[\[Xi], 0], a $4 \times 12$ matrix ...
user avatar
1 vote
0 answers
44 views

Determine if intersection of Polygon and HalfLine is non-empty

I have a concrete example: ...
user avatar
4 votes
1 answer
118 views

"Mesh -> Full" Disables MeshFunction in ParametricPlot3D

Here's my code ...
user avatar
  • 43
6 votes
3 answers
435 views

Efficiently compute Minkowski sum of a 2D Region and a Disc of radius r?

Given a 2D Mathematica Region, e.g. A = Region[RegionDifference[Disk[{0, 0}, 2], Disk[{2, 0}, 1]]], how can I grow the region by an arbitrary radius r? For example, ...
user avatar
2 votes
3 answers
349 views

Voronoi diagram of two data sets

My primary data is ...
user avatar
1 vote
0 answers
60 views

RandomInstance of GeometricScene producing unexpected result

Consider the following scene as an example: ...
user avatar
  • 8,085
5 votes
2 answers
158 views

Bounded polygons in Voronoi diagram and calculating the areas and the number of sides of each polygon

I have some data as ...
user avatar
4 votes
3 answers
264 views

Extrude two dimensional list with thickness n

I have a question concerning how to extrude a two dimensional list. There are examples in mathematica forums how to extrude but none of them (as far as i know) discussed how to do it with a list. My ...
user avatar
  • 223
9 votes
1 answer
206 views

Digitizing a geometrical sensor

I want to quantify the flow from photos taken from a sensor such as this one: For a limited number of readings, I can use a plot digitization method. However, I need to do this many times for ...
user avatar
  • 1,554
0 votes
0 answers
98 views

Why the output is not in numerical form in Mathematica 12.2?

Consider the following code: ...
user avatar
  • 3,542
3 votes
2 answers
203 views

How to find the MeshConnectivityGraph[] from a list of independent cell mesh regions?

I'm generating a bunch of points inside a BoundaryMeshRegion. Then I generate the Voronoi mesh of the points, and take the intersection of the Voronoi cells into ...
user avatar
  • 1,303
2 votes
0 answers
50 views

Maximizing the interior angles of a triangle on the Earth [closed]

Gauss once surveyed a triangle in the Harz mountains formed by Inselberg, Brocken, and Hoher Hagen to check if the sum of the interior angles really added up to $\pi$ radians. With the precision ...
user avatar
  • 1,448
5 votes
3 answers
212 views

Determine and plot major and minor axes of ellipse

I have an element (El) constructed from a list of nodal coordinates (Nodes). Note: The list of nodes can be arbitrarily long. I then create a minimal area ellipse that encloses all of the node using a ...
user avatar
7 votes
1 answer
141 views

problem with DelaunayMesh 3D coordinates

I found DelaunayMesh works fine for 2D. For example, ...
user avatar
  • 15.6k
0 votes
0 answers
232 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 ...
user avatar
  • 51
0 votes
0 answers
52 views

Fortune's Algorithm (Conditional Step Size in `Manipulate`)

I am trying to implement Fortune's Algorithm. Here is my code so far. ...
user avatar
17 votes
3 answers
617 views

Faster "Closest Pair of Points Problem" implementation?

The closest pair of points problem is a common computational geometry problem: given n points, find a pair of points with the smallest distance between them. A naive algorithm of finding distances ...
user avatar
5 votes
1 answer
148 views

Property "Centroid" of result from ConvexHullMesh[] can not be extracted

As the title describes, specifically, simple code below ConvexHullMesh[RandomReal[1, {10, 2}]]["Centroid"] returns an error in V. 12.2, but it worked in ...
user avatar
8 votes
2 answers
311 views

Generate random lines that don't be too crowded between the intersections

It's easy to generate random lines, such as this ...
user avatar
  • 4,856
5 votes
0 answers
162 views

How to obtain the adjacency matrix of morphological components?

I am wondering if there's a simple way to obtain the adjacency matrix of the morphological components of a segmented image. Consider the following example (originally, from this question): ...
user avatar
  • 1,303
1 vote
1 answer
83 views

Get coordinates of Translated Polygon

I have many polygons of the following form that I wish to do more complicated processing and analysis based on it's updated location (such as relationships between geometries). ...
user avatar
  • 1,024

1
2 3 4 5
13