scenic.core.regions¶
Objects representing regions in space.
Summary of Module Members¶
Functions
Build a ‘Region’ from Shapely geometry. 


Classes
Region consisting of all space. 



Region containing no points. 

A Region given by an obstacle grid. 



Uniform distribution over points in a Region 

Region consisting of a set of discrete points. 

Region given by one or more polygons (possibly with holes) 

Region given by one or more polylines (chain of line segments) 



Abstract class for regions. 


Member Details¶

class
PointInRegionDistribution
(region)[source]¶ Bases:
scenic.core.vectors.VectorDistribution
Uniform distribution over points in a Region

class
Region
(name, *dependencies, orientation=None)[source]¶ Bases:
scenic.core.distributions.Samplable
Abstract class for regions.

intersect
(other, triedReversed=False)[source]¶ Get a
Region
representing the intersection of this one with another.

static
uniformPointIn
(region)[source]¶ Get a uniform
Distribution
over points in aRegion
.

uniformPoint
()[source]¶ Sample a uniformlyrandom point in this
Region
.Can only be called on fixed Regions with no random parameters.


class
AllRegion
(name, *dependencies, orientation=None)[source]¶ Bases:
scenic.core.regions.Region
Region consisting of all space.

class
EmptyRegion
(name, *dependencies, orientation=None)[source]¶ Bases:
scenic.core.regions.Region
Region containing no points.

class
PolylineRegion
(points=None, polyline=None, orientation=True)[source]¶ Bases:
scenic.core.regions.Region
Region given by one or more polylines (chain of line segments)

class
PolygonalRegion
(points=None, polygon=None, orientation=None)[source]¶ Bases:
scenic.core.regions.Region
Region given by one or more polygons (possibly with holes)

class
PointSetRegion
(name, points, kdTree=None, orientation=None, tolerance=1e06)[source]¶ Bases:
scenic.core.regions.Region
Region consisting of a set of discrete points.
No
Object
can be contained in aPointSetRegion
, since the latter is discrete. (This may not be true for subclasses, e.g.GridRegion
.) Parameters
name (str) – name for debugging
points (iterable) – set of points comprising the region
kdtree (
scipy.spatial.KDTree
, optional) – kD tree for the points (one will be computed if none is provided)orientation (
VectorField
, optional) – orientation for the regiontolerance (float, optional) – distance tolerance for checking whether a point lies in the region

class
GridRegion
(name, grid, Ax, Ay, Bx, By, orientation=None)[source]¶ Bases:
scenic.core.regions.PointSetRegion
A Region given by an obstacle grid.
A point is considered to be in a
GridRegion
if the nearest grid point is not an obstacle. Parameters
name (str) – name for debugging
grid – 2D list, tuple, or NumPy array of 0s and 1s, where 1 indicates an obstacle and 0 indicates free space
Ax (float) – spacing between grid points along X axis
Ay (float) – spacing between grid points along Y axis
Bx (float) – X coordinate of leftmost grid column
By (float) – Y coordinate of lowest grid row
orientation (
VectorField
, optional) – orientation of region