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

700 questions
Filter by
Sorted by
Tagged with
135 views

### How do I calculate volume of a polyhedron knowing a list of vertices of polyhedron?

I have a list of vertices a = {1/2, 1/2, 0}; b = {-1/2, 1/2, 0}; c = {-1/2, -1/2, 0}; e = {-1/4, 1/4, Sqrt/4}; f = {1/4, -1/4, Sqrt/4}; I want to find ...
69 views

### Incorrect result of ConvexRegionQ

Studying that important command of Mathematica in 13.2 on Windows 10, I obtain for both ...
205 views

### How to determine whether a point is within a multidimensional degenerate convex hull? [duplicate]

There are two set of points ...
220 views

### How to avoid poles in contour integration?

I have two sets of points and need to construct a contour (for contour integration) that encloses all singularities given in points2 , but avoids enclosing ...
181 views

### Why is SignedRegionDistance always returning zeroes?

I have a simple parabolic region: reg = ImplicitRegion[ x <= 1/2 && y <= Sqrt[1/2 - x]/2, {{x, 0, 1}, {y, 0, 1}}] It appears to be behaving ...
1 vote
148 views

### How to get the centroid of a geographical region? (or: the center of mass of Croatia is in Bosnia and Herzegovina, but where exactly?) [duplicate]

How can I get Mathematica to calculate the centroid of an extended geographical region (say, a country) in a way which (i) fully respects the spherical nature of the Earth, and (ii) involves a minimal ...
1 vote
57 views

### Angle sum at center of a skewed quadrilateral

The center of a discrete quadrilateral on a positive, flat or negative curved surface should make angles sum at center point 2 less than, equal to or more than $360^{\circ}$ respectively, making them ...
153 views

### Simplifying an expression to a sensible conic section polynomial

I have an expression which represents an intersection of the unit sphere and a cone, projected to two-dimensional plane: ...
2k views

### How to exactly calculate the volume?

Let us consider the intersection of four cylinders of the unit radius along the big diagonals of the cube $[-10,10]^3$ and the cylinder of the unit radius with the $z$-axis as its axis. More exactly, <...
356 views

### How can I detect the number of crossings in a layout of a graph?

This question was inspired by the game Planarity in which a player tries to position the vertices so that no two lines cross. As I move the vertices, the change in the number of crossings is detected ...
100 views

### Placing shapes along a square spiral

Proposed code example is inspired by the main idea of this challenge. Wolfram Language provides great opportunities in computational geometry. But not all of them are equal in terms of speed and ...
177 views

### Bugs with computational geometry: versions 12.2 vs 13.2

Updated System Info: HONOR laptop AMD Ryzen 5 4600H 3Hz 6 cores 16GB Memory, Windows 10 Pro 64 bit with updates. Mathematica Info: Versions 12.2 and 13.2, both on the same laptop. Examples: ...
105 views

### Problem with WindingPolygon

Bug introduced in 12.2 or earlier and fixed in 13.1 or earlier. I would like to slightly modify the standard example: ...
113 views

### RegionIntersection runs for a very long time and then aborts without returning a result

Is there a good strategy to speed up RegionIntersection computations like the one below: ...
82 views

### 3D BoundaryMeshRegion Minkowski difference via RegionErosion Failure

I need to be able to produce Minkowski difference of an arbitrary BoundaryMeshRegion and a cylinder. ...
1 vote
78 views

### Another way to find coordinates of two remain vertices knowing given two vertices?

Let be given the polyhedron ABCD with $AB = 4 \sqrt{3}$, $AC=1$, $BC=\sqrt{41}$, $AD=\sqrt{17}$, $CD=4$, and $BD=5$. I am trying to find coordinates of two vertices ...
304 views

### Two squares in the unit square

A square of side one contains two squares of sides $a$ and $b$ having non-overlapping interiors. How to prove the inequality $a+b≤1$ with Mathematica? The same question in three dimensions and higher ...
114 views

### How to find intersection points of $n$ $n$-spheres reliably and efficiently when $n$ is large

I have positions and radii of $n$ $n$-dimensional hyperspheres and want to find their intersection points efficiently. A very-straight-forward solution seems quite reliable: ...
109 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 ...
370 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. ...
194 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 ...
175 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 ...
285 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. ...
103 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: ...
207 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, ...
262 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 ...
128 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: ...
80 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 ...
399 views

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

I'd like to calculate the volume of the intersection and the union of ...
225 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, ...
160 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 ...
1k 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 ...
254 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 ...
141 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. ...
272 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 ...
215 views

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

plot1 is taken from the BSplineSurface document. I add two Disk ...
54 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 ...
144 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 ...
70 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 ...
597 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, ...
67 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: ...
116 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? ...
67 views

### RegionCentroid giving different result on Polygon and ConvexHullMesh

I have the following 5 vertices: ...
454 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: ...
63 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 ...
1 vote
106 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 ...
211 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) ...
1 vote
98 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 \$...