Questions on constructing graphical objects using relatively complex computations relating to the mathematical structures defining those objects. Examples include convex hulls, mathematical constructions, symmetries, genuses of curves and graphs and programmatic constructions of polyhedra.

learn more… | top users | synonyms

93
votes
3answers
12k views

How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...
67
votes
4answers
5k views

How to peel the labels from marmalade jars using Mathematica?

How can I detect and peel the label from the jar below (POV, cylinder radius, jar contents are all unknown) to get something like this, which is the original label before it was stuck on the jar? ...
45
votes
10answers
8k views

How to check if a 2D point is in a polygon?

Background: I use code from An Efficient Test For A Point To Be In A Convex Polygon Wolfram Demonstration to check if a point ( mouse pointer ) is in a ( convex ) polygon. Clearly this code fails for ...
43
votes
2answers
6k views

How can I calculate a jigsaw puzzle cut path?

I want to generate a path to cut an arbitrary shape into a set of jigsaw puzzle pieces. All pieces must be unique to preclude placing a piece in the wrong spot. Pieces must be interlocking such that ...
34
votes
7answers
4k views

Intersecting graphics

Does the Mathematica graphics system have any concept of intersecting graphics? I've not found much in the documents so far. For example, if I want to show the intersection of two shapes: ...
29
votes
8answers
4k views

Circuit drawing in Mathematica

This past semester I taught an introductory electromagnetism course and had quite a nice time using Mathematica to draw all sorts of figures and diagrams (mostly for problems and etc.). However, I was ...
27
votes
3answers
1k views

Create a torus with a hexagonal mesh for 3D-printing

I am new to Mathematica, and I'm looking for a way to create patterns on the surface of 3D objects. One thing I have not been able to do is create a hexagonal mesh on a torus. What I would like to ...
27
votes
2answers
1k views

Animating a Voronoi Diagram

edit: Excellent answers have been provided and I made an animation which is suitable for my use, however, all the examples rely on bitmap/rasterized data; is there a vector based approach? I would ...
26
votes
5answers
940 views

Voronoi diagrams for generators other than points

Any suggestions how to determine Voronoi diagram for sites other than points, as e.g. in the picture below? Input is a raster image.
25
votes
3answers
2k views

Creating a 2D meshing algorithm in Mathematica

As what is proving to be a difficult, but entertaining task, I am attempting to adapt a 2D meshing algorithm created for MATLAB and port it to Mathematica. I understand meshing functions already exist ...
21
votes
4answers
2k views

Efficiently determining if 3D points are within a surface composed of polygons

This is the 2nd part of a previous question which I edited to make into 2 separate questions: Extracting polygons from 3D contour plot surface As an extension of my earlier question involving simple ...
21
votes
1answer
888 views

How to create regular (planar) graphs?

How to programmatically create and plot regular planar graphs with $k = 3, 4$ or $6$ (not hypercubes) and regular nonplanar graphs of $k = 8$ (see figure)? Note that what matters is the average ...
20
votes
5answers
919 views

How can I define a 3D version of the built-in VoronoiDiagram (VoronoiMesh in V10) function?

Can anybody point me in a direction that will guide me to extend the VoronoiDiagram function in Mathematica to handle 3D (three dimensional) situations (i.e. points in 3D)? Any help will be greatly ...
19
votes
3answers
736 views

Build a refined grid based on intersecting line

I honestly have no idea where to begin with this problem. In summary, I have a 2D coarse grid with an intersecting line. For an easy example, let's assume it's a 4x4 grid. I wish to pass through ...
19
votes
2answers
575 views

Movable text on a curve

Having an arbitrary curve defined as InterpolatingFunction, what is the best way to place a text on this curve? The text generally has two rows, for example: ...
19
votes
2answers
1k views

Efficient way of finding shortest distance between two sets of points in mathematica

I have two sets of 3D points, say a = RandomReal[1, {10, 3}]; b = RandomReal[1, {10, 3}]; I wanna find the first N pairs that have shortest distance between the ...
17
votes
4answers
736 views

How to calculate the volume of a convex hull?

Given a spatial curve represented by a parametric equation, is it possible in Mathematica 9 to calculate symbolically (or at least numerically) the volume of its convex hull?
17
votes
3answers
2k views

How to calculate volume of convex hull and volume of a 3D object

I have a set of random 3D data points. How can I calculate the volume of the convex hull?
16
votes
5answers
1k views

How to speed up the function DelaunayTriangulation?

First define a function meshGrid to generate some points: ...
16
votes
3answers
689 views

Procedure to find direction of triangle

I'm trying to write a procedure or function to find the direction in which a 2D triangle points. The triangle is assumed to be isosceles. While I can see the basic outline of what I want to do, making ...
16
votes
2answers
1k views

Generating convex polyhedron from face planes?

Suppose I have lists of normals and points for planes. There's a convex polyhedron whose faces lie on these planes and are bounded by plane intersections. What would be the easiest way to produce an ...
16
votes
1answer
699 views

How can the {x,y,z} points that fall on the outer boundary of a set of values be selected and smoothly surfaced?

For a given set of x,y,z values, that may, or may not form a uniform shape, how can the center of the data cloud be found, and the surface points be located and a solid smooth surface created from ...
15
votes
3answers
676 views

Generate a Random Polygon

Does some package exist with a function that takes a parameter $n$ and generates a random 2D $n$-sided simple polygon (convex or non-convex), possibly within a certain bounding box? It does not ...
15
votes
3answers
1k views

How to get actual triangles from DelaunayTriangulation[]?

The ComputationalGeometry package has a DelaunayTriangulation[] function. It returns a list of points connected to each point, ...
14
votes
2answers
779 views

