navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.Volume.resize
          • Volume.resize()

    navis.Volume.resize¶

    Volume.resize(x, method='center', inplace=False)[source]¶

    Resize volume.

    Parameters:
    • x (int | float) – Resizing factor. For methods “center”, “centroid” and “origin” this is the fraction of original size (e.g. .5 for half size). For method “normals”, this is is the absolute displacement (e.g. -1000 to shrink volume by that many units)!

    • method ("center" | "centroid" | "normals" | "origin") –

      Point in space to use for resizing.

      method

      explanation

      center

      average of all vertices

      centroid

      average of the triangle centroids weighted by the area of each triangle.

      origin

      resizes relative to origin of coordinate system (0, 0, 0)

      normals

      resize using face normals. Note that this method uses absolute displacement for parameter x.

    • inplace (bool, optional) – If False, will return resized copy.

    Return type:

    Optional[Volume]

    Returns:

    • navis.Volume – Resized copy of original volume. Only if inplace=False.

    • None – If inplace=True.

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.