// generat far 0.5-2
        public void buildingGenerator1(double density)
        {
            // density * offsetmax
            double off = (1 - density) * this.offsetMax();

            Curve[]  offset   = this.Outline.ToNurbsCurve().Offset(this.Center, Vector3d.ZAxis, off, inter_tol, CurveOffsetCornerStyle.Sharp);
            BrepFace basement = Brep.CreatePlanarBreps(offset[0], inter_tol)[0].Faces[0];
            double   floor    = Math.Floor(this.FAR / density);
            double   len      = this.Outline.Length;

            if (floor >= 1 && off < len / 20)
            {
                Brep ex = basement.CreateExtrusion(new Line(0, 0, 0, 0, 0, floor * 3).ToNurbsCurve(), true);
                this.Structure = ex;
            }
            else
            {
                Brep ex = basement.CreateExtrusion(new Line(0, 0, 0, 0, 0, 3).ToNurbsCurve(), true);
                this.Structure = ex;
            }
            this.OuterBorder = offset[0];
        }
예제 #2
0
        public List <Brep> CreateSlabBrep()
        {
            List <Brep>  newBreps = new List <Brep>();
            BrepFaceList faces    = this.slabSurface.Faces;

            for (int faceID = 0; faceID < faces.Count; faceID++)
            {
                BrepFace faceItem    = faces[faceID];
                Point3d  cornerPoint = faceItem.Brep.Vertices[0].Location;
                //Transform transform= Transform.Translation(00, 0, -1 * thickness);
                //cornerPoint.Transform(transform);
                Curve extrudeCurve = new Line(cornerPoint, new Vector3d(0, 0, -1 * this.thickness)).ToNurbsCurve();
                newBreps.Add(faceItem.CreateExtrusion(extrudeCurve, true));
            }
            return(newBreps);
        }