{"id":17720628,"url":"https://github.com/freed-wu/computer-graphics-homework","last_synced_at":"2025-09-19T04:31:59.629Z","repository":{"id":61862913,"uuid":"405814883","full_name":"Freed-Wu/computer-graphics-homework","owner":"Freed-Wu","description":"A backup of my homework. 计算机图形学","archived":false,"fork":false,"pushed_at":"2025-08-25T18:24:47.000Z","size":1019,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-25T20:32:48.360Z","etag":null,"topics":["computer-graphics","homework","python","ustc"],"latest_commit_sha":null,"homepage":"https://computer-graphics-demo.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freed-Wu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-09-13T03:01:38.000Z","updated_at":"2024-12-15T01:58:00.000Z","dependencies_parsed_at":"2023-02-19T12:40:16.439Z","dependency_job_id":"4f05f3fc-8199-4f17-b218-1caa521bbe5c","html_url":"https://github.com/Freed-Wu/computer-graphics-homework","commit_stats":{"total_commits":39,"total_committers":3,"mean_commits":13.0,"dds":"0.10256410256410253","last_synced_commit":"6efa7169166507d23465db92e0632e277ff1483a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Freed-Wu/computer-graphics-homework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freed-Wu%2Fcomputer-graphics-homework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freed-Wu%2Fcomputer-graphics-homework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freed-Wu%2Fcomputer-graphics-homework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freed-Wu%2Fcomputer-graphics-homework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freed-Wu","download_url":"https://codeload.github.com/Freed-Wu/computer-graphics-homework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freed-Wu%2Fcomputer-graphics-homework/sbom","scorecard":{"id":52877,"data":{"date":"2025-08-11","repo":{"name":"github.com/Freed-Wu/computer-graphics-homework","commit":"6efa7169166507d23465db92e0632e277ff1483a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/Freed-Wu/computer-graphics-homework/main.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:36","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:59","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.03rc8 not signed: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80732819","Warn: release artifact 0.03rc6 not signed: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80730465","Warn: release artifact 0.03rc5 not signed: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80729609","Warn: release artifact 0.03rc4 not signed: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80729006","Warn: release artifact 0.03 not signed: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80734818","Warn: release artifact 0.03rc8 does not have provenance: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80732819","Warn: release artifact 0.03rc6 does not have provenance: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80730465","Warn: release artifact 0.03rc5 does not have provenance: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80729609","Warn: release artifact 0.03rc4 does not have provenance: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80729006","Warn: release artifact 0.03 does not have provenance: https://api.github.com/repos/Freed-Wu/computer-graphics-homework/releases/80734818"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/main.yml:41"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}}]},"last_synced_at":"2025-08-15T00:03:27.572Z","repository_id":61862913,"created_at":"2025-08-15T00:03:27.572Z","updated_at":"2025-08-15T00:03:27.572Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275881571,"owners_count":25545398,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["computer-graphics","homework","python","ustc"],"created_at":"2024-10-25T15:28:33.413Z","updated_at":"2025-09-19T04:31:59.319Z","avatar_url":"https://github.com/Freed-Wu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# computer-graphics-homework\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/computer-graphics-homework/master.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/computer-graphics-homework/master)\n[![github/workflow](https://github.com/Freed-Wu/computer-graphics-homework/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/computer-graphics-homework/actions)\n[![codecov](https://codecov.io/gh/Freed-Wu/computer-graphics-homework/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/computer-graphics-homework)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FFreed-Wu%2Fcomputer-graphics-homework.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FFreed-Wu%2Fcomputer-graphics-homework)\n[![readthedocs](https://shields.io/readthedocs/computer-graphics-demo)](https://computer-graphics-demo.readthedocs.io)\n\n[![github/downloads](https://shields.io/github/downloads/Freed-Wu/computer-graphics-homework/total)](https://github.com/Freed-Wu/computer-graphics-homework/releases)\n[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/computer-graphics-homework/latest/total)](https://github.com/Freed-Wu/computer-graphics-homework/releases/latest)\n[![github/issues](https://shields.io/github/issues/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/issues)\n[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/issues?q=is%3Aissue+is%3Aclosed)\n[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/pulls)\n[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/pulls?q=is%3Apr+is%3Aclosed)\n[![github/discussions](https://shields.io/github/discussions/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/discussions)\n[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/milestones)\n[![github/forks](https://shields.io/github/forks/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/network/members)\n[![github/stars](https://shields.io/github/stars/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/stargazers)\n[![github/watchers](https://shields.io/github/watchers/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/watchers)\n[![github/contributors](https://shields.io/github/contributors/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/graphs/contributors)\n[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/graphs/commit-activity)\n[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/commits)\n[![github/release-date](https://shields.io/github/release-date/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/releases/latest)\n\n[![github/license](https://shields.io/github/license/Freed-Wu/computer-graphics-homework)](https://github.com/Freed-Wu/computer-graphics-homework/blob/master/LICENSE)\n![github/languages](https://shields.io/github/languages/count/Freed-Wu/computer-graphics-homework)\n![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/computer-graphics-homework)\n![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/computer-graphics-homework)\n![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/computer-graphics-homework)\n![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/computer-graphics-homework)\n![github/v](https://shields.io/github/v/release/Freed-Wu/computer-graphics-homework)\n\n[![pypi/downloads](https://shields.io/pypi/dd/computer-graphics-demo)](https://pypi.org/project/computer-graphics-demo/0.0.2/#files)\n[![pypi/v](https://shields.io/pypi/v/computer-graphics-demo)](https://pypi.org/project/computer-graphics-demo)\n![pypi/format](https://shields.io/pypi/format/computer-graphics-demo)\n![pypi/status](https://shields.io/pypi/status/computer-graphics-demo)\n![pypi/implementation](https://shields.io/pypi/implementation/computer-graphics-demo)\n![pypi/pyversions](https://shields.io/pypi/pyversions/computer-graphics-demo)\n\n## 三次书面作业\n\n各 10 分，共 30 分；查找一篇你看不懂的计算机图形学文献，整理出以下问题\n\n- 该论文解决的问题是什么？\n- 采用的是什么方法？\n- 得到了什么结论\n\n## 一份编程作业\n\n30 分；算法任选，不可调用已有函数（画点函数除外），提交可执行程序和实验报告。\n\n```shell\n$ pip install computer-graphics-demo\n$ cgdemo --help\nComputer graphics algorithms demonstration.\n\nusage: cgdemo [-hVdns] [ [-v] | [-q|-qq] ] [-x \u003cheight\u003e] [-y \u003cwidth\u003e] [-o \u003cout\u003e]\n    [-c \u003ccolor\u003e] [-a \u003cargs\u003e] [-t \u003ctime\u003e] \u003ccommand\u003e\n\noptions:\n    -h, --help              Show this screen.\n    -V, --version           Show version.\n    -d, --debug             Debug this program.\n    -n, --dry-run           Don't show any canvas.\n    -s, --second            Use second algorithm. See section algorithm.\n    -v, --verbose           Output verbosity. (e.g., default arguments)\n    -q, --quiet             Redirect stdout to null. Again for stderr.\n    -x, --height \u003cheight\u003e   Height of canvas. [default: 512]\n    -y, --width \u003cwidth\u003e     Width of canvas. [default: 1024]\n    -o, --output \u003cout\u003e      Save output to a file. See section output.\n    -c, --color \u003ccolor\u003e     Color of graph. [default: 255,0,0]\n    -a, --args \u003cargs\u003e       Arguments. See section argument.\n    -t, --timeout \u003ctime\u003e    Auto exit. [default: 30]\n\ncommands:\n    line                    Draw a line.\n    circle                  Draw a circle.\n    ellipse                 Draw a ellipse.\n    fill                    Fill a region.\n    bezier                  Draw a Bezier curve.\n    b                       Draw a B-spline.\n    koch                    Draw a Koch curve.\n    mandelbrot              Draw a Mandelbrot set.\n    julia                   Draw a Julia set.\n    fern                    Draw a fern.\n    reality                 Draw a scene by hidden surface removal, mirror\n                            reflection, texture, etc.\n\noutput: (%d is format string)\n    *%d*.png\n    *%d*.jpg\n    *%d*.bmp\n    */video.mp4\n    */video.gif\n\nalgorithm:\n                default                     second\n    line        midpoint                    bresenham\n    circle      midpoint                    bresenham\n    ellipse     midpoint\n    fill        scan                        seed\n    bezier      Bezier\n    b           De_Boor\n    koch        Lindenmayer_system\n    mandelbrot  f(z)=z*z+c\n    julia       f(z)=z*z+c\n    fern        iterated_fuction_system\n    reality     ray_tracing\n\nargument:\n    line        x1,y1,x2,y2,...\n    circle      x0,y0,r\n    ellipse     x0,y0,a,b\n    fill (scan) x1,y1,x2,y2,x3,y3,...\n    fill (seed) x_seed,y_seed,x1,y1,x2,y2,x3,y3,...\n    bezier      sample_number,x1,y1,...\n    b           degree,x1,y1,...\n    koch        scale,iteration_max,x0,y0\n    mandelbrot  scale,iteration_max\n    julia       scale,iteration_max\n    fern        scale,iteration_max,x0,y0\n    reality     sample_number,r_aperture\n```\n\n### 参数修改\n\n- `cgdemo -c255,0,0 -a0,0,50,100,100,30 line` 可以画出一条从 (0, 0)\n  到 (50, 100) 再到 (100, 30) 的红色直线。其余 10 个命令类似。\n- 对有的命令提供了 2 种不同算法的实现，用 `-s` 切换算法。\n- 可以用 `-o` 输出图片或视频。注意支持的文件格式和文件名。\n- 默认颜色均为红色，最后一个命令除外（因为有多个颜色，改为随机）。\n- 默认参数可通过 `-v` 查看。\n- `-n` 可以不打开窗口。\n\n### 注意事项\n\n直线允许有 16 种情况（没有使用 16 个条件判断，那样的实现太脏了）\n\n![16line](images/16line.png \"16 种直线\")\n\n椭圆允许有 $a = b$ 等 3 种情况。\n\n雪花曲线的参数中迭代次数太大会因为 Out of Memory 被 kill 。\n\n为了保证跨平台性和开发效率使用 python 开发。所以第一次运行等待时间会长一点，第\n二次之后会因为生成字节码快一点。\n\n### 代码结构\n\n```shell\n$ exa -T\n.\n├── 1.md // 前 3 次作业的 markdown 文件\n├── 2.md\n├── 3.md\n├── docs\n│  ├── api.rst\n│  ├── conf.py\n│  ├── index.rst\n│  ├── make.bat\n│  └── Makefile\n├── images // 本文中出现的所有图片\n│  ├── 16line.png\n│  ├── b.png\n│  ├── bezier.png\n│  ├── circle.png\n│  ├── ellipse.png\n│  ├── fern.png\n│  ├── fill.png\n│  ├── julia.png\n│  ├── koch.png\n│  ├── line.png\n│  ├── mandelbrot.png\n│  └── reality.png\n├── LICENSE\n├── pyproject.toml\n├── README.md // 本文\n├── requirements.txt\n├── scripts\n│  └── generate_images.sh // 运行此程序可以生成本文中出现的所有图片\n├── setup.py\n└── src // 所有算法的演示，名字与算法的对应关系见 `cgdemo --help` 的输出\n   └── computer_graphics_demo\n      ├── __init__.py\n      ├── __main__.py // 主程序\n      ├── b.py\n      ├── bezier.py\n      ├── circle\n      │  ├── __init__.py\n      │  ├── bresenham.py\n      │  └── midpoint.py\n      ├── ellipse.py\n      ├── fern.py\n      ├── fill\n      │  ├── __init__.py\n      │  ├── scan.py\n      │  └── seed.py\n      ├── julia.py\n      ├── koch.py\n      ├── line\n      │  ├── __init__.py\n      │  ├── bresenham.py\n      │  └── midpoint.py\n      ├── mandelbrot.py\n      └── reality.py\n```\n\n主程序只负责命令行选项的读取和 GUI 窗口的初始化，实际会调用 `utils` 下各个子模\n块的 `paint()`{.py} 完成绘制。 `paint()`{.py} 实现算法，最终会调用\n`setpixel()`{.py}, `set8pixel()`{.py}, `set4pixel()`{.py} 等函数。\n\n参考的来源均在注释中标出，例如 wikipedia 和某些博客中 C 或 python 的代码。\n\n以下生成的图形均是在默认参数下生成的，比如 `cgdemo line`{.sh} 如果想修改参数看\n[参数修改](#%E5%8F%82%E6%95%B0%E4%BF%AE%E6%94%B9)，修改某些参数需要注意，比如雪花曲线的参数中迭代次数不要太\n大等等。\n\n### 图元的生成\n\n![line](images/line.png \"直线\")\n\n![circle](images/circle.png \"圆\")\n\n![ellipse](images/ellipse.png \"椭圆\")\n\n![fill](images/fill.png \"区域填充\")\n\n### 样条曲线的生成\n\n![bezier](images/bezier.png \"Bezier曲线\")\n\n![b](images/b.png \"B-样条曲线的生成\")\n\n### 分形图形的生成\n\n![koch](images/koch.png \"Koch曲线\")\n\n![mandelbrot](images/mandelbrot.png \"Mandelbrot集\")\n\n![julia](images/julia.png \"Julia集\")\n\n![fern](images/fern.png \"蕨类植物\")\n\n### 真实感图形的生成\n\n显示一个具有真实感场景的图形，几何造型自定义，包括消隐、镜面反射、纹理效果\n\n![reality](images/reality.png \"真实感图形\")\n\n## 期末考试\n\n40 分\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreed-wu%2Fcomputer-graphics-homework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreed-wu%2Fcomputer-graphics-homework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreed-wu%2Fcomputer-graphics-homework/lists"}