Interpolating a polyline?

Hello dear devs.
I have polyline objects defined as :
polyline:
{
classificationType: Cesium.ClassificationType.TERRAIN,
positions: Cesium.Cartesian3.fromDegreesArray( points ),
width: 6,
material: new Cesium.PolylineOutlineMaterialProperty(
{
color: color.withAlpha( 0.6 ),
outlineWidth: 1,
outlineColor: Cesium.Color.BLACK.withAlpha( 0.40 )
} ),
clampToGround: true
}

and I would love if this can be interpolated somehow.

  • is there a way to do so ?

@Yordan_Yanakiev1 It depends what you’re trying to accomplish. The Cesium library does have a few interpolation algorithms: HermitePolynomialApproximation - Cesium Documentation LagrangePolynomialApproximation - Cesium Documentation

There isn’t a way to automatically apply these to your polyline via the Entity API, but you can use those algorithms to pre-compute your positions array. The Entity API does however have built-in support interpolation for position property used to draw a path. See Cesium Sandcastle

Cheers,

Hannah
Cesium Staff

Hey Hannah !
Thank You for Your reply.
Well… I just have a polylines which is updated each couple of seconds, and I would like to have interpolation on them. to be more… smooth in some way.