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
0
votes
0answers
63 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
33 views

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

I am trying to implement Fortune's Algorithm. Here is my code so far. ...
3
votes
0answers
87 views

What is the best approach to find the nearest line segment (x1,y1),(x2,y2) from an point (x,y)? [migrated]

Let's suppose the are 3 line segments in 2D, each line segment has coordinates (x1,y1) and (x2,y2). What is the best approach to find out the nearest line segment from a point (x,y)? Hint: use vectors ...
17
votes
3answers
486 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
114 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
185 views

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

It's easy to generate random lines, such as this ...
2
votes
0answers
33 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
45 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
118 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
66 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
115 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
98 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
107 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
123 views
2
votes
6answers
286 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
95 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
131 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
129 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
49 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
82 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
300 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
45 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
332 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
120 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
36 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
94 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
94 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
35 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
74 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
73 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
244 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
91 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
475 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
50 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
63 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
28 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
55 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
126 views

Drawing a “realistic” VoronoiMesh

Consider a set of points generated via Lloyd's relaxation algorithm ...
1
vote
0answers
39 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
52 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
73 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
109 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: ...
2
votes
1answer
72 views

Region bounded by planes in terms of inequalities

Suppose I have 5 planes that intersect to give a bounded region in 4D. For example, the planes are x1==0; x2==0; x3==0; x4==0; x1+x2+x3+x4==1; ...
3
votes
1answer
51 views

Convert ConvexHull in a array to Inequality

This question is in continuation with the previous post Convert ConvexHull to Inequality There are two problems that I faced. Suppose we have two or more convex hull defined using an array R[i], like ...
7
votes
1answer
198 views

Convert ConvexHull to Inequality

I have the following convex hull. P0={0,0,0}; P1={1,0,0}; P2={0,1,0}; P3={0,0,1}; ConvexHullMesh[{P0,P1,P2,P3}] Now I want the region algebraically as equality ...
1
vote
0answers
40 views

Image Size change with changing ViewPoint

I have the following code to show the intersection of two convex hulls. The plot has no problem when ViewPoint->Default. But when I try to change the viewpoint manually by holding and dragging the ...
1
vote
1answer
49 views

How to label vertex of a 3D convex hull?

I have the following code to plot a 3d convex hull with 4 corners only. ...
3
votes
3answers
70 views

A DistanceFunction for use with a mouse in a DynamicModule

I need to have a mouse cursor that identifies points that are close to the mouse position on a graphics plot. The difficulty is that the scaling of the plot makes this difficult. I think I am missing ...
7
votes
1answer
131 views

RandomPoint inside mesh for walk-on-spheres Monte Carlo PDE solver

I'm trying to understand a Monte-Carlo Laplace/Poisson PDE solver: http://www.cs.cmu.edu/~kmcrane/Projects/MonteCarloGeometryProcessing/paper.pdf This method inspired by random-walks and ray-tracing ...
3
votes
0answers
44 views

DelauneyMesh in 4d and higher

Is there any way to find the DelauneyMesh in 4D (or higher)? Its documentation implies that it should be possible "A Delaunay mesh consists of intervals (in 1D), ...

1
2 3 4 5
12