# 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.

682 questions
Filter by
Sorted by
Tagged with
96 views

### Plot3D plotting serrated edge

I want to plot the upper casket of a sphere in 3D using its parametrisation as $s(x,y) = \sqrt{1-x^2-y^2}$. Although this show be straight forward with Plot3D, I am running into an issue I find very ...
333 views

### Mark all Points in a triangle that have a certain property

I want to mark all points inside of a triangle having the following property: I can center a line segment of length $c$ on the point so that the line segment is entirely contained inside the triangle. ...
• 217
124 views

### What is the volume of the intersection of four cylinders of equally radius equally spaced?

I saw that question at the certain forum and answered it with help of Mathematica 13.1 in such a way. The angles between the unit vectors ...
• 18.4k
168 views

### Parellel-To-Plane Version of RegionDistance

RegionDistance basically calculates distance between points P and Q=RegionNearest[Reg,P]: I need to find a way to find function ...
• 303
223 views

### Extract 2D quad mesh from 3D hexahedral mesh

I would like to extract 2D mesh of outer surface of 3D meshed object. Let's say I have 3D mesh data from here and I import the data into Mathematica. ...
• 569
70 views

### How to make a density plot on Ellipsoid[] surface?

Suppose I have the ellipsoid below and a set of points that I know rest on its boundary, which we can visualize: ...
• 1,563
176 views

### Generating a non-convex polyhedron from polygons and normals

I am working on developing "directional offset" module, which requires pretty tricky mesh generation: offset values vary in different directions. Suppose I have list of points and polygons, ...
• 303
202 views

### Finding Mesh Cell Normals

I need to find a normal pointing outside for every face / cell of a closed Mesh Region. How can I do this? Here's what I have now - mesh + mesh cells centers and I'm stuck and puzzled. There's ...
• 303
110 views

### Random point configuration from the Poincare disk model gives division by zero problem near boundary

I am trying to select points uniformly at random from the Poincare disk model of hyperbolic geometry: ...
• 1,599
72 views

### Difference between a region and its convex hull

I have a volume enclosing a certain region. The region is non-convex, and I calculate its convex hull with the built-in Mathematica function. I want to know the difference between the region and its ...
• 125
328 views

### Volume of the intersection and union of two spheres

I'd like to calculate the volume of the intersection and the union of ...
• 18.4k
214 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, ...
• 35.8k
158 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 ...
• 43
915 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 ...
• 447
194 views

### Unable to obtain all boundary points on a convex hull using ConvexHullRegion

I'm using an old function which uses ConvexHull from the obsolete ComputationalGeometry package. I understand this is ...
• 1,498
130 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. ...
• 2,484
221 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 ...
• 24.6k
163 views

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

plot1 is taken from the BSplineSurface document. I add two Disk ...
51 views

### GeometricScene doesn't quite work in v13.0.1

I used GeometricScene in v12.x quite a bit in some project and although the feature was experimental it was reliable before. I recently upgraded to v13.0.1 and had ...
• 5,089
1 vote
106 views

### Understanding GeometricScene [closed]

I tried to expand a simple geometric scene: RandomInstance[GeometricScene[{a, b, c }, { Triangle[{a, b, c}]}], 1] works fine and shows the triangle. But if ...
• 38.7k
65 views

### Minimize relating a geometric test

I want to find a circle with a center and a radius that includes all given points, like a circumscribed circle for the points. points data: https://www.dropbox.com/s/0unlv1vbngopu38/new_ref.txt?dl=0 ...
• 735
464 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, ...
• 127
55 views

### How to use ConvexOptimization on a piecewise function?

I define a simple piecewise convex function, but ConvexOptimization does not take it as a valid input: ...
• 332
111 views

### How to use ConvexOptimization on a function constructed from data?

Given the following data points sampled from a convex function, how could I construct a convex function that can be minimized using ConvexOptimization? ...
• 332
62 views

### RegionCentroid giving different result on Polygon and ConvexHullMesh

I have the following 5 vertices: ...
370 views

### GeometricTest doesn't work in ellipse

Bug introduced in 13.0 or earlier and fixed in 13.1.0 Let me look at a circle case: ...
• 24.6k
62 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 ...
• 203
1 vote
105 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 ...
• 8,598
166 views

### Is it possible to improve a code related with iterative closest point (ICP) algorithm?

I am trying to write a code related with ICP algorithm. The purpose of the code is matching a target data with a reference data by translational operation in XYZ axes (3-degree-of-freedom (DOF) ...
• 157
1 vote
90 views

• 1,923
125 views

### Find sum of positive geometric progression numbers

I have a task to get the total number of games played in a soccer tournament. Apart from the group stages, I observed that the number of games played in each round from the knockout round down to the ...
119 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 ...
• 6,461
114 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 ...
• 4,388
99 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 ...
• 1,566
84 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 ...
• 409
87 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 ...
311 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 ...
• 1,566
184 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 ...
• 1,566
177 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: ...
• 367