System.Collections.Generic.List.Add(xyz)

Here are the examples of the csharp api System.Collections.Generic.List.Add(xyz) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

19 View Source File : wood.cs
License : Apache License 2.0
Project Creator : ericsink

override public List<xyz> GetProfile(HalfEdge he)
        {
            List<xyz> pts = new List<xyz>();

            pts.Add(he.from.copy());
            xyz center = he.from + he.GetInwardNormal() * radius + he.Opposite().GetInwardNormal() * radius;
            xyz xv = -he.GetInwardNormal();
            xyz yv = -he.Opposite().GetInwardNormal();

            const int steps = 7;

            for (int i = steps; i >= 0; i--)
            {
                double deg = i * 90.0 / steps;
                double rad = ut.DegreeToRadian(deg);
                double x = radius * Math.Cos(rad);
                double y = radius * Math.Sin(rad);
                xyz pt = center + x * xv + y * yv;
                pts.Add(pt);
            }

            return pts;
        }

19 View Source File : wood.cs
License : Apache License 2.0
Project Creator : ericsink

override public List<xyz> GetProfile(HalfEdge he)
        {
            List<xyz> pts = new List<xyz>();

            pts.Add(he.from.copy());
            xyz center = he.from + he.GetInwardNormal() * radius + he.Opposite().GetInwardNormal() * radius;
            xyz xv = -he.GetInwardNormal();
            xyz yv = -he.Opposite().GetInwardNormal();

            const int steps = 7;

            for (int i = steps; i >= 0; i--)
            {
                double deg = i * 90.0 / steps;
                double rad = ut.DegreeToRadian(deg);
                double x = radius * Math.Cos(rad);
                double y = radius * Math.Sin(rad);
                xyz pt = center + x * xv + y * yv;
                pts.Add(pt);
            }

            return pts;
        }

19 View Source File : wood.cs
License : Apache License 2.0
Project Creator : ericsink

override public List<xyz> GetProfile(HalfEdge he)
        {
            List<xyz> pts = new List<xyz>();

            xyz p1 = he.from.copy();
            xyz p2 = he.from + he.GetInwardNormal() * delta;
            xyz p3 = he.from + he.Opposite().GetInwardNormal() * delta;

#if not
            xyz p1off = (- he.GetInwardNormal() - he.Opposite().GetInwardNormal()).normalize();
            xyz p2off = (p2 - p3).normalize();
            xyz p3off = -p2off;

            pts.Add(p1 + p1off);
            pts.Add(p2 + p2off);
            pts.Add(p3 + p3off);
#endif
            pts.Add(p1);
            pts.Add(p2);
            pts.Add(p3);

            return pts;
        }

19 View Source File : wood.cs
License : Apache License 2.0
Project Creator : ericsink

override public List<xyz> GetProfile(HalfEdge he)
        {
            List<xyz> pts = new List<xyz>();

            pts.Add(he.from.copy());
            pts.Add(he.from + he.GetInwardNormal() * delta1);
            pts.Add(he.from + he.GetInwardNormal() * delta1 + he.Opposite().GetInwardNormal() * delta2);
            pts.Add(he.from + he.Opposite().GetInwardNormal() * delta2);

            return pts;
        }

19 View Source File : ppi3d.cs
License : Apache License 2.0
Project Creator : ericsink

public void Add(xyz p)
        {
            if (p == null)
            {
                return;
            }

            if (pts == null)
            {
                pts = new List<xyz>();
            }

            foreach (xyz q in pts)
            {
                if (fp.eq_inches(p, q))
                {
                    return;
                }
            }

            pts.Add(p);
        }

19 View Source File : plan.cs
License : Apache License 2.0
Project Creator : ericsink

public MechanicalStrength GetMechanicalStrength()
        {
#if not
            if (step.action == Action.DOVETAIL_JOIN)
            {
                return MechanicalStrength.VeryHigh;
            }
            else if (step.action == Action.JOIN_MT)
            {
                return MechanicalStrength.High;
            }
#endif
            if (faces.Count == 1)
            {
                return MechanicalStrength.None;
            }

            List<xyz> directions = new List<xyz>();
            foreach (GlueJoint gj in faces)
            {
                xyz n = gj.f1.UnitNormal();
                directions.Add(n);
            }
            List<xyz> unique = new List<xyz>();
            foreach (GlueJoint gj in faces)
            {
                xyz n = gj.f1.UnitNormal();
                bool bFound = false;
                foreach (xyz d in unique)
                {
                    if (fp.eq_unitvec(d, n))
                    {
                        bFound = true;
                        break;
                    }
                }
                if (!bFound)
                {
                    unique.Add(n);
                }
            }

            if (unique.Count == 1)
            {
                return MechanicalStrength.None;
            }

            dircounts dc_all = new dircounts(directions);
            dircounts dc_unique = new dircounts(unique);

            if (dc_all.neg > 10)
            {
                return MechanicalStrength.VeryHigh;
            }

            if (dc_unique.opp >= 2)
            {
                return MechanicalStrength.High;
            }

            if (dc_unique.opp >= 1)
            {
                return MechanicalStrength.Medium;
            }

            if (dc_unique.neg > 0)
            {
                return MechanicalStrength.Low;
            }

            return MechanicalStrength.None;
        }