Esempio n. 1
0
        private List <Rhino.Geometry.Brep> GetWallLayerGeometry(DB.Wall wall)
        {
            // determine wall anchor point to help in sorting layer breps
            DB.Curve wallLocationCurve       = (wall.Location as DB.LocationCurve).Curve;
            DB.XYZ   wallEndPoint            = wallLocationCurve.GetEndPoint(0);
            DB.XYZ   wallOrientation         = wall.Orientation;
            DB.XYZ   anchor                  = wallEndPoint + (wallOrientation * wallLocationCurve.Length);
            Rhino.Geometry.Point3d basePoint = anchor.ToPoint3d();

            return(GetCompoundStructureLayerGeom(wall)
                   .OrderBy(x => Rhino.Geometry.VolumeMassProperties.Compute(x, volume: true, firstMoments: true, secondMoments: false, productMoments: false).Centroid.DistanceTo(basePoint))
                   .ToList());
        }
Esempio n. 2
0
        internal static IEnumerable <IGH_Goo> PromptBox(UIDocument doc, string prompt)
        {
            IGH_Goo goo = null;

            if
            (
                PickPointOnFace(doc, prompt + " : First box corner - ", out var from) &&
                PickPointOnFace(doc, prompt + " : Second box corner - ", out var to)
            )
            {
                var min = new DB.XYZ(Math.Min(from.X, to.X), Math.Min(from.Y, to.Y), Math.Min(from.Z, to.Z));
                var max = new DB.XYZ(Math.Max(from.X, to.X), Math.Max(from.Y, to.Y), Math.Max(from.Z, to.Z));

                goo = new GH_Box(new BoundingBox(min.ToPoint3d(), max.ToPoint3d()));
            }

            yield return(goo);
        }