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
3 votes
1 answer
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[15]/4}; f = {1/4, -1/4, Sqrt[15]/4}; I want to find ...
minhthien_2016's user avatar
4 votes
1 answer
69 views

Incorrect result of ConvexRegionQ

Studying that important command of Mathematica in 13.2 on Windows 10, I obtain for both ...
user64494's user avatar
5 votes
2 answers
205 views

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

There are two set of points ...
lapcal's user avatar
  • 471
2 votes
2 answers
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 ...
Yaroslav Bulatov's user avatar
3 votes
2 answers
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 ...
Craig Carter's user avatar
  • 3,632
1 vote
2 answers
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 ...
Emilio Pisanty's user avatar
1 vote
0 answers
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 ...
Narasimham's user avatar
  • 2,972
4 votes
3 answers
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: ...
kirma's user avatar
  • 18.4k
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, <...
user64494's user avatar
9 votes
1 answer
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 ...
licheng's user avatar
  • 1,617
2 votes
0 answers
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 ...
lesobrod's user avatar
  • 859
2 votes
1 answer
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: ...
lesobrod's user avatar
  • 859
0 votes
0 answers
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: ...
lesobrod's user avatar
  • 859
0 votes
1 answer
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: ...
Shredderroy's user avatar
  • 4,957
2 votes
0 answers
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. ...
Anton's user avatar
  • 333
1 vote
2 answers
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 ...
minhthien_2016's user avatar
3 votes
2 answers
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 ...
user64494's user avatar
4 votes
2 answers
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: ...
kirma's user avatar
  • 18.4k
2 votes
1 answer
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 ...
juan zaragoza's user avatar
11 votes
2 answers
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. ...
Jannik's user avatar
  • 217
5 votes
1 answer
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 ...
user64494's user avatar
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 ...
Anton's user avatar
  • 333
6 votes
2 answers
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. ...
Moonwalk's user avatar
  • 611
4 votes
1 answer
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: ...
TumbiSapichu's user avatar
  • 1,583
3 votes
1 answer
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, ...
Anton's user avatar
  • 333
5 votes
2 answers
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 ...
Anton's user avatar
  • 333
5 votes
1 answer
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: ...
apg's user avatar
  • 1,713
0 votes
0 answers
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 ...
akr's user avatar
  • 135
3 votes
2 answers
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 ...
user64494's user avatar
4 votes
2 answers
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, ...
Anton Antonov's user avatar
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 ...
Rescy_'s user avatar
  • 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 ...
Taozi's user avatar
  • 479
5 votes
1 answer
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 ...
josh's user avatar
  • 2,292
4 votes
1 answer
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. ...
hana's user avatar
  • 2,832
8 votes
1 answer
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 ...
yode's user avatar
  • 25.6k
5 votes
1 answer
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 ...
herbertfederer's user avatar
2 votes
0 answers
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 ...
Taiki's user avatar
  • 5,159
2 votes
1 answer
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 ...
Ulrich Neumann's user avatar
2 votes
1 answer
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 ...
Taiki Bessho's user avatar
5 votes
5 answers
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, ...
Orm's user avatar
  • 137
3 votes
1 answer
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: ...
newOwen's user avatar
  • 332
3 votes
1 answer
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? ...
newOwen's user avatar
  • 332
0 votes
0 answers
67 views

RegionCentroid giving different result on Polygon and ConvexHullMesh

I have the following 5 vertices: ...
tupoliedro's user avatar
13 votes
2 answers
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: ...
yode's user avatar
  • 25.6k
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 ...
Liam Baker's user avatar
1 vote
2 answers
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 ...
Ali Hashmi's user avatar
  • 8,760
4 votes
1 answer
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) ...
GaAs's user avatar
  • 157
1 vote
1 answer
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 $...
apg's user avatar
  • 1,713
13 votes
4 answers
478 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 ...
expression's user avatar
  • 5,550
5 votes
1 answer
139 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, ...
sam wolfe's user avatar
  • 4,233

1
2 3 4 5
14