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
1 answer
260 views

Complex infinity at a point and division by zero

Edit: I've found out that the book was written for Mathematica 7, which was a pretty long time ago. It boils down to changes in syntax most probably, but simple renaming to lower lettercase does not ...
Kandrax's user avatar
  • 77
0 votes
0 answers
50 views

Triangulations of a convex polygon

I have a piece of code which finds all triangulations of a convex polygon. It is known that a number of such triangulations for a given $n$-gon is is given by ($n-2$)th Catalan Number, so for instance,...
amator2357's user avatar
  • 1,274
1 vote
2 answers
81 views

Problem defining a polygon

I have two polygons that are very similar as: ...
NinjaCowAndForks's user avatar
4 votes
3 answers
214 views

Deleting the same lines from a list

Say I have a list of Lines: ...
amator2357's user avatar
  • 1,274
2 votes
2 answers
148 views

Fill points into a pre-rotated convex Dodecahedron

I am trying to fill a rotated convex polyhedron with points. This functions well in the unrotated case: ...
Jeff71's user avatar
  • 75
3 votes
0 answers
196 views

Ideas for visualizing the shape of a random walk

Context: In the context of (3D) random walks or polymer chains, a useful quantity for capturing and characterizing the shape of the walk or the conformation of the polymer in space is the gyration ...
user avatar
11 votes
2 answers
1k 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 ...
Rong Jin's user avatar
  • 113
0 votes
1 answer
190 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: ...
saimon's user avatar
  • 47
6 votes
1 answer
121 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 ...
MassDefect's user avatar
0 votes
0 answers
140 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-\...
Narasimham's user avatar
  • 2,972
12 votes
2 answers
297 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 ...
Slepecky Mamut's user avatar
4 votes
1 answer
156 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: ...
MB Reynolds's user avatar
4 votes
2 answers
335 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 ...
Prof. Smith's user avatar
5 votes
1 answer
244 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 ...
Mati Ger's user avatar
  • 143
5 votes
2 answers
657 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.
MKF's user avatar
  • 581
4 votes
2 answers
636 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 ...
Quantum_Magnet's user avatar
4 votes
3 answers
537 views

Cutting a section from a sphere by planes

I want to plot and find out the section of a sphere remaining after putting constraints in terms of cartesian planes. How it can be done? For example, if I have a sphere of $r = 1$, and I put the ...
user49535's user avatar
  • 1,103
2 votes
2 answers
236 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: ...
TribalChief's user avatar
6 votes
1 answer
431 views

Construct a section (or slice) through 3D Regions

I would like to draw a section through some 3D regions. I start by making some simple 3D regions as a minimum working example. ...
Hugh's user avatar
  • 15.7k
6 votes
2 answers
652 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?
Mati Ger's user avatar
  • 143
4 votes
3 answers
588 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_{...
TribalChief's user avatar
3 votes
1 answer
250 views

RegionUnion for 3D Regions

I make two regions and then find I can't combine them using RegionUnion. Here are the two regions. ...
Hugh's user avatar
  • 15.7k
0 votes
0 answers
155 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 ...
Walter 's user avatar
  • 149
4 votes
2 answers
988 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?
massimo's user avatar
  • 41
1 vote
0 answers
66 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 ...
Brandon Myers's user avatar
4 votes
1 answer
154 views

Creating Voronoi Mesh Region Bounded by Convex Hull (Possible problem with DiscretizeGraphics)

I want to create a MeshRegion that is VoronoiMesh bounded by the associated ConvexHullMesh. I followed the procedure in the answer for this post, but the resulting MeshRegion is very wrong. This is ...
GibBits's user avatar
  • 43
3 votes
2 answers
287 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 ...
Kamil17's user avatar
  • 33
14 votes
2 answers
324 views

How to Interpolate a 3D MeshRegion?

If you were given some discrete MeshRegion called r (you don't know R): ...
M.R.'s user avatar
  • 30.9k
1 vote
2 answers
266 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 ...
user15933's user avatar
  • 173
3 votes
1 answer
314 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, <...
M.R.'s user avatar
  • 30.9k
2 votes
2 answers
127 views

How to output the level of the contour plot based on the desired area enclosed in the contour level?

I am a beginner using Mathematica. I am doing a physics experiment that involves this 3D surface; the function $ f(x, y) $. I need a program that can give me the contour level in the $ z $-axis which ...
Steve Gordan's user avatar
0 votes
0 answers
61 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 ...
Slepecky Mamut's user avatar
3 votes
1 answer
202 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}) ...
apt45's user avatar
  • 1,598
2 votes
2 answers
254 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 ...
Novice's user avatar
  • 21
0 votes
0 answers
197 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:
Muhammad's user avatar
6 votes
2 answers
455 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 ...
Bumblebee's user avatar
  • 359
8 votes
2 answers
405 views

Speeding up Nearest with multiple distance thresholds

Consider the following example of using Nearest: ...
Szabolcs's user avatar
  • 231k
4 votes
3 answers
406 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 ...
Hugh's user avatar
  • 15.7k
3 votes
1 answer
429 views

Finding Intersections Between Arbitrary Surface and A Line

I have a self-intersecting surface H defined as follows: ...
TribalChief's user avatar
0 votes
1 answer
142 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 ...
Anatoly's user avatar
  • 409
1 vote
1 answer
185 views

ImplicitRegion evaluates the region incorrectly when it must be empty

Consider the following implicit region: ...
John Taylor's user avatar
  • 4,866
8 votes
2 answers
711 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 ...
apg's user avatar
  • 1,713
6 votes
2 answers
147 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 ...
Mario E. Villanueva.'s user avatar
0 votes
0 answers
465 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 ...
user36426's user avatar
  • 3,155
6 votes
1 answer
176 views

Simplify behavior: assumption as Interval versus assumption as bounds

I am using MMA V11.2 under Linux I am surprised by this: ...
Picaud Vincent's user avatar
3 votes
1 answer
52 views

Plot variations in geometric sum within prescribed range

I have a simple geometric sum: Sum[a^(j + 1), {j, 1, k}] which evaluates to (a^2*(-1 + a^k))/(-1 + a) ...
Richard Burke-Ward's user avatar
1 vote
2 answers
199 views

How to get intersection points between "each line" and "multiple circles intersected with that line"?

The following code is used to draw circles; ...
Eman's user avatar
  • 199
6 votes
3 answers
449 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]: ...
Eman's user avatar
  • 199
7 votes
3 answers
275 views

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

The following code draws the polygons of VoronoiMesh[pts]: ...
Eman's user avatar
  • 199
9 votes
2 answers
312 views

Detect and fix invalid polygon

I have a polygon given by ...
sunt05's user avatar
  • 4,277

1
3 4
5
6 7
15