Example #1
0
        public override void ClearCaches()
        {
            //base.ClearCaches();

            if (m_value == null)
            {
                _polylines = null;
                _b         = BoundingBox.Empty;
                _mesh      = null;
            }
            else
            {
                _polylines = RhinoMeshSupport.ExportRhinoPolylines(m_value);

                _mesh = RhinoMeshSupport.ExportTriangolatedRhinoMesh(m_value);
            }
        }
Example #2
0
        public Mesh[] GetPreviewMeshes()
        {
            if (m_value == null)
            {
                _mesh = null;
                return(null);
            }

            if (_mesh == null)
            {
                _mesh = RhinoMeshSupport.ExportTriangolatedRhinoMesh(m_value);
            }

            return(new Mesh[]
            {
                _mesh,
            });
        }
Example #3
0
        public override bool CastTo <Q>(out Q target)
        {
            if (typeof(Q) == typeof(Mesh) || typeof(Q) == typeof(GeometryBase))
            {
                target = (Q)(object)RhinoMeshSupport.ExportTriangolatedRhinoMesh(m_value);
                return(true);
            }
            if (typeof(Q) == (typeof(GH_Mesh)))
            {
                target = (Q)(object)new GH_Mesh(RhinoMeshSupport.ExportTriangolatedRhinoMesh(m_value));
                return(true);
            }
            if (typeof(Q) == typeof(ITurtleMesh))
            {
                target = (Q)(object)m_value;
                return(true);
            }

            return(base.CastTo <Q>(out target));
        }