Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

8
votes
2answers
218 views

Catmull-Clark and Doo-Sabin Subdivision Implementations

I want to work on subdivision surfaces. Unfortunately, I don’t have any source code to start with. I need some Mathematica codes for applying Catmull-Clark and Doo-Sabin methods. I would like to ...
0
votes
1answer
35 views

Solve: line and rectangle intersections

I have been trying to find the intersections between a rectangle and a line, following the example given in the Solve function: ...
5
votes
1answer
49 views

Mesh cell count for Voronoi mesh too low

I was trying to solve this question out of interest and thought perhaps creating a Voronoi mesh, cropping it to a circle, and colouring the mesh cells might work. However, if I ask ...
0
votes
0answers
81 views

Graphics error in orthogonal trajectory

OT_Circles/Tractrices To find an orthogonal trajectory we generally replace slope by its negative reciprocal in its originating differential equation (DE). I.e., replacing $\phi\rightarrow \pi/2-\...
12
votes
2answers
254 views

Unexpected behavior of the procedure `Area` on the object 'Polygon'

Bug introduced in 11.3 or earlier and fixed on 12.0. Sometimes get a results, sometimes left unevaluated. For instance ...
4
votes
1answer
66 views

VoronoiMesh with custom distance function

I'm failing at reading the documentation. Is there a way to specify the distance function used by VoronoiMesh? As a stripped down example say I have a rank-1 lattice such as: ...
4
votes
2answers
118 views

Intersection lines of surfaces from list contour plots

I have two plots made with ListContourPlot3D. Is there a way to find the intersection curves of the surfaces represented in the two plots? I have tried ...
4
votes
1answer
109 views

Calculate total length of edges in select Voronoi diagram

I want to calculate the total length of edges in a Voronoi diagram like this I can calculate this with ...
5
votes
2answers
168 views

Draw bounding region by list of points

Suppose you have a list of data points, either in 2D or 3D; is it possible to plot the minimal bounding region containing all the points? Ignoring holes etc.
2
votes
2answers
108 views

Find the smallest and largest distance between two points distributed in 3D space

Suppose I have some 3D points, e.g. {{0, 0, 1}, {0, 0, 1.3}, {0, 1, 0}, {1.2, 0, 0}}. Now I want to find the smallest and largest distance between two points. A ...
1
vote
2answers
71 views

Trouble with Calculating Area of Parametric Region

This question stems from an attempt to solve the following question: How to calculate specific area on surface of sphere? First, I parametrize a circular loop: ...
4
votes
0answers
53 views

How to calculate specific area on surface of sphere?

I am trying to calculate the solid angle subtended by arbitrary-shaped loops on a sphere's surface. First, I parametrize circular loops by: $$\theta(t,k_{x0},r) = k_{x_0} + r \cos(t);$$ $$\phi(t,k_{...
6
votes
2answers
507 views

Calculate of total length of edges in Voronoi diagram

Does anyone have any suggestions how to determine the total sum of edges length in a Voronoi diagram?
1
vote
2answers
92 views

How to calculate arbitrary area on surface of sphere?

I am trying to calculate the solid angle subtended by arbitrary-shaped loops on a sphere's surface. First, I parametrize circular loops by: $$\theta(t,k_{x0},r) = k_{x_0} + r \cos(t);$$ $$\phi(t,k_{...
0
votes
0answers
103 views

Remove background image and redraw lines in black

I do not know if the title is correct. The image that I upload has liked me a lot because of the characteristic that no matter the angle it seems that it is looking at you, you could indicate me how ...
3
votes
2answers
541 views

How can find the 2D Voronoi cell area distribution?

I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?
1
vote
0answers
48 views

Create a Weighted Region

I am trying the make (not super accurate, just for fun really) simulations of light curves, as just circles with various sizes and temperatures, then computing the ...
3
votes
2answers
63 views

Delaunay triangulation for 3D - a list of connections

I have a problem with Delaunay triangulation in 3D. I know that the function DelaunayTriangulation[vector] does not work in case of three-dimensional vectors. But ...
12
votes
2answers
169 views

How to Interpolate a 3D MeshRegion?

