{"id":29132189,"url":"https://github.com/xiaokang2022/maliang-three","last_synced_at":"2025-07-13T12:13:15.558Z","repository":{"id":252100956,"uuid":"824112526","full_name":"Xiaokang2022/maliang-three","owner":"Xiaokang2022","description":"Extension package of maliang for simple 3D drawings","archived":false,"fork":false,"pushed_at":"2025-04-11T01:55:06.000Z","size":83,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-26T14:17:25.286Z","etag":null,"topics":["3d","cross","themed","tk","tkinter","tkintertools","tkt","ui"],"latest_commit_sha":null,"homepage":"https://xiaokang2022.github.io/tkintertools/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xiaokang2022.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":"https://xiaokang2022.github.io/tkintertools/Sponsor/"}},"created_at":"2024-07-04T11:41:47.000Z","updated_at":"2025-04-10T10:55:06.000Z","dependencies_parsed_at":"2024-11-05T19:53:18.908Z","dependency_job_id":"a0f7b3d6-8e32-409f-9007-71ca1bd6382c","html_url":"https://github.com/Xiaokang2022/maliang-three","commit_stats":null,"previous_names":["xiaokang2022/tkintertools-3d","xiaokang2022/maliang-three"],"tags_count":4,"template":false,"template_full_name":"Xiaokang2022/Template","purl":"pkg:github/Xiaokang2022/maliang-three","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xiaokang2022%2Fmaliang-three","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xiaokang2022%2Fmaliang-three/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xiaokang2022%2Fmaliang-three/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xiaokang2022%2Fmaliang-three/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xiaokang2022","download_url":"https://codeload.github.com/Xiaokang2022/maliang-three/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xiaokang2022%2Fmaliang-three/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262723828,"owners_count":23354121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","cross","themed","tk","tkinter","tkintertools","tkt","ui"],"created_at":"2025-06-30T06:32:46.560Z","updated_at":"2025-06-30T06:32:57.746Z","avatar_url":"https://github.com/Xiaokang2022.png","language":"Python","funding_links":["https://xiaokang2022.github.io/tkintertools/Sponsor/"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003emaliang-three\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003ca title=\"Official Website\" href=\"https://xiaokang2022.github.io/maliang/\"\u003ehttps://xiaokang2022.github.io/maliang/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eExtension package of \u003ccode\u003emaliang\u003c/code\u003e for simple 3D drawings\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/releases\"\u003e\u003cimg alt=\"Version\" src=\"https://img.shields.io/github/v/release/Xiaokang2022/maliang-three?include_prereleases\u0026logo=github\u0026label=Version\" title=\"Latest Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://pypistats.org/packages/maliang-three\"\u003e\u003cimg alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/maliang-three?label=Downloads\u0026logo=pypi\u0026logoColor=skyblue\" title=\"Downloads\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://pepy.tech/project/maliang-three\"\u003e\u003cimg alt=\"Total Downloads\" src=\"https://img.shields.io/pepy/dt/maliang-three?logo=pypi\u0026logoColor=gold\u0026label=Total%20Downloads\" title=\"Total Downloads\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three\"\u003e\u003cimg alt=\"Size\" src=\"https://img.shields.io/github/languages/code-size/Xiaokang2022/maliang-three?label=Size\u0026logo=github\" title=\"Code Size\"/\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/watchers\"\u003e\u003cimg alt=\"Watchers\" src=\"https://img.shields.io/github/watchers/Xiaokang2022/maliang-three?label=Watchers\u0026logo=github\u0026style=flat\" title=\"Watchers\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/forks\"\u003e\u003cimg alt=\"Forks\" src=\"https://img.shields.io/github/forks/Xiaokang2022/maliang-three?label=Forks\u0026logo=github\u0026style=flat\" title=\"Forks\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/stargazers\"\u003e\u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/Xiaokang2022/maliang-three?label=Stars\u0026color=gold\u0026logo=github\u0026style=flat\" title=\"Stars\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/issues\"\u003e\u003cimg alt=\"Issues\" src=\"https://img.shields.io/github/issues/Xiaokang2022/maliang-three?label=Issues\u0026logo=github\" title=\"Issues\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/pulls\"\u003e\u003cimg alt=\"Pull Requests\" src=\"https://img.shields.io/github/issues-pr/Xiaokang2022/maliang-three?label=Pull%20Requests\u0026logo=github\" title=\"Pull Requests\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/discussions\"\u003e\u003cimg alt=\"Discussions\" src=\"https://img.shields.io/github/discussions/Xiaokang2022/maliang-three?label=Discussions\u0026logo=github\" title=\"Discussions\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/Xiaokang2022/maliang-three/pulse\"\u003e\u003cimg alt=\"Insights\" src=\"https://repobeats.axiom.co/api/embed/764fee8a54207889b8f6faeade4bf371b06ec71f.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://star-history.com/#Xiaokang2022/maliang-three\u0026Date\"\u003e\n        \u003cpicture\u003e\n            \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=Xiaokang2022/maliang-three\u0026type=Date\u0026theme=dark\" /\u003e\n            \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=Xiaokang2022/maliang-three\u0026type=Date\" /\u003e\n            \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=Xiaokang2022/maliang-three\u0026type=Date\" /\u003e\n        \u003c/picture\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n📦 Installation\n----------------\n\n```bash\npip install maliang-three\n```\n\n### 👀 Preview\n\n![preview](preview.png)\n\n```python\nimport itertools\nimport math\nimport statistics\n\nimport maliang\nfrom maliang import theme, three\n\nroot = maliang.Tk(title=\"maliang-three\")\nspace = three.Space(auto_zoom=True, free_anchor=True, keep_ratio=\"min\")\nspace.light.update(bg=\"white\")\nspace.dark.update(bg=\"black\")\nspace.configure(bg=\"black\" if theme.get_color_mode() == \"dark\" else \"light\")\nspace.place(width=1280, height=720, x=640, y=360, anchor=\"center\")\nspace.update()  # NOTE: This line is very important!\n\n### Inside ###\n\nm = 150 * math.sqrt(50 - 10*math.sqrt(5)) / 10\nn = 150 * math.sqrt(50 + 10*math.sqrt(5)) / 10\npoints = []\ndis_side = (\n    150\n    * (3 * math.sqrt(3) + math.sqrt(15))\n    / 12\n    / ((math.sqrt(10 + 2 * math.sqrt(5))) / 4)\n)\ncount, color_lst = 0, [\"00\", \"77\", \"FF\"]\ncolors = [f\"#{r}{g}{b}\" for r in color_lst for g in color_lst for b in color_lst]\n\nfor i in m, -m:\n    for j in n, -n:\n        points.append([0, j, i])\n        points.append([i, 0, j])\n        points.append([j, i, 0])\n\nfor p in itertools.combinations(points, 3):\n    dis = math.hypot(*[statistics.fmean(c[i] for c in p) for i in range(3)])\n    if math.isclose(dis, dis_side):\n        three.Plane(space, *p, fill=colors[count], outline=\"grey\")\n        count += 1\n\n### Outside ###\n\nr = 250\n\nO = three.Point(space, (0, 0, 0), fill='white', size=3)\nX = three.Line(space, (0, 0, 0), (1, 0, 0), fill='')\nY = three.Line(space, (0, 0, 0), (0, 1, 0), fill='')\nZ = three.Line(space, (0, 0, 0), (0, 0, 1), fill='')\n\nring: dict[str, list[three.Text3D]] = {'x': [], 'y': [], 'z': []}\nline: dict[str, list[three.Text3D]] = {'x': [], 'y': [], 'z': []}\n\nfor i in range(26):\n    t = chr(65+i)\n    φ = i/26 * math.tau\n    c1 = r * math.sin(φ)\n    c2 = r * math.cos(φ)\n    ring['x'].append(three.Text3D(space, (0, c1, c2), text=t, fill='red'))\n    ring['y'].append(three.Text3D(space, (c1, 0, c2), text=t, fill='forestgreen'))\n    ring['z'].append(three.Text3D(space, (c1, c2, 0), text=t, fill='royalblue'))\n\nfor i in range(10):\n    t = str(i)\n    c = (i+1) * 500/11 - r\n    line['x'].append(three.Text3D(space, (c, 0, 0), text=t, fill='#00FFFF'))\n    line['y'].append(three.Text3D(space, (0, c, 0), text=t, fill='#FF00FF'))\n    line['z'].append(three.Text3D(space, (0, 0, c), text=t, fill='#FFFF00'))\n\n\ndef text_animation() -\u003e None:\n    \"\"\"Make the Text spin.\"\"\"\n    for obj3D in ring['x']:\n        obj3D.rotate(0.05, axis=X.coordinates)\n    for obj3D in ring['y']:\n        obj3D.rotate(0.05, axis=Y.coordinates)\n    for obj3D in ring['z']:\n        obj3D.rotate(0.05, axis=Z.coordinates)\n    for obj3D in line['x']:\n        obj3D.rotate(-0.05, axis=Y.coordinates)\n    for obj3D in line['y']:\n        obj3D.rotate(-0.05, axis=Z.coordinates)\n    for obj3D in line['z']:\n        obj3D.rotate(-0.05, axis=X.coordinates)\n    for obj3D in space.components:\n        obj3D.rotate(0, -0.01, 0.01, center=O.center())\n        obj3D.update()\n    space.space_sort()\n    root.after(10, text_animation)\n\n\ntext_animation()\nroot.mainloop()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaokang2022%2Fmaliang-three","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaokang2022%2Fmaliang-three","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaokang2022%2Fmaliang-three/lists"}