pyvista.PolyDataFilters.compute_arc_length#
- PolyDataFilters.compute_arc_length(progress_bar: bool = False)[ソース]#
精査する線の長さに対する円弧の長さを計算します.
入力の各ポリラインに対して計算された円弧の長さを持つ
"arc_length"
という名前の新しい点データ配列が追加されます.その他すべてのセルタイプでは,円弧の長さは0に設定されます.例
>>> import pyvista as pv >>> sphere = pv.Sphere() >>> path = sphere.geodesic(0, 100) >>> length = path.compute_arc_length()['arc_length'][-1] >>> f'Length is {length:.3f}' 'Length is 0.812'
これはgeodesic_distanceと同じです.
>>> length = sphere.geodesic_distance(0, 100) >>> f'Length is {length:.3f}' 'Length is 0.812'
arc_lengthをプロットすることもできます.
>>> arc = path.compute_arc_length() >>> arc.plot(scalars='arc_length')