static public Glulam CreateGlulam(Beam beam, CrossSectionOrientation orientation, Standards.Standard standard = Standards.Standard.None) { Glulam glulam; if (beam.Centreline.IsLinear(Tolerance)) { glulam = new StraightGlulam { Centreline = beam.Centreline.DuplicateCurve(), Orientation = orientation, Data = new GlulamData() }; glulam.Data.Compute(beam, standard); } else if (beam.Centreline.IsPlanar(Tolerance)) { glulam = new SingleCurvedGlulam { Centreline = beam.Centreline.DuplicateCurve(), Orientation = orientation, Data = new GlulamData() }; glulam.Data.Compute(beam, standard); } else { glulam = new DoubleCurvedGlulam { Centreline = beam.Centreline.DuplicateCurve(), Orientation = orientation, Data = new GlulamData() }; glulam.Data.Compute(beam, standard); } return(glulam); }
static public Glulam CreateGlulam(Curve curve, CrossSectionOrientation orientation, GlulamData data) { Glulam glulam; if (curve.IsLinear(Tolerance)) { glulam = new StraightGlulam { Centreline = curve.DuplicateCurve(), Orientation = orientation, Data = data.Duplicate() }; } else if (curve.IsPlanar(Tolerance)) { /* * if (data.NumHeight < 2) * { * data.Lamellae.ResizeArray(data.NumWidth, 2); * data.LamHeight /= 2; * } */ glulam = new SingleCurvedGlulam { Centreline = curve.DuplicateCurve(), Orientation = orientation, Data = data.Duplicate() }; } else { /* * if (data.NumHeight < 2) * { * data.Lamellae.ResizeArray(data.NumWidth, 2); * data.LamHeight /= 2; * } * * if (data.NumWidth < 2) * { * data.Lamellae.ResizeArray(2, data.NumHeight); * data.LamWidth /= 2; * } */ //glulam = new DoubleCurvedGlulam(curve, orientation, data); glulam = new DoubleCurvedGlulam { Centreline = curve.DuplicateCurve(), Orientation = orientation, Data = data.Duplicate() }; } return(glulam); }