Skip to content

Commit 4e5364d

Browse files
committed
Improve clarity of start and finish
1 parent d36b293 commit 4e5364d

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ and this project adheres to [Effort-based Versioning](https://jacobtomlinson.dev
88

99
(no changes yet)
1010

11+
### Changed
12+
13+
- Improved README.
14+
- Improved clarity of first and last target.
15+
1116
## [1.0.0] - 2025-10-11
1217

1318
Initial release, just to get things started.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ and visualizes the slides [`boxcar_blitz.toml`](boxcar_blitz.toml) and [`brutal_
2121

2222
Your eyes may need some time to adapt to the correct depth perception: black ridges are high-altitude separations between the colored valleys.
2323

24+
Note that the starting point and the finish are denoted as green and red circles respectively.
25+
All other circles are waypoints that must be reached on the way down.
26+
2427
## Concept
2528

2629
The idea is for students to use the surface implemented in `soapboxslide` to simulate the dynamics of a particle (or a connected set of particles) sliding down.

slides.jpg

-2.29 KB
Loading

soapboxslide.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -400,22 +400,19 @@ def plot(
400400
)
401401
ax.plot(self.waypoints[:, 0], self.waypoints[:, 1], "ko", ms=10, zorder=3)
402402
if add_targets:
403-
colors = {0: "g", len(self.waypoints) - 1: "r"}
403+
target_colors = {0: "g", len(self.waypoints) - 1: "r"}
404404
for i, waypoint in enumerate(self.waypoints):
405-
color = colors.get(i, "w")
406-
alpha = 0.7 if color == "w" else 1.0
407-
ax.add_patch(
408-
plt.Circle(
409-
waypoint,
410-
self.target_radius,
411-
color="none",
412-
ec=color,
413-
lw=2,
414-
ls=":",
415-
zorder=4,
416-
alpha=alpha,
417-
)
405+
circle = plt.Circle(
406+
waypoint,
407+
self.target_radius,
408+
color=target_colors.get(i, "none"),
409+
ec="w",
410+
lw=2,
411+
ls=":",
412+
zorder=4,
413+
alpha=0.5,
418414
)
415+
ax.add_patch(circle)
419416
ax.set_xlim(0, self.width)
420417
ax.set_ylim(0, self.height)
421418
ax.set_xlabel("x [m]")

0 commit comments

Comments
 (0)