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
2 votes
1 answer
96 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 ...
11 votes
2 answers
333 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. ...
  • 217
5 votes
1 answer
124 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 ...
  • 18.4k
5 votes
3 answers
168 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 ...
  • 303
6 votes
2 answers
223 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. ...
  • 569
4 votes
1 answer
70 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: ...
  • 1,563
3 votes
1 answer
176 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, ...
  • 303
4 votes
2 answers
202 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 ...
  • 303
5 votes
1 answer
110 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: ...
  • 1,599
0 votes
0 answers
72 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 ...
3 votes
2 answers
328 views

Volume of the intersection and union of two spheres

I'd like to calculate the volume of the intersection and the union of ...
  • 18.4k
4 votes
2 answers
214 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, ...
0 votes
0 answers
158 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 ...
  • 43
16 votes
5 answers
915 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 ...
  • 447
5 votes
1 answer
194 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 ...
  • 1,498
4 votes
1 answer
130 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. ...
  • 2,484
8 votes
1 answer
221 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 ...
  • 24.6k
5 votes
1 answer
163 views

How to combine several surfaces into a solid and compute its volume?

plot1 is taken from the BSplineSurface document. I add two Disk ...
2 votes
0 answers
51 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 ...
  • 5,089
1 vote
1 answer
106 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 ...
2 votes
1 answer
65 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 ...
5 votes
5 answers
464 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, ...
  • 127
3 votes
1 answer
55 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: ...
  • 332
3 votes
1 answer
111 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? ...
  • 332
0 votes
0 answers
62 views

RegionCentroid giving different result on Polygon and ConvexHullMesh

I have the following 5 vertices: ...
13 votes
1 answer
370 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: ...
  • 24.6k
5 votes
0 answers
62 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 ...
1 vote
2 answers
105 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 ...
  • 8,598
4 votes
1 answer
166 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) ...
  • 157
1 vote
1 answer
90 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 $...
  • 1,599
13 votes
4 answers
451 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 ...
  • 4,984
5 votes
1 answer
124 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, ...
  • 4,388
8 votes
2 answers
244 views

MorphologicalEulerNumber misbehaving in 3D?

Context I would like to compute the MorphologicalEulerNumber of 3D GaussianRandomField as a function of height above a given threshold. Attempt I proceed as follows:...
  • 22k
2 votes
1 answer
82 views

Table of surface Parametric draw

I'm trying to reproduce this kind of graph for a spherical cap, with different span ratios. I tried with this: ...
1 vote
1 answer
151 views

How to use VectorAngle[] in AnglePath3D[]?

Suppose I have a specific angle that I calculate from two vectors, in 3D: ...
  • 1,563
5 votes
1 answer
156 views

Problem with RegionMember

I think there is potentially a bug in RegionMember function, particularly in the RegionMember[reg] form. Can you evaluate the ...
  • 8,598
0 votes
2 answers
119 views

How to align two ellipsoids along center and long axes?

I'm struggling to understand rotation/translation transforms as applied to things like spheres and ellipsoids. Take the following silly example. Given this pair of random ellipsoids, how do I find a ...
  • 1,563
1 vote
2 answers
110 views

Transfer distribution of points on a sphere to an Ellipsoid[]?

I've seen this cool function, which generates a given distribution of points on the unit sphere, known as Dimroth-Watson distribution: ...
  • 1,563
0 votes
0 answers
102 views

Computations on differential geometry

I have to do some really long computations of basic riemannian geometry. I am trying to use Mathematica to check them. This is the kind of computations I want to do. Let $M$ be a riemannian manifold ...
1 vote
0 answers
61 views

Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
  • 1,923
2 votes
3 answers
125 views

Find sum of positive geometric progression numbers

I have a task to get the total number of games played in a soccer tournament. Apart from the group stages, I observed that the number of games played in each round from the knockout round down to the ...
4 votes
1 answer
119 views

Analogue of SpherePoints in higher dimensions?

I'm looking for an analogue of SpherePoints that works in dimensions higher than 3, has this been created already? A random sample from unit ball will be ...
6 votes
1 answer
114 views

How to generate an heterogeneous mesh

I'd like to generate a mesh with a big variance in cell size. Something like I'd prefer not to rely on a vertex model and perhaps use something simpler, like ...
  • 4,388
2 votes
1 answer
99 views

Efficient way to pick up pairwise vertices of certain Euclidean distance in arbitrarily dimensional coordinates? [closed]

I have a grid graph with x and y vertices in each direction. The 2-dimensional coordinates of the graph ...
  • 1,566
2 votes
0 answers
84 views

Inner polygon approximation

Suppose you want to perform an inner approximation of a planar semialgebraic set by a finite set of polygons. The following is a quick way to yield an approximation but I am not convinced that it is ...
3 votes
1 answer
87 views

Does DelaunayMesh use exact computations? What is the treatment of non-generic cases?

Computing Delaunay complexes can be sensitive to numerical instabilities, especially in higher dimensions. I would like to know how much I can rely on Mathematica's answers when using ...
5 votes
2 answers
311 views

Generate Aztec triangle of size n automatically?

In the paper titled "Perfect Matchings of Cellular Graphs" by Mihai Ciucu, the Aztec triangle of size n (n= 1, 2, 3, 4, 5, ...) is equivalent to a ...
  • 1,566
6 votes
2 answers
184 views

Automatically get points in a given triangular lattice and vice versa?

Given a triangular lattice which grows with number n, as follows I want to list all the connected points in the lattice to form the ...
  • 1,566
0 votes
1 answer
177 views

How do you calculate the area of a surface with edges in mathematica

Like the title indicates, how could I achieve this. Normally what I did for a closed surface is as follows: ...
  • 367
3 votes
1 answer
74 views

BoundingRegion also bounding outliers. Can I apply a standard deviation filter?

I'm using BoundingRegion to classify a list of data points using ellipsoid shapes. BoundingRegion tends to make sure that all points fit in the shape, including outlier points. Is there a way to ...
  • 465

1
2 3 4 5
14