public List <netDxf.Entities.EntityObject> ToDXFEntities() { List <netDxf.Entities.EntityObject> entityList = new List <netDxf.Entities.EntityObject>(); //橫線 for (int i = 0; i < this.Dim1Length; i++) { List <netDxf.Entities.SplineVertex> controlPoints = new List <netDxf.Entities.SplineVertex>(); for (int j = 0; j < this.Dim2Length; j++) { controlPoints.Add( new netDxf.Entities.SplineVertex( this.Points[i, j].X, this.Points[i, j].Y, this.Points[i, j].Z )); } netDxf.Entities.Spline spline = new netDxf.Entities.Spline(controlPoints); spline.Color = new netDxf.AciColor(this.Color); entityList.Add(spline); } //縱線 for (int j = 0; j < this.Dim2Length; j++) { List <netDxf.Entities.SplineVertex> controlPoints = new List <netDxf.Entities.SplineVertex>(); for (int i = 0; i < this.Dim1Length; i++) { controlPoints.Add( new netDxf.Entities.SplineVertex( this.Points[i, j].X, this.Points[i, j].Y, this.Points[i, j].Z )); } netDxf.Entities.Spline spline = new netDxf.Entities.Spline(controlPoints); spline.Color = new netDxf.AciColor(this.Color); entityList.Add(spline); } //法向線 for (int i = 0; i < this.Dim1Length; i++) { for (int j = 0; j < this.Dim2Length; j++) { netDxf.Entities.Line line = new netDxf.Entities.Line( new netDxf.Vector3(this.Points[i, j].ToArray()), new netDxf.Vector3((this.Points[i, j] + this.Normals[i, j] * 0.5).ToArray())); line.Color = netDxf.AciColor.Red; entityList.Add(line); } } return(entityList); }
public List<netDxf.Entities.EntityObject> ToDXFEntities() { List<netDxf.Entities.EntityObject> entityList = new List<netDxf.Entities.EntityObject>(); //橫線 for (int i = 0; i < this.Dim1Length; i++) { List<netDxf.Entities.SplineVertex> controlPoints = new List<netDxf.Entities.SplineVertex>(); for (int j = 0; j < this.Dim2Length; j++) controlPoints.Add( new netDxf.Entities.SplineVertex( this.Points[i, j].X, this.Points[i, j].Y, this.Points[i, j].Z )); netDxf.Entities.Spline spline = new netDxf.Entities.Spline(controlPoints); spline.Color = new netDxf.AciColor(this.Color); entityList.Add(spline); } //縱線 for (int j = 0; j < this.Dim2Length; j++) { List<netDxf.Entities.SplineVertex> controlPoints = new List<netDxf.Entities.SplineVertex>(); for (int i = 0; i < this.Dim1Length; i++) controlPoints.Add( new netDxf.Entities.SplineVertex( this.Points[i, j].X, this.Points[i, j].Y, this.Points[i, j].Z )); netDxf.Entities.Spline spline = new netDxf.Entities.Spline(controlPoints); spline.Color = new netDxf.AciColor(this.Color); entityList.Add(spline); } //法向線 for (int i = 0; i < this.Dim1Length; i++) { for (int j = 0; j < this.Dim2Length; j++) { netDxf.Entities.Line line = new netDxf.Entities.Line( new netDxf.Vector3(this.Points[i, j].ToArray()), new netDxf.Vector3((this.Points[i, j] + this.Normals[i, j]*0.5).ToArray())); line.Color = netDxf.AciColor.Red; entityList.Add(line); } } return entityList; }