예제 #1
0
        /***************************************************/

        // Apply pressure load to the elements laying within tolerance from the pressure area.
        private void ApplyLoad(PressureLoad load)
        {
            foreach (Element e in this._mesh.Elements)
            {
                // Check if the element is 2D.
                Element2D el = e as Element2D;
                if (el == null)
                {
                    continue;
                }

                // Check if the element is adjoining to the pressure area (if all its vertices lie within tolerance) - if yes then apply the load.
                Point3d elC = el.GetCentroid();
                foreach (Brep s in load.Surfaces)
                {
                    bool broken = false;
                    foreach (Point3d v in el.GetVertices())
                    {
                        if (v.DistanceTo(s.ClosestPoint(v)) > this._tolerance)
                        {
                            broken = true;
                            break;
                        }
                    }

                    if (!broken)
                    {
                        el.AddPressure(load.LoadValue * 1);
                    }
                }
            }
        }
예제 #2
0
파일: Load.cs 프로젝트: PawelBee/Guanaco
        /***************************************************/

        // Clone.
        public override GuanacoObject Clone(bool newID = false)
        {
            PressureLoad pl = this.ShallowClone(newID) as PressureLoad;

            pl._surfaces = this._surfaces.Select(s => s.DuplicateBrep()).ToList();
            return(pl);
        }