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
2 votes
0 answers
53 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 ...
  • 2,964
4 votes
3 answers
147 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: ...
  • 18.3k
18 votes
4 answers
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, <...
  • 21k
9 votes
1 answer
343 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 ...
  • 1,495
2 votes
0 answers
98 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 ...
  • 793
2 votes
1 answer
169 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: ...
  • 793
0 votes
0 answers
98 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: ...
  • 793
0 votes
1 answer
107 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: ...
  • 4,927
2 votes
0 answers
78 views

3D BoundaryMeshRegion Minkowski difference via RegionErosion Failure

I need to be able to produce Minkowski difference of an arbitrary BoundaryMeshRegion and a cylinder. ...
  • 333
1 vote
2 answers
74 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 ...
3 votes
2 answers
297 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 ...
  • 21k
4 votes
2 answers
102 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: ...
  • 18.3k
2 votes
1 answer
105 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 ...
11 votes
2 answers
367 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
5 votes
1 answer
169 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 ...
  • 21k
5 votes
3 answers
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 ...
  • 333
6 votes
2 answers
264 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. ...
  • 611
4 votes
1 answer
91 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,583
3 votes
1 answer
202 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, ...
  • 333
5 votes
2 answers
243 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 ...
  • 333
5 votes
1 answer
125 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,619
0 votes
0 answers
78 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 ...
  • 135
3 votes
2 answers
379 views

Volume of the intersection and union of two spheres

I'd like to calculate the volume of the intersection and the union of ...
  • 21k
4 votes
2 answers
224 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, ...
0 votes
0 answers
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 ...
  • 43
18 votes
5 answers
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 ...
  • 479
5 votes
1 answer
230 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,645
4 votes
1 answer
135 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,822
8 votes
1 answer
259 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 ...
  • 25.3k
5 votes
1 answer
195 views

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

plot1 is taken from the BSplineSurface document. I add two Disk ...
2 votes
0 answers
52 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,159
2 votes
1 answer
131 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 ...
2 votes
1 answer
68 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 ...
5 votes
5 answers
550 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, ...
  • 137
3 votes
1 answer
63 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
3 votes
1 answer
113 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
0 votes
0 answers
65 views

RegionCentroid giving different result on Polygon and ConvexHullMesh

I have the following 5 vertices: ...
13 votes
2 answers
444 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: ...
  • 25.3k
5 votes
0 answers
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
2 answers
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,750
4 votes
1 answer
200 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
1 answer
96 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 $...
  • 1,619
13 votes
4 answers
473 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 ...
  • 5,404
5 votes
1 answer
136 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, ...
  • 4,362
8 votes
2 answers
247 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:...
  • 22.2k
2 votes
1 answer
88 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: ...
1 vote
1 answer
163 views

How to use VectorAngle[] in AnglePath3D[]?

Suppose I have a specific angle that I calculate from two vectors, in 3D: ...
  • 1,583
5 votes
1 answer
167 views

Problem with RegionMember

I think there is potentially a bug in RegionMember function, particularly in the RegionMember[reg] form. Can you evaluate the ...
  • 8,750
0 votes
2 answers
131 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 ...
  • 1,583
1 vote
2 answers
117 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: ...
  • 1,583

1
2 3 4 5
14