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
6
votes
3answers
318 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, ...
2
votes
3answers
311 views

Voronoi diagram of two data sets

My primary data is ...
1
vote
0answers
36 views

RandomInstance of GeometricScene producing unexpected result

Consider the following scene as an example: ...
9
votes
1answer
177 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 ...
0
votes
0answers
90 views

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

Consider the following code: ...
2
votes
0answers
47 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 ...
3
votes
2answers
98 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 ...
7
votes
1answer
108 views

problem with DelaunayMesh 3D coordinates

I found DelaunayMesh works fine for 2D. For example, ...
0
votes
0answers
164 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 ...
0
votes
0answers
45 views

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

I am trying to implement Fortune's Algorithm. Here is my code so far. ...
17
votes
3answers
525 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 ...
5
votes
1answer
135 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 ...
8
votes
2answers
203 views

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

It's easy to generate random lines, such as this ...
5
votes
0answers
135 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): ...
1
vote
1answer
52 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). ...
4
votes
1answer
123 views

How to unite polygons of the same color into a single polygon?

Let a partition of a planar polygon into colored polygons be given, i.e. something similar to We know the coordinates of the vertices and the color of each part, e. g. in such a way ...
2
votes
2answers
69 views

How to create an ImplicitRegion from a list of 2D coordinates [closed]

I have a set of (x,y) coordinates. How can I link them together to form an ImplicitRegion?
0
votes
1answer
120 views

Adopt Mathematica codes for circumscribed and inscribed ellipsoids to related sets

Users Daniel Huber and Dominic have provided an interesting answer each to the question JohnEllipsoids of constructing circumscribing and inscribing ellipsoids for a certain three-dimensional convex ...
3
votes
2answers
108 views

Estimation of the expected Euclidean distance between two random points on a unit $n$-hemisphere

What is the best approach to estimate, with Wolfram Mathematica, the expected Euclidean distance (in a $(n+1)$-dimensional space) between two points selected uniformly at random on a unit $n$-...
2
votes
3answers
131 views

Estimate the expected distance between two random points on the unit $n$-sphere [duplicate]

What is the best approach to estimate, with Wolfram Mathematica, the expected Euclidean distance in a $(n+1)$-dimensional space between two points selected uniformly at random on the unit $n$-sphere? ...
0
votes
2answers
125 views
2
votes
6answers
299 views

Graph/Construct (John) ellipsoids circumscribing and inscribing a certain 3D convex set

A famous theorem JohnEllipsoids of Fritz John informs us that associated with a convex body are circumscribed and inscribed ellipsoids of minimal and maximal volumes. Now, a body--argued to be convex ...
1
vote
1answer
98 views

Maximum area of projection of cuboid onto plane

