サーフェスのスムージングは、自然近隣補間(NNI)またはクリギング法を使用してシステムで決定された標高にポイントを追加します。その結果、等高線が重なることなくスムージングされます。サポートされている 2 つのスムージング メソッドの詳細は、 『Autodesk Civil 3D ユーザ ガイド』 を参照してください。
TinSurface オブジェクトは、SmoothSurfaceByNNI() および SmoothSurfaceByKriging() メソッドを使用して、これら 2 つのスムージング操作を開示します。
次の 2 つのの手順により、スムージング操作を設定します。
次の例は、Centroids 出力場所を使用した、SmoothSurfaceByNNI() メソッドの設定方法と使用方法を示しています。
[CommandMethod("SmoothTinSurface")]
public void SmoothTinSurface()
{
using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
{
try
{
// Select a TIN Surface:
ObjectId surfaceId = promptForEntity("Select a TIN surface to smooth\n", typeof(TinSurface));
TinSurface oSurface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
// Select a polyline to define the output region:
ObjectId polylineId = promptForEntity("Select a polyline to define the output region\n", typeof(Polyline));
Point3dCollection points = new Point3dCollection();
Polyline polyline = polylineId.GetObject(OpenMode.ForRead) as Polyline;
// Convert the polyline into a collection of points:
int count = polyline.NumberOfVertices;
for (int i = 0; i < count; i++)
{
points.Add(polyline.GetPoint3dAt(i));
}
// Set the options:
SurfacePointOutputOptions output = new SurfacePointOutputOptions();
output.OutputLocations = SurfacePointOutputLocationsType.Centroids;
output.OutputRegions = new Point3dCollection[] { points };
SurfaceOperationSmooth op = oSurface.SmoothSurfaceByNNI(output);
editor.WriteMessage("Output Points: {0}\n", op.OutPutPoints.Count);
// Commit the transaction
ts.Commit();
}
catch (System.Exception e) { editor.WriteMessage(e.Message); }
}
}