Class Obstacle
AdaptiveGrid obstacle represented by a set of points with extra parameters. Points are used to created bounding box that is aligned with transformation parameter with extra offset. Since offset is applied on the box, distance on corners is even larger. Can be constructed from different objects.
Implements
Inherited Members
Namespace: Elements.Spatial.AdaptiveGrid
Assembly: Hypar.Elements.dll
Syntax
public class Obstacle : GeometricElement, INotifyPropertyChanged
Constructors
Obstacle(Polygon, Double, Double, Boolean, Boolean, Transform)
Create an obstacle from a list of points.
Declaration
public Obstacle(Polygon boundary, double height, double offset, bool addPerimeterEdges, bool allowOutsideBoundary, Transform orientation)
Parameters
| Type | Name | Description |
|---|---|---|
| Polygon | boundary | Boundary of an obstacle |
| System.Double | height | Height of an obstacle |
| System.Double | offset | Extra space around obstacle bounding box. |
| System.Boolean | addPerimeterEdges | Should edges be created around obstacle. |
| System.Boolean | allowOutsideBoundary | Should edges be created when obstacle is outside of Boundaries |
| Transform | orientation | Orientation of the obstacle in space. Helpful for better bounding box creation. |
Properties
AddPerimeterEdges
Should edges be created around obstacle. If false - any intersected edges are just discarded. If true - intersected edges are cut to obstacle and perimeter edges are inserted.
Declaration
public bool AddPerimeterEdges { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
AllowOutsideBoudary
Should edges be created when obstacle is outside Boundaries, it will work only when AddPerimeterEdges property is true />
Declaration
public bool AllowOutsideBoudary { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Boundary
Perimeter defining obstacle.
Declaration
public Polygon Boundary { get; set; }
Property Value
| Type | Description |
|---|---|
| Polygon |
Height
Obstacle height, offset by Boundary normal vector
Declaration
public double Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Offset
Offset of bounding box created from the list of points.
Declaration
public double Offset { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Orientation
Additional information about obstacle orientation in space. Use inverted orientation to work in local space of the obstacle.
Declaration
public Transform Orientation { get; set; }
Property Value
| Type | Description |
|---|---|
| Transform |
Points
List of points defining obstacle.
Declaration
public List<Vector3> Points { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Vector3> |
Methods
FromBBox(BBox3, Double, Boolean, Boolean)
Create an obstacle from a bounding box.
Declaration
public static Obstacle FromBBox(BBox3 box, double offset = 0, bool addPerimeterEdges = false, bool allowOutsideBoundary = false)
Parameters
| Type | Name | Description |
|---|---|---|
| BBox3 | box | Bounding box to avoid. |
| System.Double | offset | Extra space around obstacle bounding box. |
| System.Boolean | addPerimeterEdges | Should edges be created around obstacle. |
| System.Boolean | allowOutsideBoundary | Should edges be created when obstacle is outside of Boundaries |
Returns
| Type | Description |
|---|---|
| Obstacle | New obstacle object. |
FromColumn(Column, Double, Boolean, Boolean)
Create an obstacle from a column.
Declaration
public static Obstacle FromColumn(Column column, double offset = 0, bool addPerimeterEdges = false, bool allowOutsideBoundary = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Column | column | Column to avoid. |
| System.Double | offset | Extra space around obstacle bounding box. |
| System.Boolean | addPerimeterEdges | Should edges be created around obstacle. |
| System.Boolean | allowOutsideBoundary | Should edges be created when obstacle is outside of Boundaries |
Returns
| Type | Description |
|---|---|
| Obstacle | New obstacle object. |
FromLine(Line, Double, Boolean, Boolean)
Create an obstacle from a line.
Declaration
public static Obstacle FromLine(Line line, double offset = 0.1, bool addPerimeterEdges = false, bool allowOutsideBoundary = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Line | line | Line to avoid. |
| System.Double | offset | Extra space around obstacle bounding box. Should be larger than 0. |
| System.Boolean | addPerimeterEdges | Should edges be created around obstacle. |
| System.Boolean | allowOutsideBoundary | Should edges be created when obstacle is outside of Boundaries |
Returns
| Type | Description |
|---|---|
| Obstacle | New obstacle object. |
FromWall(StandardWall, Double, Boolean, Boolean)
Create an obstacle from a wall.
Declaration
public static Obstacle FromWall(StandardWall wall, double offset = 0, bool addPerimeterEdges = false, bool allowOutsideBoundary = false)
Parameters
| Type | Name | Description |
|---|---|---|
| StandardWall | wall | Wall to avoid. |
| System.Double | offset | Extra space around obstacle bounding box. |
| System.Boolean | addPerimeterEdges | Should edges be created around obstacle. |
| System.Boolean | allowOutsideBoundary | Should edges be created when obstacle is outside of Boundaries |
Returns
| Type | Description |
|---|---|
| Obstacle | New obstacle object. |
Intersects(Line, Double)
Check if line intersects with obstacle
Declaration
public bool Intersects(Line line, double tolerance = 1E-05)
Parameters
| Type | Name | Description |
|---|---|---|
| Line | line | Line to check |
| System.Double | tolerance | Tolerance of checks |
Returns
| Type | Description |
|---|---|
| System.Boolean | Result of check |
Intersects(Polyline, Double)
Check if any segment of polyline intersects with obstacle or is inside of obstacle
Declaration
public bool Intersects(Polyline polyline, double tolerance = 1E-05)
Parameters
| Type | Name | Description |
|---|---|---|
| Polyline | polyline | Polyline to check |
| System.Double | tolerance | Tolerance of checks |
Returns
| Type | Description |
|---|---|
| System.Boolean | Result of check |
UpdateRepresentations()
Create visual representation of obstacle
Declaration
public override void UpdateRepresentations()