For didactic purposes I solve with Mathematica the following problem (see Vasilyev's box on p. 17): when the area of the projection of a rotating cuboid in the three-dimensional space with coordinates ...
2
votes
2answers
138 views

Get 3D surface grown by constant distance

There is a nice example of how to generate an isometric visualisation of surfaces which are at a constant distance from a given region. All these examples are just working on one single region. If one ...
2
votes
2answers
150 views

Exporting a FEM mesh from a parametric surface

How is it possible to export a mesh for suitable finite element analysis (such as Abaqus) from a parametric surface expressions? I'm working on this kind of surface: ...
0
votes
0answers
55 views

Intersection Region of two Conic Hull

I have the following semi-infinite conic hull, r1=ConicHullRegion[{{0,0,0}},{{-1,0,0},{0,-1,0},{1,0,1}}]; r2=ConicHullRegion[{{0,0,0}},{{-1,0,0},{0,-1,0},{0,1,1}}]; ...
2
votes
1answer
94 views

Create concentric circles with numbers inside

Hello there if you can give me a hand I want to create and export to pdf the following figure, which if you realize forms the multiplication table. The idea is to be able to control the central number ...
3
votes
2answers
311 views

Cube cutting problem

Show[Graphics3D[{Cuboid[]}], ContourPlot3D[{x==1/3,y==1/4,z==1/5},{x,-0.2,1.2},{y,-0.2,1.2},{z,-0.2,1.2}]] Three planes divide the unit cube into 8 small cubes, ...
0
votes
0answers
49 views

Does Mathematica have a built-in n-dimensional hypervolume indicator?

Mathematica has so many functions hidden away in obscure packages that I thought I'd ask before starting to code one myself. Thanks in advance.
5
votes
4answers
341 views

Speed up the intersection of the diagonals of a regular polygon

I need to calculate all the intersection points of the diagonals of a regular polygon, following code is really slow, when n=15, it take about 30sec. I also tried using ...
1
vote
1answer
128 views

Checking Membership in Boundary of Conical Hull

I want to check whether a given point is also a member of the edges of a given conical hull. For example, I have: ...
0
votes
0answers
38 views

Increase precision of ConvexHullMesh

I want to generate a set of equations for all planes in the convex hull as specified in this question. The problem is that the generated set of equations don't correctly cover all the points. I run a ...
4
votes
1answer
103 views

Find intersection points of arbitrary BSpline curve

I'm researching some computational geometry and am trying to find a method of determining the {x,y} intersection of a circle and BSplineCurve for further processing. ...
1
vote
2answers
98 views

How to find the shortest distance between two regions?

I need to find the shortest distance between the two regions and the two points of the shortest distance, but the following code cannot achieve this requirement: ...
0
votes
0answers
43 views

Dump Curvature Information for 3d Models

Is anyone aware of any utility to generate and dump Principal, Gaussian and Mean Curvatures for a 3D Model or a set of points? I have reserched following tools - meshlab cloudcompare They are able to ...
1
vote
1answer
85 views

For an enclosed surface region, how to find the furthest point on that surface to another point that is not on that surface?

I have an enclosed 3D surface (a distorted sphere surface region, which is got by finding an enclosed contour of a 3D volumetric data, and apply RegionBoundary[BoundaryDiscretizeGraphics[ ]] to get ...
1
vote
0answers
80 views

Find the intersection coordinate of a line and a 3D surface defined by a contour plot

I have two points, for instance {1, 1, 1} and {10, 11, 15} that connected to form a line. I also have an enclosed surface region ...
5
votes
2answers
288 views

How to fill in interior in a mesh region

Say I have a mesh region which encloses a region. How do I get a mesh region where this region is filled? Take for example the meshregion below: ...
3
votes
2answers
101 views

Finding plane equations of planes in a convex hull

I'm new to mathematica and I need to get the equations for the set of planes which are part of a convex hull that I have calculated using ConvexHullMesh. It is a ...
6
votes
2answers
497 views

Finding the intersection(s) of a 3D parametric surface and a line

I have some 3D parametric curve par and some line line. I want to find parameters u,v and t for the intersection points of par and line. I tried to do that with NSolve in many different ways and ...
1
vote
0answers
53 views

Why does ConvexHullMesh give inconsistent output stuctures?

I know much of the stuff in ConvexHullMesh needs some TLC convexhullmesh-inconsistency But, can anyone see why this would produce inconsistent output: Case 1 (expected behavior): ...
1
vote
1answer
70 views

How to modify a particular step length in a 3D random walk?

Suppose I simulate a random walk in 3D using AnglePath3D[]: ...
0
votes
0answers
29 views

How to reorient a Sphere[] and associated point based on some arbitrary axis?

Suppose I have a unit Sphere[] sitting at the center {0,0,0}, with a point on its "north pole", like this one: ...
4
votes
1answer
62 views

VoronoiMesh with boundary edges removed

I would like to create a Voronoi diagram without the boundary edges highlighted. This code gVD = VoronoiMesh[X, MeshCellStyle -> {{1, All} -> {Thick, Red}}] ...
4
votes
1answer
134 views

Drawing a “realistic” VoronoiMesh

Consider a set of points generated via Lloyd's relaxation algorithm ...
1
vote
0answers
42 views

An apparent bug in Geometry`ConvexHull2

I was replacing some usages of Geometry`ConvexHull2 with ConvexHullMesh and found one of my tests failing. It turned out the ...
2
votes
1answer
55 views

Generating points inside convexhullmesh

How could I generate these points hexagon={{0, Sqrt[3]/2}, {1/2, Sqrt[3]}, {3/2, Sqrt[3]}, {2, Sqrt[3]/2}, {3/2, 0}, {1/2, 0}} following this rule ...
1
vote
2answers
80 views

How to Parallel submit nested do loop

This is the first time I'm trying to parallel compute something on Mathematica. So this question might be silly. I have a nested Do loop of the form: ...
3
votes
1answer
121 views

Hyper Tetrahedron in terms of inequalities

The command Tetrahedron[] seems to work fine for the 3-d case. But how can we get hyper-tetrahedron for 4-d case in terms of inequality? Take for example the points: ...

1
2 3 4 5
13