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

32
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
740 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$?
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 ...
20
votes
2answers
568 views

Convert binary voxel image to geometric region

I have a binary voxel image which described a contiguous region in space. Example: ...
18
votes
3answers
437 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: ...
16
votes
1answer
294 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 ...
15
votes
2answers
1k 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
263 views

How do I define a periodic region?

I'm trying to create a region of "thick" grid-lines, like so ...
14
votes
0answers
130 views

Bug in RegionMember?

RegionMember (new in V10) appears to have a bug. For some polygons it finds points that are clearly outside to be "members" of the region. This depends on the shape ...
13
votes
2answers
692 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 ...
13
votes
2answers
215 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 ...
12
votes
3answers
801 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 ...
12
votes
2answers
638 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 ...
11
votes
3answers
849 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
2answers
159 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 ...
10
votes
2answers
623 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 ...
10
votes
3answers
419 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 ...
10
votes
1answer
178 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 ...
10
votes
2answers
137 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
548 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
897 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
5answers
475 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
191 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
1answer
461 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
283 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
131 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
1answer
403 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
1answer
431 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 ...
8
votes
2answers
170 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: ...
8
votes
1answer
325 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 ...
8
votes
1answer
157 views

How to discretize a BezierCurve?

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

TransformedRegion, RegionPlot broken in 10.0.2.0?

After having had trouble applying TranslationTransform to a simple region like so ...
8
votes
2answers
466 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 ...
7
votes
3answers
895 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
264 views

Unable to compute the area of region

For a set of data: ...
7
votes
2answers
110 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 ...
7
votes
1answer
156 views

Old fashioned region method?

Just stumbled across this idea in http://users.rowan.edu/~hassen/Mathematica/Volume%20III/Chapter%2015.pdf. ...
7
votes
1answer
127 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
217 views

Strange behavior of `BoundaryMeshRegion`

BoundaryMeshRegion is new function of version 10. I am not familiar with the function. I want to decide whether a point is inside or outside in the Boundary using ...
7
votes
1answer
250 views

Can't plot rotated region

I was experimenting with the code from this question when I ran into another problem with regions. ...
7
votes
2answers
397 views

Union of plotted regions as sum of colors

I wish to plot 2 functions $f$ and $g$ so that the region bounded by $f$ has color $c_f$, the region bounded by $g$ has color $c_g$, and the region bounded by both has color $c_f+c_g$. E.g. $c_f$ is ...
7
votes
2answers
172 views

A method to discretize a three-dimensional solid

Consider the following region: ...
7
votes
1answer
206 views

Problem with DiscretizeRegion

Bug fixed in 10.1.0 ...
6
votes
1answer
187 views

What are some useful (or hidden) properties of MeshRegion?

There is quite a bit of powerful functionality built in to MeshRegion, but it seems to be lacking in some areas. For example: extracting a list of edges that live ...
6
votes
2answers
115 views

How to get the x-coordinate of a region by it's y-value

I get region like this: region = ConvexHullMesh[data = RandomReal[{0, 100}, {100, 2}]] // RegionBoundary Then I get a equally spaced y-value from minimum to ...
6
votes
1answer
151 views

Easy FindMaximum returns a wrong answer

FindMaximum in region is a new function in mma10,but when I tried the following example: ...
6
votes
1answer
67 views

RandomPoint fails with a large enough number of points

Bug introduced in 10.2.0 and fixed in 10.3.1. RandomPoint is new in 10.2.0. I have defined a simple ellipsoidal parametric region: ...
6
votes
2answers
239 views

Simplify 2D polyhedral Regions like Interval

I don't think there's a built in "RegionSimplify" for polyhedral Regions and derived akin to how Interval automatically simplifies its argument expression: ...