If you were given some discrete MeshRegion called r (you don't know R): ...
1
vote
2answers
91 views

The easiest way to get centroids of triangles tiling sphere

I need to tile a unit sphere with N equal equilateral spherical triangles and get an array of the coordinates {Phi, Theta} of the centroids of those triangles. What is the most straightforward way to ...
3
votes
1answer
80 views

How to find the cells of a region that intersect a line?

I'm looking for the fastest way to access the mesh cell (i.e. polygon) in a Region that intersects a Line in 3D. For example, <...
0
votes
0answers
45 views

Uniform distribution on the manifold: There exist a build-in solution?

In general, the problem is to generate many random points on the (high-dimensional, compact, smooth) manifold ~~ uniform distribution w.r.t. lebesgue measure. So, this is a common in the Monte-Carlo ...
3
votes
1answer
127 views

Generate convex-hull of a 15 dimensional space

This question follows my last post. I have a function $ \vec{f}: S^6 \times S^6 \rightarrow \mathbb{R}^{13} $ defined on two 6-dim hyperspheres. We will denote the function $ \vec{f}(\vec{x},\vec{y}) ...
2
votes
2answers
67 views

Vertices of a Rotated Polyhedron

I am attempting to geometrically transform a polyhedron (namely rotate and translate the polyhedron in global coordinates) and than find the new vertices. Here is what I have so far, but I am stuck at ...
0
votes
0answers
56 views

How to write the code for a general B-spline function?

I write the code for B-spline basis and it works very nicely but now I need help to write code for general B-spline functions I would like the code to show the spline segment in this way:
6
votes
2answers
284 views

How do I verify a vector identity using Mathematica?

I am trying to verify well known Frenet–Serret formulas in general setting using Mathematica. I need to consider a general space curve $r(s)=(x(s),y(s),z(s))$ in $\mathbb{R}^3$ and define its unit ...
8
votes
2answers
119 views

Speeding up Nearest with multiple distance thresholds

Consider the following example of using Nearest: ...
4
votes
2answers
128 views

How to make a frustum of a cone

For finite element purposes I need a frustum of a cone with a finite wall thickness, i.e. a tapered pipe. To make a cone is easy ...
2
votes
1answer
104 views

Finding Intersections Between Arbitrary Surface and A Line

I have a self-intersecting surface H defined as follows: ...
0
votes
1answer
79 views

Why is RegionIntersection failing on my custom Region?

I load a custom region, specified as BoundaryMeshRegion R = Import["C:\\data\\Profile.stl", "BoundaryMeshRegion"] and I try ...
1
vote
1answer
64 views

ImplicitRegion evaluates the region incorrectly when it must be empty

Consider the following implicit region: ...
8
votes
2answers
200 views

Relative Neighbourhood Graph

Is there some way to efficiently compute the relative neighbourhood graph on $n$ Euclidean points in $\mathbb{R}^{d}$? Though one can simply define ...
3
votes
1answer
58 views

Extract Halfspace representation of a ConvexHullMesh

I have computed the convex hull of a set of points in $\mathbb{R}^{n}$ using ConvexHullMesh. This describes a convex polytope $\mathcal{P}$. I was wondering if there is any easy way of getting a ...
0
votes
0answers
101 views

How to evenly distribute points inside a sphere?

SpherePoints[] gives me a fairly even distribution of points on the surface of a sphere. However, following this, I can have a much better distribution (although ...
5
votes
3answers
142 views

How to get size of each polygon of a Voronoi diagram using Shoelace formula?

The following code gets all vertices of all polygons (mesh cells) of VoronoiMesh[pts]: ...
7
votes
3answers
189 views

Draw circles and compute <sum of circle areas>-<area of overlaps of the circles>

The following code draws the polygons of VoronoiMesh[pts]: ...
8
votes
2answers
148 views

Detect and fix invalid polygon

I have a polygon given by ...
7
votes
0answers
80 views

Higher order Laplacian flows

Given disjoint surfaces $q_i$ in 3D and their 1D boundary curves $\partial q_i = \gamma_i$, I seek a surface $p$ that joins the $q_i$, where $p \cup q_i$ forms a (piecewise) $C^k$ surface that ...
11
votes
5answers
523 views

Evenly spaced points on boundary of polygon

I have a polygon and I would like to generate $n$ evenly spaced points along the boundary.
5
votes
1answer
81 views

How do I plot a distance map in $R^2$ to a curve given in form $y=f(x)$?

As in the title, I'd like to display image using DensityPlot representing distance to a given curve, e.g., $y=x^2$. I find it difficult to derive distance ...
10
votes
3answers
223 views

RegionMember[ ] in polygon

Bug introduced in 10.0 and fixed in 12.0. I am seeing a difference in RegionMember[ ] testing a point inside a 3-vertex polygon and testing a point inside a more ...
0
votes
1answer
43 views

What are some good ideas on how to Map a Replace function over a list of equations?

I've been working on a rather simple implimination of parameterizing a 3D line in space, and now am trying to find a way to map different values of t over those ...
4
votes
3answers
223 views

How can I get the vertices of each polygon of a Voronoi diagram?

For the following image; How can I get the vertices (which are highlighted by orange dots) of each Voronoi polygon of the following Voronoi diagram? The picture is from the Internet. It is just for ...
13
votes
2answers
449 views

Project map to a particular shape

I want to project a map to a particular shape, like a circle or ellipse. For example, let's imagine we want to project a map of the continental United states so that its outline is that of a circle. ...
4
votes
3answers
383 views

Drawing the Pursuit curves

I was reading this post on Filling Space with Pursuit Polygons. I didn't really see where the filling was, but found it quite interesting. Then I saw these pursuit ...
3
votes
1answer
37 views

How to get the coordinates of the 4 vertexes of a GeoListPlot?

I have a GeoListPlot as below. How can I get the latitude/longitude coordinates of the 4 vertexes of the GeoListPlot? I need the ...
2
votes
1answer
50 views

How to retrieve updated point coordinates that have been scaled or translated?

I'm sort of building off my previous question but the conditions of the points I'm trying to recover are different and therefore that solution is no longer applicable. Given said data, I'm trying to ...
10
votes
2answers
173 views

How to return the coordinates of the respective 3 vertexes of a DelaunayMesh's face?

I have a set of points pts1 and a point redPts as below:- ...
14
votes
3answers
588 views

Crop a Voronoi diagram and get a proper MeshRegion

How can I crop a VoronoiMesh (or any similar MeshRegion) to a non-rectangular region and receive the output as a ...