Sphere

From tiwe0/GeoChat · View interactive version

Sphere is an AI agent skill from the GitHub repository tiwe0/GeoChat. 球、球面截线、内切外接、空间距离与球心定位技能。

How to use this skill

Skill file

球

用于球心/半径定位、平面截球、相交球、多面体内切/外接球和球面距离。先把条件翻译为“到点等距”或“到面等距”,再构造球面。若目标内核不支持 Sphere,不臆造命令,改用球心、半径线和关键截面圆。

关注点:

数学与能力规则

原生小例:球的平面截圆

spO = Point((0, 0, 0))
spR = 5
spHeight = 4
spDistance = abs(spHeight)
spSphere = Sphere(spO, spR)
spPlane: z = spHeight
spSectionKind = If(spDistance < spR, "circle", spDistance == spR, "point", "undefined")
spSectionRadius = If(spDistance <= spR, sqrt(spR^2 - spDistance^2))
spCenter = If(spDistance <= spR, Point((0, 0, spHeight)))
spRadiusEnd = If(spDistance < spR, Point((spSectionRadius, 0, spHeight)))
spRadiusSeg = If(spDistance < spR, Segment(spCenter, spRadiusEnd))
spCircle = If(spDistance < spR, Intersect(spPlane, spSphere))
spTangentPoint = If(spDistance == spR, Point((0, 0, spHeight)))
SetColor(spSphere, 86, 180, 233)
SetFilling(spSphere, 0.12)
SetColor(spCircle, 213, 94, 0)
SetLineThickness(spCircle, 6)

预期:初始 spHeight=4 时,spSectionKind="circle",spCircle 圆心为 (0,0,4)、spSectionRadius=3,与 3²+4²=5² 一致。只修改 spHeight 或 spR 会联动更新平面、圆心、半径和端点;abs(spHeight)=spR 时 spSectionKind="point" 且只有 spTangentPoint 定义,abs(spHeight)>spR 时为 "undefined",截圆、切点和半径均不定义。

检查与降级

官方依据

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.