# Tagged Questions

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 ...

306 views

### How to implement Bresenham’s algorithm as a system of equations?

Bresenham's line drawing algorithm is usually implemented via loops. But in Mathematica we can take advantage of its ability to solve Diophantine equations. From educational viewpoint it is quite ...
1k views

### Construct a simple mesh or tetrahedral mesh from 3D image surface

I have a 3D Y-Shape hollow tube, not so good surface. Import["http://dl.dropbox.com/u/68983831/tube02.vtk", "Graphics3D"] I tried to use following vertex data ...
4k views

### Mathematica function intersection points with 3D grid

I need to produce a 3-dimensional equispaced grid over a given function in a way, that I can calculate intersection points of the function with the grids edges. So my first question is how to produce ...
468 views

### ListPlot3D of a set of points in a non-convex region

I would like to plot a set of points in the same style as ListPlot3D does, but only in a non-convex region that I can specify (e.g. using a ...
2k 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 ...
239 views

### Decomposition of a semialgebraic set into connected components

Is there any built-in function for doing decomposition of a semialgebraic set into connected components? The only way I now can think of is to use ...
284 views

### Can't plot rotated region

I was experimenting with the code from this question when I ran into another problem with regions. ...
347 views

### Selecting for 2D points that are within a threshold distance of an upper- and lower-bound number of points

I have a very large set of 2D points: numberOf2DPoints = 10^6; pointList = RandomReal[{0, 1000}, {numberOf2DPoints, 2}]; I'd like to find a way to quickly ...
127 views

### Differential Geometry on a MeshRegion [closed]

NB- see this question for a more formal request. For many many years (honestly, since 1987) I've had my own MMa computational geometry code for dealing with 3D meshes. I principally (there's a joke ...
463 views

### Calculate scalar potential from electric field

Is it possible for Mathematica to solve an equation like $\nabla f(\mathbf{r}) = - \mathbf{E}(\mathbf{r})$ for $f(\mathbf{r})$? I tried ...
2k 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?
967 views

### Is there a simple strategy to determine whether a point is inside a boundary?

For a ellipse $E(\theta)$, which owns the parametric equation as follows: $\begin{cases} x = a \sin\theta + b \cos\theta + c \\ y = d \sin\theta + e \cos\theta + f \\ \end{cases}$ Now, I have a ...
267 views

### Administrative Divisions bordering a geographic region (e.g. an ocean)

Update 3 I've worked out a solution that is bearable for a small number of subregions in the neighbour and added it as an answer. I'm going to make a post for optimisation help. Update 2 For a ...
887 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?
1k views

### Extracting polygons from 3D contour plot surface

Edit: This question turned out to be two parts so I am going to make this question about only the first part a kguler provided an excellent answer. Here is a better representation. My actual data ...
537 views

### Find the volume of Phobos and Deimos

How can we calculate the volume of a 3D object using the new-in-10 computational geometry functions? For simple objects this works: ...
164 views

### RegionNearest and neighborhoods

In this previous question we see that RegionNearest isn't quite as 'capable' as Nearest for some things. Similarly, I need to ...
407 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 "...
206 views

### Regression /Bug in DelaunayMesh from 10.3.1 to 10.4

Bug introduced in V10.4 and persists through 10.4.1 In answering this question, I realized the OP and I were obtaining different results from the alphaShapes2D ...
551 views

### How to speed up estimation of Mean and Gaussian curvatures on triangular meshes?

I am trying to estimate curvatures on a triangulated surface/manifold using the algorithm of : Meyer, M., Desbrun, M., Schröder, P., & Barr, A. H. (2003). Discrete differential-geometry operators ...
258 views

### Possible Bug in ArrayMesh

Bug introduced in V10.4 and fixed in 10.4.1 Suppose we have the following array from which we intend to create an ArrayMesh: ...
254 views

### Why is DiscretizeGraphics missing points on my curve?

I have a graphics expression which renders nicely as a closed curve when put in Graphics, I don't understand why I can't get the lines from DiscretizeGraphics or ...
164 views

### How to generate higher dimensional convex hull?

I like the function ConvexHullMesh very much, since I often need to take a look at the convex hull of points in 2D and 3D, which as an example can be generated and ...
673 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 ...
531 views

### Cropping a Voronoi diagram

Someone know how can I get the correct crop of this Voronoi image using RegionFunction? As you can see, there is a lot of undesired white regions inside the left ...
177 views

### User-defined DistanceFunction for RegionNearest

In the function Nearest , I can define my custom function using the DistanceFunction option. e.g: ...
256 views

### Lloyd relaxation on VoronoiMesh

How can we apply Lloyd's relaxation algorithm to a VoronoiMesh? Thanks. UPDATE Thanks a lot KennyColnago for your answer. Based on Simon Woods suggestion of ...
273 views

### ToElementMesh problem on Ball defined by ImplicitRegion?

Bug introduced in 10.0 and fixed in 10.2 Could any one please confirm the following bug in mathematica 10.0.2 ? If I define this ball ...
148 views

### How to assign Element marker at boundary edges

How to assign marker at the boundary edges as 1, 2, 3, 4 respectively and set all of the inside elements of region as 0? for example: Code: ...
161 views

### How to convert a graph to a mesh region

As we know,the region is very convenient in Mathematica.And we can convert a MeshRegion into graph like this ...
229 views

### Separate boundaries of multiply connected region

I have a multiply connection two-dimensional region such as the following: br = BoundaryDiscretizeGraphics@Graphics[Disk[#, 8/9] & /@ CirclePoints[9]] I am ...
254 views

### Finding corresponding vertex from 3d to 2d

I have this simple 3d data points: ...
283 views

### “The function DiscretizeGraphics is not implemented for GraphicsComplex” confusion

Why does DiscretizeGraphics seems to work on one GraphicsComplex and not the other? Here is an example that works: ...
762 views

### Collision detection algorithm (discrete) with sweep and prune algorithm

For a more complex collision detection approach, I need an efficient (aka fast) algorithm to prune the elements by using boundary boxes. A classical algorithm is the so called sweep and prune (SAP) ...
106 views

### Inflate and unite a list of 0D to 2D regions

I've got a List of BoundaryMeshRegions, created via ConvexHullMesh: ...
358 views

### Bug in ArcLength?

fixed in 10.1 (windows) With Mathematica 10.0.2: ArcLength[Line[{{0, 0}, {1, 0}, {2, 0}}]] ArcLength[Line[{{0}, {1}, {2}}]] (* 2 *) (* 2 *) However, ...
147 views

### Possible Bug in Computing Surface Area of Certain Geometric Regions

Mathematica 10.2 introduced some new geometric regions. Two of the new regions include SphericalShell and CapsuleShape. ...
90 views

### MeshCoordinates from a RegionBoundary no longer in proper order in version 10.4

Bug introduced in V10.4 and persists through 10.4.1 Given that I have the following data set ...
335 views

### Behavior of GraphicsMeshInPolygonQ with self-intersecting polygons

Playing around with some of the answers in the question How to check if a 2D point is in a polygon? I noticed that: GraphicsMeshInPolygonQ[poly,pt] Displays ...
136 views

### MeshRefinementFunction missing points

I'm doing some FEM on a rectangular region with a spherical cavity: ...
773 views

### Image processing: extracting ordered contour

Continuing the question How to extract the edge from a set of points and its answer by Simon Woods, I would like to ask if there is a way to extract the boundary of obtained as ...
85 views

### ParallelTable slow down, Region functions

I am experiencing speed issues with ParallelTable. There are a few related problems on SX posted here and here, but no resolution. The various respondents to those ...
405 views

### A GraphicsMeshConvexHull[] peculiarity

I have been unable to explain the behavior of GraphicsMeshConvexHull[] on the following (highly simplified) example: ...
135 views

### Visibility Graph of Polygon

Could anyone provide a function that takes a polygon as input and outputs its visibility graph ? Visibility Graph If not, is there a function that checks whether a line segment lies inside a polygon?
75 views

### MaxCellMeasure fails in 3D?

Question How come MaxCellMeasure works in 2D but fails in 3D? Indeed if I try ...
463 views

Is there a way to convert a Delaunay Triangulation into a Graph structure so that one can generate an AdjacenyMatrix of the Delaunay?
573 views

### Bounded Voronoi Diagram

I am trying to compute a Voronoi diagram bounded by a box. In some cases, the points used to compute the diagram form a diagram such that at least two boundary points are within the same polygon. For ...
256 views

### Determining if a point is inside or outside a 3DS (.3ds) or 3DS MAX (.max) object? [duplicate]

Imagine I import some 3DS (i.e. 3D studio) file (http://reference.wolfram.com/mathematica/ref/format/3DS.html) or a 3DS MAX file. How could I place this model (say, the 747.3ds file in the ...