Example #1
0
        public static double SolidVolume(this CurtainWall curtainWall)
        {
            if (curtainWall == null || curtainWall.Openings == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot query the solid volume of a null curtain wall");
                return(0);
            }

            double volume = 0;

            foreach (Opening opening in curtainWall.Openings)
            {
                volume += opening.SolidVolume();
            }

            if (curtainWall.ExternalEdges != null)
            {
                foreach (FrameEdge frameEdge in curtainWall.ExternalEdges)
                {
                    volume += frameEdge.SolidVolume();
                }
            }

            return(volume);
        }
Example #2
0
 public Castle(Model model, Patch patch) : base(model, patch)
 {
     wall = new CurtainWall(true, model, new List <Patch> {
         patch
     }, patch.shape.Where(
                                (Point v) =>
     {
         return(model.patchByVertex(v).Any(
                    (Patch p) => { return !p.withinCity; }
                    ));
     }
                                ).ToList());
 }
Example #3
0
        public static CurtainWall Transform(this CurtainWall wall, TransformMatrix transform, double tolerance = Tolerance.Distance)
        {
            if (!transform.IsRigidTransformation(tolerance))
            {
                BH.Engine.Reflection.Compute.RecordError("Transformation failed: only rigid body transformations are currently supported.");
                return(null);
            }

            CurtainWall result = wall.ShallowClone();

            result.ExternalEdges = result.ExternalEdges.Select(x => x.Transform(transform, tolerance)).ToList();
            result.Openings      = result.Openings.Select(x => x.Transform(transform, tolerance)).ToList();

            return(result);
        }
Example #4
0
        public static MaterialComposition MaterialComposition(this CurtainWall curtainWall)
        {
            if (curtainWall == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot query the solid volume of a null curtain wall.");
                return(null);
            }

            if (curtainWall.Openings == null || curtainWall.Openings.Count == 0)
            {
                BH.Engine.Reflection.Compute.RecordError("CurtainWall has no openings. Please confirm the CurtainWall is valid and try again.");
                return(null);
            }

            List <MaterialComposition> matComps = new List <MaterialComposition>()
            {
            };
            List <double> volumes = new List <double>()
            {
            };

            foreach (Opening opening in curtainWall.Openings)
            {
                matComps.Add(opening.MaterialComposition());
                volumes.Add(opening.SolidVolume());
            }
            foreach (FrameEdge extEdge in curtainWall.ExternalEdges)
            {
                MaterialComposition matComp = extEdge.MaterialComposition();
                if (matComp != null)
                {
                    matComps.Add(matComp);
                    volumes.Add(extEdge.SolidVolume());
                }
            }

            return(Matter.Compute.AggregateMaterialComposition(matComps, volumes));
        }