Spec Summary
{
"title": "圆台圆柱与球组合体",
"meta": "圆台与同轴圆柱;右上方球与圆台侧面外切,含切圆、遮挡虚线和隐藏边",
"camera": {
"position": [
9.36,
8.298,
16.669
],
"target": [
0.367,
1.702,
-0.245
],
"orthoSize": 5.898
},
"counts": {
"vertices": 205,
"faces": 28,
"edges": 0,
"aux_lines": 157,
"aux_faces": 1,
"primitives": 1,
"labels": 4
},
"primitive_types": [
"sphere"
],
"primitives": [
{
"type": "sphere",
"radius": 1.2771841929880994,
"position": [
2.150144814780539,
3.067163494845243,
0.0
],
"color": "#8fbadd"
}
],
"labels": [
{
"point": "O",
"text": "O"
},
{
"point": "T",
"text": "T"
},
{
"point": "l",
"text": "l"
},
{
"point": "alpha_pt",
"text": "α"
}
],
"vertex_names": [
"FA",
"FB",
"FC",
"FD",
"FE",
"FF",
"FG",
"FH",
"FI",
"FJ",
"FK",
"FL",
"FM",
"FN",
"FP",
"FQ",
"FR",
"FS",
"FT",
"FU",
"FV",
"FW",
"FX",
"FY",
"CA",
"CB",
"CC",
"CD",
"CE",
"CF",
"CG",
"CH",
"CI",
"CJ",
"CK",
"CL",
"CM",
"CN",
"CP",
"CQ",
"CR",
"CS",
"CT",
"CU",
"CV",
"CW",
"CX",
"CY",
"O",
"T",
"l",
"l0",
"fhb0",
"fhb1",
"fhb2",
"fhb3",
"fhb4",
"fhb5",
"fhb6",
"fhb7",
"fhb8",
"fhb9",
"fhb10",
"fhb11",
"fhb12",
"fhb13",
"fhb14",
"fhb15",
"fhb16",
"fhb17",
"fhb18",
"fht0",
"fht1",
"fht2",
"fht3",
"fht4",
"fht5",
"fht6",
"fht7",
"fht8",
"fht9",
"fht10",
"fht11",
"fht12",
"fht13",
"fht14",
"fht15",
"fht16",
"fht17",
"fht18",
"chb0",
"chb1",
"chb2",
"chb3",
"chb4",
"chb5",
"chb6",
"chb7",
"chb8",
"chb9",
"chb10",
"chb11",
"chb12",
"chb13",
"chb14",
"chb15",
"chb16",
"chb17",
"chb18",
"cht0",
"cht1",
"cht2",
"cht3",
"cht4",
"cht5",
"cht6",
"cht7",
"cht8",
"cht9",
"cht10"
],
"faces_sample": [
{
"points": [
"FL",
"FK",
"FJ",
"FI",
"FH",
"FG",
"FF",
"FE",
"FD",
"FC",
"FB",
"FA"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FM",
"FN",
"FP",
"FQ",
"FR",
"FS",
"FT",
"FU",
"FV",
"FW",
"FX",
"FY"
],
"color": "#eef2f7",
"opacity": 0.34
},
{
"points": [
"FA",
"FB",
"FN",
"FM"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FB",
"FC",
"FP",
"FN"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FC",
"FD",
"FQ",
"FP"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FD",
"FE",
"FR",
"FQ"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FE",
"FF",
"FS",
"FR"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FF",
"FG",
"FT",
"FS"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FG",
"FH",
"FU",
"FT"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FH",
"FI",
"FV",
"FU"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FI",
"FJ",
"FW",
"FV"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FJ",
"FK",
"FX",
"FW"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FK",
"FL",
"FY",
"FX"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"FL",
"FA",
"FM",
"FY"
],
"color": "#edf2f7",
"opacity": 0.18
},
{
"points": [
"CL",
"CK",
"CJ",
"CI",
"CH",
"CG",
"CF",
"CE",
"CD",
"CC",
"CB",
"CA"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CM",
"CN",
"CP",
"CQ",
"CR",
"CS",
"CT",
"CU",
"CV",
"CW",
"CX",
"CY"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CA",
"CB",
"CN",
"CM"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CB",
"CC",
"CP",
"CN"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CC",
"CD",
"CQ",
"CP"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CD",
"CE",
"CR",
"CQ"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CE",
"CF",
"CS",
"CR"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CF",
"CG",
"CT",
"CS"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CG",
"CH",
"CU",
"CT"
],
"color": "#f8fafc",
"opacity": 0.16
},
{
"points": [
"CH",
"CI",
"CV",
"CU"
],
"color": "#f8fafc",
"opacity": 0.16
}
],
"edges_sample": [],
"aux_lines_sample": [
{
"points": [
"l0",
"l"
],
"dash": false,
"color": "#b45309"
},
{
"points": [
"fhb0",
"fhb1"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb1",
"fhb2"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb2",
"fhb3"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb3",
"fhb4"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb4",
"fhb5"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb5",
"fhb6"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb6",
"fhb7"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb7",
"fhb8"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb8",
"fhb9"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb9",
"fhb10"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb10",
"fhb11"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb11",
"fhb12"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb12",
"fhb13"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb13",
"fhb14"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb14",
"fhb15"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb15",
"fhb16"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb16",
"fhb17"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fhb17",
"fhb18"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht0",
"fht1"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht1",
"fht2"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht2",
"fht3"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht3",
"fht4"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht4",
"fht5"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht5",
"fht6"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht6",
"fht7"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht7",
"fht8"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht8",
"fht9"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht9",
"fht10"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht10",
"fht11"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht11",
"fht12"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht12",
"fht13"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht13",
"fht14"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht14",
"fht15"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht15",
"fht16"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht16",
"fht17"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"fht17",
"fht18"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb0",
"chb1"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb1",
"chb2"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb2",
"chb3"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb3",
"chb4"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb4",
"chb5"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb5",
"chb6"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb6",
"chb7"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb7",
"chb8"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb8",
"chb9"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb9",
"chb10"
],
"dash": true,
"color": "#111827"
},
{
"points": [
"chb10",
"chb11"
],
"dash": true,
"color": "#111827"
}
],
"aux_faces_sample": [
{
"points": [
"a1",
"a2",
"a3",
"a4"
],
"color": "#dbeafe",
"opacity": 0.08
}
]
}
Code Evidence
1: def generate(rng, tk):
2: import math
3:
4: n = 12
5: R = rng.uniform(2.25, 2.60)
8: rc = r * rng.uniform(0.52, 0.70)
9:
10: vs_f, faces_f = tk.frustum(n, r_bot=R, r_top=r, h=H)
11: bot0 = [tk._NAMES[i] for i in range(n)]
12: top0 = [tk._NAMES[n + i] for i in range(n)]
13:
14: vs = {}
17: vs[mf[k]] = v
18:
19: faces = []
20: for idx, f in enumerate(faces_f):
21: ff = {"points": [mf[p] for p in f["points"]]}
22: if idx == 1:
23: ff.update({"color": "#eef2f7", "opacity": 0.34})
24: else:
25: ff.update({"color": "#edf2f7", "opacity": 0.18})
26: faces.append(ff)
27:
28: vs_c, faces_c = tk.prism(n, r=rc, h=H)
29: mc = {k: "C" + k for k in vs_c}
30: for k, v in vs_c.items():
31: vs[mc[k]] = v
32: for f in faces_c:
33: faces.append({"points": [mc[p] for p in f["points"]],
34: "color": "#f8fafc", "opacity": 0.16})
35:
36: i_right = max(range(n), key=lambda i: vs_f[bot0[i]][0])
37: A = vs[mf[bot0[i_right]]]
51: vs["T"] = (Tx, Ty, Tz)
52:
53: aux_lines = []
54:
55: aux_lines.append(tk.rotation_axis(vs, (0.0, -0.18, 0.0), (0.0, H + 0.42, 0.0), name="l"))
56:
57: def add_seg(a, b, dash=True, color="#111827"):
58: aux_lines.append({"points": [a, b], "dash": bool(dash), "color": color})
59:
60: def add_arc_y(prefix, radius, y, start_deg, end_deg, parts, dash=True, color="#111827"):
61: names = []
62: for j in range(parts + 1):
63: ang = math.radians(start_deg + (end_deg - start_deg) * j / parts)
64: nm = prefix + str(j)
69: return names
70:
71: def add_sphere_vertical_arc(prefix, start_deg, end_deg, parts, dash=True, color="#111827"):
72: names = []
73: for j in range(parts + 1):
74: ang = math.radians(start_deg + (end_deg - start_deg) * j / parts)
75: nm = prefix + str(j)
80: return names
81:
82: def add_sphere_horizontal_arc(prefix, y, start_deg, end_deg, parts, dash=True, color="#111827"):
83: dy = y - O[1]
84: rho2 = Rs * Rs - dy * dy
85: if rho2 <= 0:
86: return []
98: hidden_color = "#111827"
99:
100: add_arc_y("fhb", R, 0.0, 180.0, 360.0, 18, dash=True, color=hidden_color)
101: add_arc_y("fht", r, H, 180.0, 360.0, 18, dash=True, color=hidden_color)
102:
103: add_arc_y("chb", rc, 0.0, 180.0, 360.0, 18, dash=True, color=hidden_color)
104: add_arc_y("cht", rc, H, 180.0, 360.0, 18, dash=True, color=hidden_color)
105:
106: for i in range(n):
107: bp = vs[mf[bot0[i]]]
108: if bp[2] < -1e-6:
122: add_seg(cut_names[j], cut_names[(j + 1) % 32], dash=False, color="#6b7280")
123:
124: add_sphere_vertical_arc("svh", 210.0, 318.0, 20, dash=True, color=hidden_color)
125: add_sphere_horizontal_arc("soh", H, 132.0, 238.0, 18, dash=True, color=hidden_color)
126:
127: alpha_size = max(2.15 * Tx, 1.35 * R)
128: vs["a1"] = (-alpha_size, Ty, -alpha_size)
129: vs["a2"] = (alpha_size, Ty, -alpha_size)
134: vs["alpha_pt"] = (alpha_size + 0.15, Ty, alpha_size + 0.10)
135:
136: aux_faces = [tk.face(["a1", "a2", "a3", "a4"], color="#dbeafe", opacity=0.08)]
137:
138: prims = [tk.prim_sphere(r=Rs, center=O, color="#8fbadd")]
139:
140: cam = tk.auto_camera(vs, primitives=prims, azim=28.0, elev=19.0, pad=1.58)
141: spec = tk.make_spec(
142: "圆台圆柱与球组合体",
143: "圆台与同轴圆柱;右上方球与圆台侧面外切,含切圆、遮挡虚线和隐藏边",
144: vs,
145: faces=faces,
146: aux_lines=aux_lines,
147: aux_faces=aux_faces,
148: primitives=prims,
149: labels=[],
150: camera=cam
151: )
152: spec["labels"] = [
153: {"point": "O", "text": "O"},
154: {"point": "T", "text": "T"},
155: {"point": "l", "text": "l"},
156: {"point": "alpha_pt", "text": "α"}
157: ]
158:
159: correct = "球与圆台外切,且切点为一个圆"
160: vals = [
161: correct,
162: "球与圆台相交",
163: "球与圆台外离",
164: "球内切于圆台"
165: ]
166: letters = ["A", "B", "C", "D"]
167: rng.shuffle(letters)
168: options = {letters[i]: vals[i] for i in range(4)}
171: return tk.item(
172: spec,
173: "如图,在该组合体中,圆台外上方球与圆台的位置关系是?",
174: options,
175: answer
176: )