Class PlaneVoxelGrid<TLayerPlane>
A grid of voxels that is used to find planes of a specific orientation.
Planes can be found in each individual layer of the grid based on the density of points in each voxel.
Inheritance
PlaneVoxelGrid<TLayerPlane>
Syntax
public abstract class PlaneVoxelGrid<TLayerPlane>
where TLayerPlane : LayerPlaneData
Type Parameters
Name |
Description |
TLayerPlane |
|
Constructors
PlaneVoxelGrid(VoxelGridOrientation, Bounds, Single, VoxelPlaneFindingParams)
Constructs an oriented voxel grid of a given size
Declaration
protected PlaneVoxelGrid(VoxelGridOrientation orientation, Bounds containedBounds, float voxelSize, VoxelPlaneFindingParams planeFindingParams)
Parameters
Type |
Name |
Description |
VoxelGridOrientation |
orientation |
Determines how the grid is divided into layers from which planes can be found
|
Bounds |
containedBounds |
The grid will be just large enough to contain these bounds
|
Single |
voxelSize |
Side length of each voxel
|
VoxelPlaneFindingParams |
planeFindingParams |
Parameters used to find planes
|
Fields
k_PlaneYEpsilon
A small local y offset applied to a plane to avoid z-fighting with the mesh it was extracted from
Declaration
protected const float k_PlaneYEpsilon = 0.001F
Field Value
k_Up
Declaration
protected static readonly Vector3 k_Up
Field Value
m_Layers
Declaration
protected readonly int m_Layers
Field Value
m_MinSideLength
Declaration
protected readonly float m_MinSideLength
Field Value
m_ModifiedPlanesPerLayer
Declaration
protected readonly List<List<TLayerPlane>> m_ModifiedPlanesPerLayer
Field Value
Type |
Description |
List<List<TLayerPlane>> |
|
m_PlanesPerLayer
Declaration
protected readonly List<List<TLayerPlane>> m_PlanesPerLayer
Field Value
Type |
Description |
List<List<TLayerPlane>> |
|
m_RemovedPlanesPerLayer
Declaration
protected readonly List<List<TLayerPlane>> m_RemovedPlanesPerLayer
Field Value
Type |
Description |
List<List<TLayerPlane>> |
|
m_UpdatedVoxelsPerLayer
Declaration
protected readonly List<HashSet<Vector2Int>> m_UpdatedVoxelsPerLayer
Field Value
m_VoxelSize
Declaration
protected readonly float m_VoxelSize
Field Value
Properties
CheckEmptyAreaForInitialPlanes
Declaration
protected abstract bool CheckEmptyAreaForInitialPlanes { get; }
Property Value
Methods
AddPoints(List<Vector3>)
Declaration
public void AddPoints(List<Vector3> points)
Parameters
Type |
Name |
Description |
List<Vector3> |
points |
|
CreateLayerPlane(PlaneVoxel)
Declaration
protected abstract TLayerPlane CreateLayerPlane(PlaneVoxel startingVoxel)
Parameters
Returns
Type |
Description |
TLayerPlane |
|
FindPlanes()
Declaration
protected void FindPlanes()
GetLayerOriginPose(Int32)
Declaration
protected Pose GetLayerOriginPose(int layerIndex)
Parameters
Type |
Name |
Description |
Int32 |
layerIndex |
|
Returns
GetVoxel(Int32, Int32, Int32)
Declaration
protected PlaneVoxel GetVoxel(int layer, int column, int row)
Parameters
Returns
GetVoxel(Vector3Int)
Declaration
protected PlaneVoxel GetVoxel(Vector3Int coordinates)
Parameters
Type |
Name |
Description |
Vector3Int |
coordinates |
|
Returns
TryGetPlaneData(LayerPlaneData, Pose, List<Vector3>, out Pose, out Vector3, out Vector2)
Declaration
protected bool TryGetPlaneData(LayerPlaneData layerPlane, Pose layerOriginPose, List<Vector3> vertices, out Pose pose, out Vector3 center, out Vector2 extents)
Parameters
Type |
Name |
Description |
LayerPlaneData |
layerPlane |
|
Pose |
layerOriginPose |
|
List<Vector3> |
vertices |
|
Pose |
pose |
|
Vector3 |
center |
|
Vector2 |
extents |
|
Returns
TryMergePlanes(TLayerPlane, TLayerPlane, Single, Single)
Declaration
protected virtual bool TryMergePlanes(TLayerPlane planeA, TLayerPlane planeB, float planeAHeight, float planeBHeight)
Parameters
Type |
Name |
Description |
TLayerPlane |
planeA |
|
TLayerPlane |
planeB |
|
Single |
planeAHeight |
|
Single |
planeBHeight |
|
Returns