Implementation of Balaban's Line intersection algorithm in Mathematica

I'm trying to implement a Brillouin Zone algorithm within Mathematica, including the generation of Brillouin zones of higher order in 2D and 3D. There is a nice implementation of generating these ...
14
votes
2answers
1k views

Checking if a point is in a convex 3D polyhedron

Extending from these questions How to check if a 3D point is in a planar polygon? and How to check if a 2D point is in a polygon?. I'm trying to do this to render specific shapes made up of spheres. ...
14
votes
2answers
348 views

Equidistant points on a polyline

Set of 2D-points connected by a polyline B-spline function: ...
13
votes
1answer
416 views

rule-based implementation of an algorithm

When I first started learning about rule-based programming with Mathematica, I tried to translate this algorithm for computing the convex hull of a set of 2-D points in $O(n \log(n))$ time, to use ...
12
votes
3answers
636 views

How to determine the convex hull of some text?

How can I get the co-ordinates of the convex hull of a piece of Text?
12
votes
4answers
329 views

Arranging connector lines

Heike gave an absolutely wonderful answer to my question about arranging subplots around a main plot and including connector lines. This is the result: Starting from Heike's answer, what is the ...
11
votes
3answers
1k views

Computing the genus of an algebraic curve

How-to compute the genus of an algebraic curve in Mathematica ? In my case the algebraic curve is explicitly defined by a polynomial.
11
votes
2answers
945 views

Finding a Concave Hull

I have a 3d clustered data: Is there any other way to get concavehull of 3D data points?
11
votes
2answers
2k views

Graphics3D: Finding intersection of 3d objects and lines

I found these two nice links 1) intersecting graphics 2) Implementation of Balaban's Line intersection algorithm in Mathematica which works for 2d. However, I need to find whether a ray(line) ...
11
votes
1answer
236 views

Finding minimal region with padding and linear map to circle

Suppose I have n ordered points. I would like to find a simple region that contains all the points and is close to the smallest region that contains the points except it is smooth and has some ...
11
votes
1answer
638 views

Proving inequalities with Mathematica

Question summary: I would like to learn some tips and tricks on how to prove inequalities with Mathematica. I'm studying various inequalities in triangle that have the form $R+ar + bs\geq 0$, where ...
10
votes
3answers
487 views

Insphere for Irregular Tetrahedron

I am looking for existing Mathematica code to compute the unique sphere inscribed inside an irregular tetrahedron. I can write it myself, but I would love to find that someone already performed this ...
10
votes
2answers
258 views

Probable Bug in ConvexHullMesh

Consider points taken from the following parametric plot. See this question ...
10
votes
1answer
306 views

Has anyone implemented cohomology for complex manifolds?

I'm investigating the cohomology of complex manifolds, and need to construct chain complexes, Mayer-Vietoris sequences etc. I use Mathematica for numerically tracing manifolds with geodesics, but ...
8
votes
2answers
1k views

Create triangular mesh from random list of points

I have a list of points. I would like to take these points and create a mesh of triangles from them, making sure triangles don't overlap. So here's a list of points: ...
8
votes
1answer
354 views

Finding the perimeter, area and number of sides of a Voronoi cell

Does anyone have any suggestions how to determine the perimeter, area and number of sides of each Voronoi cell in Voronoi diagram?
8
votes
3answers
1k views

Randomly packing spheres of fixed radius within a cube

How can I have Mathematica randomly place spheres in a cube so they won't overlap? The cube is $20 \times 20 \times 20$, and the spheres have a radius of $0.7$.
7
votes
4answers
369 views

Distances between points in periodic cube

How can one implement more efficiently/elegantly/memory savvily the following function which returns a matrix of all Euclidian distances between points in 3D within a cube of width ...
7
votes
6answers
1k views

How do I draw a hemisphere?

I want to draw a solid or partially transparent hemisphere above a partially transparent cuboid object in Graphics3D. However, I do not know how to do this s.t. only half the sphere is drawn. Here's ...
7
votes
3answers
905 views

Convex hull of a 3D object?

I am trying to find a convex hull command for a Graphics3D object. Does it exist in Mathematica? ...
7
votes
3answers
366 views

I can't understand FindShortest Tour

I can't understand the function FindShortestTour because of the result: FindShortestTour[{ {0, 1}, {5, 1}, {2, 1}, {10, 1}}] ...
7
votes
1answer
260 views

Implementing an algorithm for finding the largest circle that contains a single point in a set (and no other point)

This question concerns the implementation of an algorithm proposed by Rahul Narain on a former question of mine that was migrated to math.stackexchange: ...
6
votes
3answers
678 views

Generating a non-convex polyhedron from a list of vertex coordinates

I want to include a figure in a paper I am writing on Combinatorial Geometry which features a non-convex polyhedron given by the following vertices, EDIT: I was unaware that Mathematica could convert ...
6
votes
2answers
354 views

How to get UV mapping of 3D tube

Here is cylinder data: file We can mesh the surface, thanks to lalmei, Belisarius and Simon (link) How to achieve uv mapping from a 3d straight and curved tube? Working code: ...
6
votes
2answers
1k views

How to check if a 3D point is in a planar polygon?

Following up on ndroock1's question, I naively tried to apply the solutions to a 3D point and polygon and they didn't work. For example, functions involving ArcTan ...
6
votes
3answers
426 views

How to ensure that Polygon[list] plots a simple polygon?

Consider the following code which plots a triangle. p = {{0, 0}, {.2, 0}, {0, .2}}; {Cyan, Polygon[Dynamic[p]]} // Graphics Then adding (for example) ...