internal static Mesh Wrap(IMeshEntity host, bool persist = true) { if (host == null) { return((Mesh)null); } return(new Mesh(host, persist)); }
/// <summary> /// /// </summary> /// <param name="vertices"></param> /// <param name="edgeIndices"></param> /// <returns></returns> private static Mesh ByVerticesEdgeIndices(Point[] vertices, int[] edgeIndices) { IPointEntity[] points = vertices.ConvertAll(GeometryExtension.ToEntity <Point, IPointEntity>); IMeshEntity entity = ByVerticesEdgeIndicesCore(points, edgeIndices); Mesh mesh = new Mesh(entity); mesh.EdgeIndices = edgeIndices; mesh.VertexPositions = vertices; return(mesh); }
/// <summary> /// /// </summary> /// <param name="vertices"></param> /// <param name="faceIndices"></param> /// <returns></returns> public static Mesh ByVerticesFaceIndices(Point[] vertices, int[][] faceIndices) { IPointEntity[] points = vertices.ConvertAll(GeometryExtension.ToEntity <Point, IPointEntity>); IMeshEntity entity = ByVerticesFaceIndicesCore(points, faceIndices); Mesh mesh = new Mesh(entity, true); mesh.FaceIndices = faceIndices; mesh.VertexPositions = vertices; return(mesh); }
/// <summary> /// /// </summary> /// <param name="points"></param> /// <param name="edgeIndices"></param> /// <returns></returns> internal static IMeshEntity ByVerticesEdgeIndicesCore(IPointEntity[] points, int[] edgeIndices) { string kMethodName = "Mesh.ByVerticesEdgeIndices"; if (points.Length < 3 || points.ArePointsColinear()) { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "vertices", kMethodName)); } IMeshEntity entity = HostFactory.Factory.MeshByVerticesEdgeIndices(points, edgeIndices); if (null == entity) { throw new System.InvalidOperationException(string.Format(Properties.Resources.OperationFailed, kMethodName)); } return(entity); }
internal Mesh(IMeshEntity mesh, bool isVisible) : base(mesh) { SetVisibility(isVisible); }
internal Mesh(IMeshEntity mesh) : base(mesh) { }
internal Mesh(IMeshEntity host, bool persist) : base((IDesignScriptEntity)host, persist) { }