private void getSlices(PartController pcontrol, ref GH_Structure <GH_Brep> boxes, ref GH_Structure <GH_Mesh> slices)
 {
     foreach (Brep b in pcontrol.brepBBoxes)
     {
         boxes.Append(new GH_Brep(b));
     }
 }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and
        /// to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            List <Line> bldGrid = new List <Line>();
            double      xcell   = 0;
            double      ycell   = 0;
            double      zcell   = 0;


            if (!DA.GetData(0, ref xcell))
            {
                return;
            }
            if (!DA.GetData(1, ref ycell))
            {
                return;
            }
            if (!DA.GetData(2, ref zcell))
            {
                return;
            }
            if (!DA.GetDataList(3, bldGrid))
            {
                return;
            }

            Parameters     parameters = new Parameters(xcell, ycell, zcell);
            PartController pControl   = new PartController(bldGrid, parameters);

            GH_Structure <GH_Mesh> caveSlices = new GH_Structure <GH_Mesh>();
            GH_Structure <GH_Brep> bboxes     = new GH_Structure <GH_Brep>();

            getSlices(pControl, ref bboxes, ref caveSlices);

            DA.SetDataTree(0, caveSlices);
            DA.SetDataTree(1, bboxes);

            Documenter documenter3d = new Documenter();

            documenter3d.WritePart3d(pControl, parameters, @"C:\Users\Admin\Documents\projects\PassageProjects\DD\Output\part.3dm");
        }
예제 #3
0
        public void WritePart3d(PartController partController, Parameters parameters, string filePath)
        {
            foreach (NurbsCurve nurbsCurve in parameters.problemPanels)
            {
                AddCurve(nurbsCurve, "PROBLEM PANELS");
            }
            foreach (BayController bayController in partController.bayControllers)
            {
                foreach (CaveElement caveElement in bayController.caveElements)
                {
                    if (caveElement.supportAssembly != null)
                    {
                        AddSupportAssembly(caveElement.supportAssembly, caveElement.orientation);
                    }
                    AddPanelFrames(caveElement.panelFrames, caveElement.orientation);
                }
            }
            RhinoViewport viewport = new RhinoViewport();

            viewport.SetProjection(DefinedViewportProjection.Perspective, "cavern view", false);
            viewport.ZoomExtents();
            file.AllViews.Add(new ViewInfo(viewport));
            file.Write(filePath, 5);
        }