Exemplo n.º 1
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            GH_Spring nc = this.DuplicateGeometry() as GH_Spring;

            if (nc.Value.IsACurve)
            {
                xmorph.Morph(nc.Value.CurveA);
            }
            else
            {
                xmorph.Morph(nc.Value.PointA);
            }
            return(nc);
        }
Exemplo n.º 2
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            Mesh m = Value.DuplicateMesh();

            xmorph.Morph(m);
            return(new ResultMesh(m, m_results));
        }
Exemplo n.º 3
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.PolyCurve == null)
            {
                return(null);
            }

            GsaMember1d mem = new GsaMember1d
            {
                Member = Value.Member
            };

            List <Point3d> pts = Value.Topology;

            for (int i = 0; i < pts.Count; i++)
            {
                pts[i] = xmorph.MorphPoint(pts[i]);
            }
            mem.Topology = pts;

            if (Value.PolyCurve != null)
            {
                PolyCurve crv = Value.PolyCurve.DuplicatePolyCurve();
                xmorph.Morph(crv);
                mem.PolyCurve = crv;
            }

            return(new GsaMember1dGoo(mem));
        }
Exemplo n.º 4
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            var dup = this.m_value.Duplicate();

            xmorph.Morph(dup);
            return(new GH_PointCloud((PointCloud)dup));
        }
Exemplo n.º 5
0
        public IOrientableCurve Morph(SpaceMorph xmorph)
        {
            var curve = Curve.DuplicateCurve();

            xmorph.Morph(curve);
            return(Create(curve));
        }
Exemplo n.º 6
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            var copy = Value.Duplicate();

            xmorph.Morph(copy.Geometry);
            return(new GH_DisplayGeometry(copy));
        }
Exemplo n.º 7
0
        public IOrientableCurve Morph(SpaceMorph xmorph)
        {
            var surface = (Surface)Surface.Duplicate();

            xmorph.Morph(surface);
            return(Create(surface, Curve));
        }
Exemplo n.º 8
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            var dup = this.DuplicateGeometry() as GS_PointLoad;

            xmorph.Morph(dup.Value);

            return(dup);
        }
Exemplo n.º 9
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            var dup = this.DuplicateGeometry() as GS_StructuralArea;

            xmorph.Morph(dup.Value);

            return(dup);
        }
Exemplo n.º 10
0
 public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
 {
     if (Value == null)
     {
         return(null);
     }
     if (Value.Halfedges.Count < 1)
     {
         return(null);
     }
     // TODO: cast to Rhino.Geometry.Mesh
     Rhino.Geometry.Mesh mesh;
     CastTo <Rhino.Geometry.Mesh>(out mesh);
     xmorph.Morph(mesh);
     return(new GH_Mesh(mesh));
 }
Exemplo n.º 11
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            var copy       = Value.Duplicate();
            var pointCloud = new Rhino.Geometry.PointCloud(copy.ToPoint3dArray());

            xmorph.Morph(pointCloud);
            for (int i = 0; i < Value.Nodes.Count; i++)
            {
                copy.Nodes[i].X = pointCloud[i].Location.X;
                copy.Nodes[i].Y = pointCloud[i].Location.Y;
                copy.Nodes[i].Z = pointCloud[i].Location.Z;
            }
            return(new MolecularGoo(copy));
        }
Exemplo n.º 12
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.Plane == null)
            {
                return(null);
            }
            GsaGridPlaneSurface dup = Value.Duplicate();
            Plane pln = dup.Plane;

            xmorph.Morph(ref pln);
            GsaGridPlaneSurface gridplane = new GsaGridPlaneSurface(pln);

            return(new GsaGridPlaneSurfaceGoo(gridplane));
        }
Exemplo n.º 13
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.SolidMesh == null)
            {
                return(null);
            }

            GsaMember3d elem = Value.Duplicate();
            Mesh        xMs  = elem.SolidMesh;

            xmorph.Morph(xMs);
            elem.SolidMesh = xMs;

            return(new GsaMember3dGoo(elem));
        }
