{"id":30830259,"url":"https://github.com/nieyuyao/three-utils-simple-example","last_synced_at":"2026-05-16T18:09:13.671Z","repository":{"id":223591669,"uuid":"760340048","full_name":"nieyuyao/three-utils-simple-example","owner":"nieyuyao","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-06T06:08:52.000Z","size":2284,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T15:52:29.194Z","etag":null,"topics":["geojson","loop-subdivision","subdivision","threejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nieyuyao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-20T08:34:55.000Z","updated_at":"2024-02-29T02:26:26.000Z","dependencies_parsed_at":"2024-04-06T07:22:20.803Z","dependency_job_id":"d6a9527b-e9c9-409b-bbe6-21e63e4a817b","html_url":"https://github.com/nieyuyao/three-utils-simple-example","commit_stats":null,"previous_names":["nieyuyao/-smooth-three-utils-example","nieyuyao/three-utils-simple-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nieyuyao/three-utils-simple-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nieyuyao%2Fthree-utils-simple-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nieyuyao%2Fthree-utils-simple-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nieyuyao%2Fthree-utils-simple-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nieyuyao%2Fthree-utils-simple-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nieyuyao","download_url":"https://codeload.github.com/nieyuyao/three-utils-simple-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nieyuyao%2Fthree-utils-simple-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33113510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["geojson","loop-subdivision","subdivision","threejs"],"created_at":"2025-09-06T15:52:27.461Z","updated_at":"2026-05-16T18:09:13.638Z","avatar_url":"https://github.com/nieyuyao.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"font-size: 16px\"\u003e\n    An simple example of smooth GeoJSON and Loop Subdivision\n\u003c/div\u003e\n\n\n#### Steps\n\n```\npnpm i\npnpm dev\n```\n\n#### Loop Subdivision\n\n```javascript\n// ...\nconst geo = new THREE.BoxGeometry(10, 10, 10)\nconst subdividedGeo = loopSubdivide(geo.toNonIndexed(), params)\nsubdividedBox.geometry = subdividedGeo\n// ...\n```\n\n- before\n\n\u003cimg style=\"width: 40%\" src=\"./screenshots/screenshot-1.png\"\u003e\u003c/img\u003e\n\n\n- after\n\n\u003cimg style=\"width: 40%\" src=\"./screenshots/screenshot-2.png\"\u003e\u003c/img\u003e\n\u003cimg style=\"width: 40%\" src=\"./screenshots/screenshot-3.png\"\u003e\u003c/img\u003e\n\n\n#### Simplify GeoJSON\n\n```javascript\n// ...\nconst group = new THREE.Group()\nconst simplified = simplifyGeo(geoJson)\n\nsimplified.features.forEach(feature =\u003e {\n    const geometry = feature.geometry as Polygon\n    const projection = d3\n        .geoMercator()\n        .center(feature.properties?.center as [number, number] ?? [0, 0])\n        .translate([0, 0])\n    geometry.coordinates.forEach((line) =\u003e {\n        const positions: number[] = []\n        line.forEach(position =\u003e {\n            const proj = projection(position as [number, number]) || [0, 0]\n            const [x, y] = proj\n            positions.push(x, -y, 0)\n        })\n        const geo = new LineGeometry()\n        geo.setPositions(positions)\n        const mesh = new Line2(geo, mat)\n        mesh.computeLineDistances()\n        group.add(mesh)\n    })\n})\n\nscene.add(group)\n// ...\n```\n\n- before\n\n\u003cimg style=\"width: 40%\" src=\"./screenshots/screenshot-4.png\"\u003e\u003c/img\u003e\n\n- after\n\n\u003cimg style=\"width: 40%\" src=\"./screenshots/screenshot-5.png\"\u003e\u003c/img\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnieyuyao%2Fthree-utils-simple-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnieyuyao%2Fthree-utils-simple-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnieyuyao%2Fthree-utils-simple-example/lists"}