示例#1
0
        /// <summary>
        /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments).
        /// </summary>
        public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, IEnumerable <EntityBase> references, string identifier = "CP")
        {
            GuidListType[]    refs     = references.Select(r => new GuidListType(r)).ToArray();
            RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);

            Initialize(firstPoint, secondPoint, rigidity, refs, identifier);
        }
示例#2
0
 private void InitializeFullExcitation(FdPoint3d position, string identifier, string comment)
 {
     Position = position;
     Footfall.fullExcitationInstances++;
     Name    = $"{identifier}.{fullExcitationInstances}";
     Comment = string.IsNullOrEmpty(comment) ? null : comment;
     this.EntityCreated();
 }
示例#3
0
        /// <summary>
        /// Create FdCoordinateSystem from Rhino plane.
        /// </summary>
        internal static FdCoordinateSystem FromRhinoPlane(this Rhino.Geometry.Plane obj)
        {
            FdPoint3d  origin = obj.Origin.FromRhino();
            FdVector3d localX = obj.XAxis.FromRhino();
            FdVector3d localY = obj.YAxis.FromRhino();
            FdVector3d localZ = obj.ZAxis.FromRhino();

            return(new FdCoordinateSystem(origin, localX, localY, localZ));
        }
示例#4
0
        public void GetLengthCircle()
        {
            // circle
            var center = new FdPoint3d(0, 0, 0);
            var radius = 1;
            var cs     = FdCoordinateSystem.Global();
            var circle = new Edge(radius, center, cs);

            Assert.IsTrue(Math.Abs(circle.Length - 2 * Math.PI) <= Tolerance.LengthComparison);
        }
示例#5
0
        public void GetLengthLine()
        {
            // line
            var p0   = new FdPoint3d(0, 0, 0);
            var p1   = new FdPoint3d(1, 0, 0);
            var y    = new FdVector3d(0, 1, 0);
            var line = new Edge(p0, p1, y);

            Assert.IsTrue(Math.Abs(line.Length - 1) <= Tolerance.LengthComparison);
        }
示例#6
0
        /// <summary>
        /// Create Edge (Line) from Rhino linear NurbsCurve.
        /// </summary>
        public static Geometry.Edge FromRhinoLinearNurbsCurve(this Rhino.Geometry.NurbsCurve obj)
        {
            FdPoint3d startPoint = obj.PointAtStart.FromRhino();
            FdPoint3d endPoint   = obj.PointAtEnd.FromRhino();

            // lcs
            FdCoordinateSystem cs = obj.FromRhinoCurve();

            // return
            return(new Geometry.Edge(startPoint, endPoint, cs));
        }
示例#7
0
        /// <summary>
        /// Create Edge (Circle) from Rhino closed ArcCurve.
        /// </summary>
        public static Geometry.Edge FromRhinoCircle(this Rhino.Geometry.ArcCurve obj)
        {
            double    radius      = obj.Radius;
            FdPoint3d centerPoint = obj.Arc.Center.FromRhino();

            // lcs
            FdCoordinateSystem cs = obj.FromRhinoCurve();

            // return
            return(new Geometry.Edge(radius, centerPoint, cs));
        }
示例#8
0
        /// <summary>
        /// Create Edge (Arc2) from Rhino open ArcCurve.
        /// </summary>
        public static Geometry.Edge FromRhinoArc2(this Rhino.Geometry.ArcCurve obj)
        {
            FdPoint3d startPoint = obj.Arc.StartPoint.FromRhino();
            FdPoint3d midPoint   = obj.Arc.MidPoint.FromRhino();
            FdPoint3d endPoint   = obj.Arc.EndPoint.FromRhino();

            // lcs
            FdCoordinateSystem cs = obj.FromRhinoCurve();

            // return
            return(new Geometry.Edge(startPoint, midPoint, endPoint, cs));
        }
示例#9
0
        public void GetLengthInvalid()
        {
            // some other type
            var p0   = new FdPoint3d(0, 0, 0);
            var p1   = new FdPoint3d(1, 0, 0);
            var y    = new FdVector3d(0, 1, 0);
            var line = new Edge(p0, p1, y);
            var edge = line;

            edge._type = "someType";
            Assert.ThrowsException <ArgumentException>(() => edge.Length, "Should throw exception on not supported edge type");
        }
示例#10
0
        public void GetLengthArc3Point()
        {
            // arc by three points
            var start = new FdPoint3d(-1, 0, 0);
            var mid   = new FdPoint3d(0, 1, 0);
            var end   = new FdPoint3d(1, 0, 0);
            var cs    = FdCoordinateSystem.Global();
            var arc2  = new Edge(start, mid, end, cs);

            //Assert.ThrowsException<ArgumentException>(() => arc2.Length, "Should throw exception stating that method to calculate sweep angle is not implemented yet.");
            Assert.IsTrue(Math.Abs(arc2.Length - Math.PI) <= Tolerance.LengthComparison); // test should fail here
        }
示例#11
0
        public void GetLengthArc()
        {
            // arc by
            var center     = new FdPoint3d(0, 0, 0);
            var radius     = 1;
            var startAngle = 0;
            var endAngle   = Math.PI;
            var xAxis      = new FdVector3d(1, 0, 0);
            var cs         = FdCoordinateSystem.Global();
            var arc1       = new Edge(radius, startAngle, endAngle, center, xAxis, cs);

            Assert.IsTrue(Math.Abs(arc1.Length - Math.PI) <= Tolerance.LengthComparison);
        }
示例#12
0
        /// <summary>
        /// Create Edge (Arc1) from Rhino open ArcCurve.
        /// </summary>
        public static Geometry.Edge FromRhinoArc1(this Rhino.Geometry.ArcCurve obj)
        {
            double     radius      = obj.Arc.Radius;
            double     startAngle  = 0;
            double     endAngle    = obj.Arc.EndAngle - obj.Arc.StartAngle;
            FdPoint3d  centerPoint = obj.Arc.Center.FromRhino();
            FdVector3d xAxis       = new FdVector3d(centerPoint, obj.Arc.StartPoint.FromRhino());

            // lcs
            FdCoordinateSystem cs = obj.FromRhinoCurve();

            // return
            return(new Geometry.Edge(radius, startAngle, endAngle, centerPoint, xAxis, cs));
        }
示例#13
0
 private void Initialize(FdPoint3d firstPoint, FdPoint3d secondPoint, RigidityDataType2 rigidity, GuidListType[] references, string identifier)
 {
     this.EntityCreated();
     this.Points = new FdPoint3d[2]
     {
         firstPoint,
         secondPoint
     };
     this.LocalX     = FdVector3d.UnitX();
     this.LocalY     = FdVector3d.UnitY();
     this.Rigidity   = rigidity;
     this.References = references;
     this.Identifier = identifier;
 }
示例#14
0
        /// <summary>
        /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments).
        /// </summary>
        public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, GuidListType[] references, string identifier = "CP")
        {
            RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);

            Initialize(firstPoint, secondPoint, rigidity, references, identifier);
        }
示例#15
0
 /// <summary>
 /// Create a Footfall full excitation
 /// </summary>
 /// <param name="position"></param>
 /// <param name="identifier"></param>
 /// <param name="comment"></param>
 public Footfall(FdPoint3d position, string identifier = "FE", string comment = null)
 {
     InitializeFullExcitation(position, identifier, comment);
 }
示例#16
0
 /// <summary>
 /// Create a connected point between 2 points using rigidity.
 /// </summary>
 public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, RigidityDataType2 rigidity, GuidListType[] references, string identifier = "CP")
 {
     Initialize(firstPoint, secondPoint, rigidity, references, identifier);
 }
示例#17
0
        public static Footfall FullExcitation(Autodesk.DesignScript.Geometry.Point point, string identifier = "FE", string comment = "")
        {
            var p0 = FdPoint3d.FromDynamo(point);

            return(new Footfall(p0, identifier, comment));
        }