Skip to content

Commit addedce

Browse files
thomasahleclaude
andcommitted
trace_delete: fix ghost double arc when the trace closes
ReplacementTransform of the two stubs into the single dome bezier made manim duplicate the target to cover the count mismatch, showing a doubled arc mid-animation. The dome is now split at its apex (de Casteljau) into left and right halves, and each stub sweeps up into its own half, meeting at the top. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PzG3QbNtaFmABBHBG39wp
1 parent 8c57641 commit addedce

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

paper/animations/advanced_rules.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,26 @@ def lab(tex, c, sgn):
527527
Create(soA), Create(soB), run_time=1.1)
528528
self.wait(0.6)
529529

530-
dome0 = dome()
530+
# close the trace: each stub sweeps up into its half of the dome
531+
# (splitting the dome bezier at the apex avoids a ghost double)
532+
p1 = ca + 0.30 * dirv(180)
533+
p2 = cb + 0.30 * dirv(0)
534+
lift = 1.61 * np.array([0, 1, 0])
535+
c1 = p1 + 1.37 * dirv(180) + lift
536+
c2 = p2 + 1.37 * dirv(0) + lift
537+
apex = (p1 + 3 * c1 + 3 * c2 + p2) / 8
538+
domeL = CubicBezier(p1, (p1 + c1) / 2, (p1 + 2 * c1 + c2) / 4, apex,
539+
color=INK, stroke_width=2.2)
540+
domeR = CubicBezier(apex, (c1 + 2 * c2 + p2) / 4, (c2 + p2) / 2, p2,
541+
color=INK, stroke_width=2.2)
531542
self.play(ReplacementTransform(tAXB[0], tTr[1]),
532543
ReplacementTransform(tAXB[1], tTr[2]),
533544
ReplacementTransform(tAXB[2], tTr[3]),
534545
FadeIn(tTr[0], tTr[4]),
535-
ReplacementTransform(VGroup(soA, soB), dome0),
546+
ReplacementTransform(soA, domeL),
547+
ReplacementTransform(soB, domeR),
536548
run_time=1.2, rate_func=EASE)
537-
self.remove(dome0)
549+
self.remove(domeL, domeR)
538550
self.add(domeM)
539551
self.wait(0.6)
540552

paper/animations/trace_delete.mp4

-11.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)