Questions about functionality that defines or operates on regions (i.e., an open, connected set), including geometric, mesh-based, or data and formula-defined regions.

learn more… | top users | synonyms

34
votes
8answers
2k views

How to generate random points in a region?

The Mathematica 10 documentation was updated for FindInstance adding support for regions. In my use case, I'm trying to sample points in a set of disks: ...
32
votes
5answers
790 views

obtaining random element of a set given by multiple inequalities

I try to obtain random elements from a set given by multiple inequalities. This is of general interest to me, but let me present one example here: I have multiple inequalities specifying half spaces ...
25
votes
5answers
2k views

Generate two random numbers with constraints

I want to generate two random numbers, $p$ and $q$, between $0.5$ and $1$. They are connected by the constraint $1/(2q) > p$. How do I generate $p$ and $q$?
23
votes
5answers
1k views

Rounding the Corners of a Shape

I was wondering whether there is an option in Mathematica that enables me to smooth the corners of a shape. The example I want to start with is the pentagon. This can be crudely specified as ...
22
votes
3answers
2k views

RegionPlot3D in cylindrical or spherical coordinates?

RegionPlot3D is awesome. Unfortunately, it appears to work only for Cartesian coordinates. While there are ways to draw surfaces in spherical or cylindrical coordinates, I can't find a way to draw ...
21
votes
4answers
511 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: ...
21
votes
2answers
647 views

Convert binary voxel image to geometric region

I have a binary voxel image which described a contiguous region in space. Example: ...
17
votes
1answer
323 views

How can I smooth a 3D surface generated by RegionBoundary?

I have a set of points that belong to the surface of an object. I would like to approximate a surface to which I can compute the distance. of other points. With the nice code of this post, I was able ...
17
votes
0answers
298 views

RegionPlot returning a number

Bug introduced in 10.0 and persisting through 10.4 or later I had updated my mathematica to version 10 few days ago. And I had been shocked by the following fact: ...
16
votes
0answers
168 views

Bug in RegionMember?

Bug persisting through 10.4.1 RegionMember (new in V10) appears to have a bug. For some polygons it finds points that are clearly outside to be "members" of the ...
15
votes
2answers
286 views

How do I define a periodic region?

I'm trying to create a region of "thick" grid-lines, like so ...
15
votes
2answers
2k views

Neumann boundary conditions in NDSolve over nontrivial region

The problem I would like to solve involves diffusion in the following region ...
14
votes
2answers
244 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 ...
13
votes
3answers
1k views

Generating hatched filling using Region functionality

Before v.10 came out there were several Q&A on generating hatched filling for Plot, ListPlot etc. In v.10 we have new ...
13
votes
2answers
802 views

Controlling quality of discretized region meshes

EDIT: Impact of this problem has been considerably lessened in v10.2. Although new version is still not performing analytical discretization at sharp corners (there are jaggies), evenness of sampling ...
12
votes
3answers
465 views

How to find the outline of a country given the imperfect outlines of its administrative subdivisions?

I have a larger outline divided into several regions. While my data represents something else, let us think of this as the provinces/counties of a country, for the sake of simplicity. This is, for ...
12
votes
2answers
753 views

How to create subregions for the NDSolve FEM Solver

I am trying to create a 2d region consisting of two subregions. The inner region has several holes, where boundary conditions are applied. The figure shows the idea. I have tried to create this ...
12
votes
1answer
158 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 ...
12
votes
2answers
505 views

Ideas on how to improve the rendering of the letter B in this 3D region plot?

I have been playing with the RegionPlot3D idea from this question and have been trying to approximate the Gödel, Escher, Bach logo, but I am a little bit stuck on how to improve the rendering of the ...
12
votes
0answers
81 views

What is a robust way to determine if two polygons overlap? Possible bug in RegionIntersection or Area

When trying to determine if two polygon objects overlap, I think the intuitive way to do this would be to use the RegionIntersection function to find the ...
11
votes
2answers
664 views

Generating uniform random points over a binary image

So I recently read this excellent post about generating random points over arbitrary regions. I hope Wolfram eventually builds that functionality into Mathematica's Random functions. I want to do this ...
11
votes
3answers
932 views

How to remove unwanted regions in a three-dimensional surface

As the title indicates, I want to delete some unwanted regions in a three-dimensional surface created using ContourPlot3D. Here is the corresponding code ...
11
votes
1answer
2k views

Using RegionFunction on multiple plots

I realize that the Plot function can plot multiple functions of x at the same time, using { }. I also know that the ...
11
votes
1answer
210 views

Is DiscretizeRegion not yet ready ro discretize 3D-solids?

In the DiscretizeRegion documentation: "The region reg can be anything that is ConstantRegionQ and RegionEmbeddingDimension less than or equal to 3." With DiscretizeRegion there could be an easy way ...
11
votes
2answers
183 views

Integration of a PDE solution over a custom-defined subdomain

Preamble: In my previous question I raised a problem of a custom-chosen integration of the solution of a PDE. In that case it was an integration along a line lying within the PDE domain. The solution ...
11
votes
1answer
142 views

How to make a two letter monogram in 3d like the one on www.mymo.is? [duplicate]

