Questions tagged [regions]

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.

Useful Links:

1273 questions
17
votes
4 answers

How to define space inside a closed curve as a Region

Let's say I have some closed curve, which could be given by a parametric representation, or by a closed spline as in: pts = {{-1, 0}, {-1, 1}, {0, 0}, {1, 1}, {1, 0}}; which looks like so: Graphics[{Thick, BSplineCurve[pts, SplineClosed ->…
Pirx
  • 4,139
  • 12
  • 37
14
votes
3 answers

How to find the intersection of a Line with the boundary of a Region?

Given a 2-D Region $\Omega$, i.e. RegionQ[ω] && RegionDimension[ω] == 2 is True, and a pair of points p1 and p2 such that RegionMember[ω, p1] && !RegionMember[ω, p2] is True, I need to find the intersection of the Line[{p1, p2}] with the…
unlikely
  • 7,103
  • 20
  • 52
12
votes
1 answer

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. region =…
mfvonh
  • 8,460
  • 27
  • 42
10
votes
1 answer

Region from points

Is there a built-in way to define a 3D region from an arbitrary list of points. The points will represent vertices of the edges of the region and we can assume that 1) they are not all on the same plane and 2) that there are at least 4 points. The…
BenP1192
  • 934
  • 6
  • 13
9
votes
1 answer

ImplicitRegion fails on apparently simple case

Consider the shaded region bounded by $\sin x$, $\cos x$, and $\tan x$: We can define this as an ImplicitRegion by: \[ScriptCapitalR] = ImplicitRegion[(0 < x < 1) \[And] (y < Cos[x]) \[And] (y < Tan[x]) \[And] (y > Sin[x]), {x,…
David G. Stork
  • 41,180
  • 3
  • 34
  • 96
8
votes
1 answer

How to get a membership condition for RegionBoundary using RegionMember

This is my first question on this forum, but by no means my first problem with Mathematica (which I've been using daily for years). Consider Clear[x, y] reg = RegionBoundary[ImplicitRegion[0 < x < 2 \[And] 0 < y < -2 x + 4, {x, y}]]; In Mathematica…
7
votes
2 answers

DiscretizeRegion of ImplicitRegion too small

I have a 2D function that has some sharp peeks within the my domain. I need to find a tight region that contains these sharp peeks. The following is an example of what I would like to do. An example function: Clear[f] f[x_, y_] := 1/(1/4 + Sqrt[(x…
c186282
  • 1,402
  • 9
  • 17
7
votes
3 answers

Trouble plotting an ImplicitRegion

I have an implicit region: R = ImplicitRegion[-Sqrt[-1 + 1/4 (x + 1/(x + I y) + I y)^2] + 1/2 (x + 1/(x + I y) + I y) == x + I y, {x, y}] I tried plotting it with RegionPlot: RegionPlot[R, PlotRange -> {{-2.5, 2.5}, {-2.5, 2.5}}] but got an…
DumpsterDoofus
  • 11,857
  • 1
  • 29
  • 49
7
votes
2 answers

RegionMeasure gives incorrect area of ImplicitRegion

The area of ImplicitRegion gives two very different answers when I introduce a small amount of error. poly[x_, y_] = 4.3 x + 2.1 y; triangle = Triangle[{{-1., 0.}, {0., 1.}, {1., 0.}}]; Show[Graphics[{Transparent, EdgeForm[{Thick, Black}],…
jerjorg
  • 453
  • 2
  • 5
7
votes
2 answers

RegionDifference for Cylinder and Cuboid

I wish to use RegionDifference to take a cube shape out of a cylinder. First I make the cylinder and cube and combine them in RegionUnion. reg1 = Cylinder[{{0, 0, 0}, {10, 0, 0}}, 0.5]; reg2 = Cuboid[{5, 0, 0}, {10, 1, 1}]; Region[RegionUnion[reg1,…
Hugh
  • 16,387
  • 3
  • 31
  • 83
6
votes
1 answer

Can't get Element to work with Sphere

Mathematica returns False when I execute Element[{0, 0, 0}, Sphere[{0, 0, 0}]] whereas Element[{0, 0, 0}, Cuboid[]] returns True as expected. Any clue why this could be happening?
Mike
  • 585
  • 3
  • 14
5
votes
0 answers

Why is this ImplicitRegion empty?

I'm having trouble understanding why the following RegionPlot code produces results: pred[x_, y_] := 0 < x <= 0.5 ∧ EvenQ@Floor[(y - 0.05)/0.1] ∨ 0.5 < x < 1 ∧ EvenQ@Floor[y/0.1] RegionPlot[pred[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {{0,…
unlikely
  • 7,103
  • 20
  • 52
5
votes
2 answers

How to define a "tubular" region in 2D which follows a parametrically defined path

If I have a parametric function in 2D e.g. v[t_]:={Cos[t],Sin[t]} how can I build a ribbon-like Region which is defined by "Extruding" this path a small distance d normal to the path on either side? In the case of a circular path one would get a…
DrKwantum
  • 61
  • 3
5
votes
4 answers

Calculate list of points inside a 3D region with specific spacing

I'm trying to get a list of points inside a 3D region. However, I want these points to have a certain spacing in x-, y- and z-directions. As of now I generate a list of points with the appropriate spacing and use Select with an appropriate…
rowsi
  • 395
  • 1
  • 10
5
votes
2 answers

Define region between two curves

I'm trying to define the region between two curves, f[x] and g[x], I can easily find where they intersect: f = Function[x, 12 x^2]; g = Function[x, 3 x^3]; p = {x, g[x]} /. DeleteDuplicates[Solve[g[x] == f[x], x, Reals]]; p1 = First[Take[p,…
Wombles
  • 792
  • 3
  • 8
1
2 3 4 5 6