DFBuildAssembly component

Contents

_images/icon1.png

DFBuildAssembly component#

This component parse a series of breps representing a timber structure or a timber elements into a DFAssembly object.

Inputs:

i_assembly_name (str ,item)

The name of the assembly to export.

i_breps (brep ,list)

The breps of the structure.

i_is_roundwood (bool ,item)

Whether the beams are of roundwood type or not.

Outputs:

o_assembly

The create DFAssembly object representing the timber elements.

Code:

#! python3

import System
import typing

import Rhino

from ghpythonlib.componentbase import executingcomponent as component

from diffCheck.df_geometries import DFBeam, DFAssembly


class DFBuildAssembly(component):
    def RunScript(self,
            i_assembly_name,
            i_breps : System.Collections.Generic.IList[Rhino.Geometry.Brep],
            i_is_roundwood : bool):
        beams: typing.List[DFBeam] = []

        if i_assembly_name is None or i_breps is None:
            return None

        if i_is_roundwood is None:
            i_is_roundwood = False

        for brep in i_breps:
            beam = DFBeam.from_brep_face(brep, i_is_roundwood)
            beams.append(beam)

        o_assembly = DFAssembly(beams, i_assembly_name)

        return o_assembly