I want to achieve the same effect like the project on http://www.mymo.is/. By taking two letters and combine them in 3d, you can get a complex shape that looks like one letter on the one side and the ...
10
votes
2answers
145 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. ...
9
votes
4answers
652 views

How discretize a region placing vertices on a specific non-uniform grid

Given a generic region, for example: Ω = ImplicitRegion[ 2 x^2 + 3 y^2 + 2 x y - 2 <= 0 ∧ x^2 + y^2 > .1, {x, y}]; and a non-uniform grid, for ...
9
votes
4answers
939 views

Showing a rectangular plot on an almost-closed sphere

I am currently teaching some students about the "point at infinity", and how it allows us to treat circles and lines as "the same", etc. I would like to kind of show this happening with a series of ...
9
votes
3answers
228 views

How to convert the binarize-picture to a Region

The Region of Mathematica is nice,and is the new conception of version 10.0.I can convenient get ...
9
votes
5answers
496 views

Calendar view outline

How to compute the outline of a calendar month like this D3 example. (D3 is a functional language built on JavaScript developed at Stanford and used by New York Times to deploy interactive ...
9
votes
3answers
634 views

Calculate inertia tensors

Moments of inertia and inertia tensors are well-known characteristics of rigid bodies in physics and applied mathematics. How to calculate them in Mathematica? Is possible to use regions which was ...
9
votes
1answer
544 views

Plotting a region with polar axes

I want to plot the region of points who satisfy the following equation: 2 < r <= 5 && 3/4 π < θ <= 5/4 π I have been able to plot region in ...
9
votes
2answers
193 views

Area of Self-Intersecting Polygon with Repeated Vertices

So Mathematica uses an even-odd rule for self-intersecting polygons, both when rendering them and when calculating their area: ...
9
votes
2answers
366 views

Solve a PDE over a region defined by a Bezier patch

I am using NDSolve to find the solution to a PDE over an arbitrary domain. The domain is specified by a Bezier patch. ...
9
votes
1answer
404 views

How to display MeshRegion without vertices

I'm writing a library for handling very large and complicated (boundary) mesh regions on the order of ~150,000 vertices, ~450,000 edges, and ~300,000 triangles. The regions themselves are the cortical ...
9
votes
1answer
216 views

How to discretize a BezierCurve?

Bug introduced in version 10.0 and persisting through 10.4 DiscretizeGraphics is new in 10.0. I need to create a discretized region from a ...
9
votes
1answer
142 views

Region computations on FilledCurve (with hole)

How can I obtain a precompiled RegionMemberFunction for this geometry? It contains a hole, and the hole's boundary intersects the outer boundary at one point. ...
8
votes
2answers
133 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: ...
8
votes
1answer
428 views

How to use Undocumented Functions Prism, Tetrahedron and Hexahedron

Taking a look at this question and this one, I checked to see if Mathematica really does not have a Prism primitive. To my surprise the function ...
8
votes
2answers
147 views

How to improve accuracy of NIntegrate over ImplicitRegion

I'm trying to compute the area of a implicit region given as ...
8
votes
2answers
121 views

Behaviour of RegionDistance with Ellipse?

The data is: data = {{13, 60}, {36, 35}, {70, 29}, {106, 41}, {118, 72}, {94, 94}, {49, 99}, {24, 85}}; When I try to find a fit circle,So my method is work ...
8
votes
1answer
123 views

TransformedRegion, RegionPlot broken in 10.0.2.0?

After having had trouble applying TranslationTransform to a simple region like so ...
8
votes
0answers
97 views

Is this a bug in DiscretizeRegion in 10.4?

Bug introduced in 10.4 and persists through 10.4.1 Consider the following implicit region: ...
8
votes
0answers
79 views

Defining a MeshRegion from a list of points and Polygons with duplicate points does not work in 10.4

Bug introduced in 10.4 and persists through 10.4.1 This code produces a MeshRegion in versions 10.0 through 10.3.1, ...
7
votes
3answers
1k views

Region bounded by x^2+y^2=1, y=z, x=0, z=0, in first octant

I need to draw (pencil and paper) the region bounded by $x^2+y^2=1$, $y=z$, $x=0$, and $z=0$ in the first octant. So the first assistance I asked of Mathematica is: ...
7
votes
3answers
276 views

Unable to compute the area of region

For a set of data: ...
7
votes
1answer
162 views

Alternative to the `DiscretizeRegion`?

I have a polygon: pgn = Polygon[{{0, 0}, {0, 0.018}, {0.155, 0.018}, {0.155 + 0.015, 0.008}, {0.222, 0.008}, {0.222, 0}, {0, 0}}]; here: ...
7
votes
1answer
141 views

Why is RegionMeasure so slow when calculating intersection area of a 2D and a 3D object?

If you think this description is too long, you can read the problem directly I know normally when one wants to calculate an region, this guide is useful. However, when it comes to calculating an ...
7
votes
1answer
157 views

Old fashioned region method?

Just stumbled across this idea in http://users.rowan.edu/~hassen/Mathematica/Volume%20III/Chapter%2015.pdf. ...