コード例 #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep     surface = null;
            Vector3d direction = Vector3d.Zero;
            LoadCase loadCase = null;
            double   z0 = 0, q0 = 0, qh = 0;
            string   comment = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }
            if (!DA.GetData(1, ref direction))
            {
                return;
            }
            if (!DA.GetData(2, ref loadCase))
            {
                return;
            }
            if (!DA.GetData(3, ref z0))
            {
                return;
            }
            if (!DA.GetData(4, ref q0))
            {
                return;
            }
            if (!DA.GetData(5, ref qh))
            {
                return;
            }
            if (!DA.GetData(6, ref comment))
            {
                // pass
            }
            if (surface == null || loadCase == null)
            {
                return;
            }

            // transform geometry
            FemDesign.Geometry.Region     region        = surface.FromRhino();
            FemDesign.Geometry.FdVector3d loadDirection = direction.FromRhino().Normalize();

            PressureLoad obj = new PressureLoad(region, loadDirection, z0, q0, qh, loadCase, comment, false, ForceLoadType.Force);

            // return
            DA.SetData(0, obj);
        }
コード例 #2
0
 /// <summary>
 /// Convert surface of PressureLoad to a Rhino brep.
 /// </summary>
 internal static Rhino.Geometry.Brep GetRhinoGeometry(this PressureLoad pressureLoad)
 {
     return(pressureLoad.Region.ToRhinoBrep());
 }