Exemplo n.º 14
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.Line == null)
            {
                return(null);
            }

            GsaElement1d elem = Value.Duplicate();
            LineCurve    xLn  = Value.Line;

            xmorph.Morph(xLn);
            elem.Line = xLn;

            return(new GsaElement1dGoo(elem));
        }
Exemplo n.º 15
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.NgonMesh == null)
            {
                return(null);
            }

            GsaElement3d elem = Value.Duplicate();
            Mesh         xMs  = elem.NgonMesh;

            xmorph.Morph(xMs);
            elem.NgonMesh = xMs;
            elem.TopoInt  = Value.TopoInt;
            elem.Topology = Value.Topology;

            return(new GsaElement3dGoo(elem));
        }
Exemplo n.º 16
0
        /*******************************************/

        public IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (m_RhinoGeometry == null)
            {
                return(null);
            }
            else if (m_RhinoGeometry is Point3d)
            {
                Point3d morphed = xmorph.MorphPoint((Rhino.Geometry.Point3d)m_RhinoGeometry);
                return(new GH_IBHoMGeometry {
                    Value = morphed.FromRhino()
                });
            }
            else
            {
                GeometryBase geometry = ((GeometryBase)m_RhinoGeometry).Duplicate();
                xmorph.Morph(geometry);
                return(new GH_IBHoMGeometry {
                    Value = geometry?.IFromRhino()
                });
            }
        }
Exemplo n.º 17
0
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.Mesh == null)
            {
                return(null);
            }

            GsaElement2d elem = new GsaElement2d
            {
                Elements = Value.Elements
            };
            Mesh xMs = Value.Mesh;

            xmorph.Morph(xMs);
            elem.Mesh     = xMs;
            elem.TopoInt  = Value.TopoInt;
            elem.Topology = Value.Topology;

            return(new GsaElement2dGoo(elem));
        }
        public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
        {
            if (Value == null)
            {
                return(null);
            }
            if (Value.Brep == null & Value.PolyCurve == null)
            {
                return(null);
            }

            GsaMember2d mem = new GsaMember2d
            {
                Member = Value.Member
            };

            List <Point3d> pts = Value.Topology;

            for (int i = 0; i < pts.Count; i++)
            {
                pts[i] = xmorph.MorphPoint(pts[i]);
            }
            mem.Topology = pts;

            if (Value.VoidTopology != null)
            {
                for (int i = 0; i < Value.VoidTopology.Count; i++)
                {
                    pts = Value.VoidTopology[i];
                    for (int j = 0; j < pts.Count; j++)
                    {
                        pts[j] = xmorph.MorphPoint(pts[j]);
                    }
                    mem.VoidTopology.Add(pts);
                }
                mem.VoidTopologyType = Value.VoidTopologyType;
            }

            if (Value.InclusionLines != null)
            {
                for (int i = 0; i < Value.InclusionLines.Count; i++)
                {
                    PolyCurve xLn = Value.InclusionLines[i];
                    xmorph.Morph(xLn);
                    mem.InclusionLines.Add(xLn);
                }
                for (int i = 0; i < Value.IncLinesTopology.Count; i++)
                {
                    pts = Value.IncLinesTopology[i];
                    for (int j = 0; j < pts.Count; j++)
                    {
                        pts[j] = xmorph.MorphPoint(pts[j]);
                    }
                    mem.IncLinesTopology.Add(pts);
                }
                mem.IncLinesTopologyType = Value.IncLinesTopologyType;
            }
            if (Value.InclusionPoints != null)
            {
                pts = Value.InclusionPoints;
                for (int i = 0; i < pts.Count; i++)
                {
                    pts[i] = xmorph.MorphPoint(pts[i]);
                }
                mem.InclusionPoints = pts;
            }


            if (Value.Brep != null)
            {
                Brep brep = Value.Brep.DuplicateBrep();
                xmorph.Morph(brep);
                mem.Brep = brep;
            }
            if (Value.PolyCurve != null)
            {
                PolyCurve crv = Value.PolyCurve.DuplicatePolyCurve();
                xmorph.Morph(crv);
                mem.PolyCurve = crv;
            }

            return(new GsaMember2dGoo(mem));
        }