Graphical Package

Sadly I haven’t produced any documentation just yet, although there are a couple of sample files on the pacakge’s extra/visibility folder (JsonData package is needed to deserialize the json file within).

Briefly explained. the Graph category is based on BaseGraphs and VisibilityGraphs:

  • BaseGraph is a class that holds information about a set of polygons acting as limits on a layout. There are mainly three ways of creating BaseGraphs:

    1. ByPolygons, counting every input polygon as an internal obstacle (like a open square space where surrounding buildings will be all obstacles).
    2. ByBoundaryAndInternalPolygons, where there is a difference between polygons acting as boundary/external limits and internal obstacles (like a room with furniture or columns inside).
    3. ByLines, similar to ByPolygons but in this case lines don’t have any relationship between themselves.

    The purpose of BaseGraphs is to aid on the creation of VisibilityGraphs, so visible edges can be accurately created in particular cases where they are inside a polygon by being kept if it is a boundary polygon or discarded if internal. It also helps on the creation of Isovists.

  • VisibilityGraphs are created from BaseGraphs using Lee’s algorithm, which are then used to find the shortest path. The boolean reduced input simply gets rid of none tangent segments when true (default value).

The key thing to start is to generate the BaseGraph, keeping in mind:

  1. Input must be a list of polygons, so in cases where this is not the starting data there are a few nodes on the Geometry category to help generating them:
    1. Curves.Polygonize, to simplify a curve into a serie of straight lines by setting a maximum length (not the best way but it does work for now).
    2. Curves.BuildPolygons is a node that groups and creates polygons from a list of unsorted lines that are intersecting at extreme points and forming a closed curve.
    3. Curves.GroupCurves, similar to the above but accepting any type of curve and grouping them into polycurves so they don’t necessary need to be closed.
  2. Graphs expect polygon, lines and points to be coplanar (horizontal plane?). So for example if polygons are at an elevation of +3000mm, points to calculate the shortest path should have the same elevation (pulled onto that plane).

Not sure if I’m missing something else for now, but let me know if anything is unclear :slight_smile:
I will try to make more examples on future updates.

4 Likes