Boundaries — FracAbility 0.1.0 documentation

Skip to main content
`Ctrl`+`K`

# Boundaries

class fracability.Entities.Boundary(gdf: GeoDataFrame | None = None, shp: str | None = None, group_n: int = 1)

  Base entity for boundaries

  center_object(trans_center: array | None = None, return_center: bool = False, inplace: bool = True)

    Method used to center the center of an Entity object to a given point. If no point is specified then the object will be moved to the origin (0,0,0).

    Parameters:

      - obj (Boundary, Fractures, FractureNetwork) – A fracability entity object

      - trans_center (array) – Point to which translate the object

      - return_center (bool) – Bool flag to specify to return the translation center

      - inplace (bool) – Bool flag to specify if the operation overwrites the entity or creates a new instance

    Returns:

      - trans_center (array) – Point of translation. If trans_center is not specified in the output then this will return the center of the object

      - copy_obj (object) – Copy of the modified input object (preserves the original input)

  property centroid: ndarray

    Property used to return the centroid of the entity. Dissolve is used to aggregate each shape in a single entity. :return: 1D numpy array of the centroid

  property crs: str

    Property used to return the crs of the entity :return: Name of the coordinate system as a string

  property entity_df

    Each entity is based on a geopandas dataframe. This property returns or sets the entity_df of the given entity.

    Getter:

      Returns the GeoDataFrame

    Setter:

      Sets the GeoDataFrame

    Type:

      GeoDataFrame

    Notes

    When set, the dataframe is modified to conform to the assigned entity structure.

  property get_copy

    Property used to return a deep copy of the entity :return:

  matplot()

    Plot entity using matplotlib backend :return:

  property name: str

    Property used to return the name of the class (i.e. Fractures) :return: Name of the class as string

  property network_object: Graph

    Each entity can be represented with a networkx graph. This returns the network object using the vtk object (and so the df).

    Getter:

      Returns a networkx Graph object

    Setter:

      Sets a Graph object

    Type:

      pyvista Graph

    Notes

    When the get method is applied the Graph is build on the fly using the object and so the entity_df.

  save_csv(path: str, sep: str = ',', index: bool = False)

    Save the entity df as csv :param index: :type sep: object :param path: :return:

  save_shp(path: str)

    Save the entity df as shp :param path: :return:

  property vtk_object: PolyData

    Each entity can be represented with a vtk object. This returns a Pyvista PolyData object representing the entity_df.

    Getter:

      Returns a Pyvista PolyData object

    Setter:

      Sets a generic Pyvista DataSet

    Type:

      pyvista PolyData

    Notes

    When the get method is applied the PolyData is build on the fly using the entity_df as a source.

    When set the DataSet is cast to a PolyData.

  vtkplot()

    Plot entity using vtk backend :return: