GM

gordensun/math2ggb

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

69 stars 质量 57 趋势 18MIT

光标代理技能,通过驱动真实的GeoGebra引擎,将数学问题(尤其是几何)转化为忠实+互动的GeoGebra .ggb文件。

概览

一个光标代理技能,可以转动一个。对于每个图形,它生成基于相同依赖约束结构构建的文件:- a(静态忠实)——印刷图形精确复刻(仅保留其点、段和角度标记,不多不少);- a(干净互动)——相同的打印外观,无文本/辅助/可见辅助圈,但可完全拖曳且所有条件保持;- a(动态教学)——相同基础加上辅助行、注释和实时角度/长度读数——取消勾选时返回完全原文。 这三种条件都将问题条件编码为真实约束(循环约束、交集约束、反射约束、中点、螺旋相似度、轨迹......),因此拖拽驱动点可以满足所有条件。精确还原通过(绝非目测)和添加临时测量对象来验证坐标/长度/角度,确保最终文件与原始文件完全匹配。

概述(AI 翻译)

一个光标代理技能,可以把数学问题(尤其是几何)变成 GeoGebra .ggb 文件。每个图形生成三个文件 同样依赖约束的构造:

  • 静态复刻图(静态忠实图)——印刷图形完全复刻(仅保留其点、段和角度标记,不多不少);
  • 干净可交互图(干净互动)——相同打印外观,无文本/辅助/可见辅助圈,但可完全拖曳且保留所有条件;
  • 动态理解图(动态教学)——相同的基底加上辅助行、注释和实时角度/长度读数,在**显示辅助切换**上——取消勾选后会恢复到完全原来的状态。

这三者都将问题的条件编码为实约束(循环约束、交约束, 反射、中点、螺旋相似度、轨迹等),所以拖动驱动点保持 所有条件都满足。精确复制通过测量 原始图像(从不用眼测)并通过添加临时测量对象到 验证坐标/长度/角度,这些在导出前被删除,最终 文件与原始文件完全匹配。

本页由 AI 翻译,技术细节请以原文为准。

README

Math2GGB

A Cursor Agent Skill that turns a math problem (especially geometry) into GeoGebra .ggb files. For each figure it produces three files built from the SAME dependency-constrained construction:

  • a 静态复刻图 (static faithful) — the printed figure reproduced exactly (only its points, segments, and angle marks, no more no less);
  • a 干净可交互图 (clean interactive) — the same print-identical look with no text/aids/visible helper circles, but fully draggable with every condition preserved;
  • a 动态理解图 (dynamic teaching) — the same base plus auxiliary lines, annotations, and live angle/length readouts on a 显示辅助 toggle — unchecking it returns to the exact original.

All three encode the problem’s conditions as real constraints (concyclic, intersection, reflection, midpoint, spiral similarity, locus…), so dragging a driver point keeps every condition satisfied. Precise reproduction is enforced by measuring the original image (never eyeballing) and by adding temporary measurement objects to verify coordinates/lengths/angles, which are deleted before export so the final file matches the original exactly.

It works by driving the real GeoGebra engine in a browser (GeoGebra’s own JS API) and exporting with getBase64(), so the produced files always open in GeoGebra — no fragile hand-written XML.

Install

Copy this folder into your Cursor skills directory:

# Personal (all projects):
cp -R Math2GGB ~/.cursor/skills/math2ggb

# or Project (this repo only):
cp -R Math2GGB /.cursor/skills/math2ggb

Then just ask the agent, e.g. “把这道几何题做成 GeoGebra 文件” / “make an interactive GeoGebra of this problem”.

Layout

Math2GGB/
├── SKILL.md                          # main orchestration (stages A–E)
├── references/
│   ├── geogebra-recipes.md           # commands, JS API, image-measuring, condition→constraint table, gotchas
│   └── example-hidden-circle.md      # verified example (静态复刻图 + 干净可交互图 + 动态理解图)
├── scripts/
│   └── ggb_server.py                 # serves generator + receives exported .ggb
└── templates/
    └── generator.html                # loads the real GeoGebra engine (AG layout)

Requirements

  • A browser tool (navigate, evaluate JS, screenshot).
  • Internet (the generator page loads GeoGebra from geogebra.org’s CDN).
  • python3.

Opening the output on macOS

The App Store GeoGebra Classic 6 is sandboxed: double-clicking a .ggb (or passing it on the command line) shows a blank window. Open via ☰ menu → Open → From this device → pick the file, or drag the file onto the GeoGebra window. The web app (geogebra.org/classic) opens files normally.

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add gordensun/math2ggb
新手?先看 mcpskill.org 教程 →