コード例 #1
0
ファイル: _block.py プロジェクト: ytakzk/compas_assembly
    def from_polysurface(cls, guid):
        """Class method for constructing a block from a Rhino poly-surface.

        Parameters
        ----------
        guid : str
            The GUID of the poly-surface.

        Returns
        -------
        Block
            The block corresponding to the poly-surface.

        Notes
        -----
        In Rhino, poly-surfaces are organised such that the cycle directions of
        the individual sub-surfaces produce normal vectors that point out of the
        enclosed volume. The normal vectors of the faces of the mesh, therefore
        also point "out" of the enclosed volume.

        """
        from compas_rhino.helpers import mesh_from_surface
        return mesh_from_surface(cls, guid)
コード例 #2
0
from compas_3gs.rhino import rhino_cell_face_pull

try:
    import rhinoscriptsyntax as rs

except ImportError:
    compas.raise_if_ironpython()

__author__ = 'Juney Lee'
__copyright__ = 'Copyright 2019, BLOCK Research Group - ETH Zurich'
__license__ = 'MIT License'
__email__ = '*****@*****.**'

# ------------------------------------------------------------------------------
#   1. make cell from rhino polysurfaces
# ------------------------------------------------------------------------------
layer = 'cell'

guid = rs.GetObject("select a closed polysurface",
                    filter=rs.filter.polysurface)
rs.HideObjects(guid)

cell = mesh_from_surface(Cell, guid)
cell.draw()

# ------------------------------------------------------------------------------
#   2. pull cell face
# ------------------------------------------------------------------------------
rhino_cell_face_pull(cell)