guanyang/open-agent-hub / skills/remotion-markup
remotion-markup
VerifiedContent, animation and effects best practices
remotion-maps/techniques/cesium/assets/flight-path.ts
View on GitHubexport type LngLat = [number, number];
// Chaikin corner cutting turns a sparse route into a continuous curve. Repeated passes round
// direction changes into deliberate swerves instead of left-right heading bumps.
export const smoothFlightPath = (
source: LngLat[],
iterations = 3,
): LngLat[] => {
if (source.length < 2)
throw new Error('Flyover path needs at least two points');
// Keep adjacent longitudes continuous for routes that cross the antimeridian.
const unwrapped: LngLat[] = [source[0]];
for (let index = 1; index < source.length; index++) {
const [lng, lat] = source[index];
const previous = unwrapped[index - 1][0];
let adjusted = lng;
while (adjusted - previous > 180) adjusted -= 360;
while (adjusted - previous < -180) adjusted += 360;
unwrapped.push([adjusted, lat]);
}
let curve = unwrapped;
for (let iteration = 0; iteration < Math.max(0, iterations); iteration++) {
const next: LngLat[] = [curve[0]];
for (let i = 0; i < curve.length - 1; i++) {
const a = curve[i];
const b = curve[i + 1];
next.push(
[a[0] * 0.75 + b[0] * 0.25, a[1] * 0.75 + b[1] * 0.25],
[a[0] * 0.25 + b[0] * 0.75, a[1] * 0.25 + b[1] * 0.75],
);
}
next.push(curve[curve.length - 1]);
curve = next;
}
return curve;
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |