MIERUNE / plateau-gis-converter

A proof of concept GUI and CLI tool for converting PLATEAU's 3D city models (CityGML) of Japan into various geospatial formats, including 3D Tiles, MVT, and GeoPackage.
https://mierune.github.io/plateau-gis-converter/
MIT License
51 stars 10 forks source link

OBJ Sinkにアトラス化を付与した`obj_atlas sink`の作成 #612

Closed nokonoko1203 closed 1 month ago

nokonoko1203 commented 1 month ago

Description(変更内容)

Notes(連絡事項)

cargo run -- <input_path> --sink obj_atlas -o transform=use_texture -o split=true --output <output_path>
coderabbitai[bot] commented 1 month ago

Walkthrough

この変更は、画像の読み込み機能を削除し、テクスチャパッキング機能を強化したことに焦点を当てています。ObjAtlasSinkがテクスチャのキャッシュとパッカーを統合し、マテリアルの処理ロジックを簡素化。これにより、全体のパフォーマンスが向上し、マテリアル管理が効率的になりますが、マテリアルが見つからない場合のエラーハンドリングが簡素化されました。

Changes

ファイル 変更の概要
nusamai/src/sink/obj_atlas/material.rs load_image関数を削除し、不要なインポートを整理。これにより、画像の直接読み込み機能が失われました。
nusamai/src/sink/obj_atlas/mod.rs TextureCacheTexturePackerの導入により、テクスチャ管理機能を強化。新しい制御フローでテクスチャをキャッシュに挿入し、アトラスをエクスポートする機能を追加。
nusamai/src/sink/obj_atlas/obj_writer.rs write_obj関数からmaterialsパラメータを削除し、マテリアルキャッシュに依存するように変更。マテリアルの処理を簡素化。

Poem

🐰 うさぎの詩
画像は消えた、でも心配無用、
テクスチャの旅は、さらに楽しく、
新しいアトラスを作り、形を変え、
マテリアルの管理、速さが勝つ!
さあ、みんなで祝おう、コードの進化を! 🎉


Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 125 lines in your changes missing coverage. Please review.

Files Patch % Lines
nusamai/src/sink/obj_atlas/mod.rs 0.00% 118 Missing :warning:
nusamai/src/sink/obj_atlas/obj_writer.rs 0.00% 7 Missing :warning:
Additional details and impacted files | [Components](https://app.codecov.io/gh/MIERUNE/plateau-gis-converter/pull/612/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MIERUNE) | Coverage Δ | | |---|---|---| | [GUI](https://app.codecov.io/gh/MIERUNE/plateau-gis-converter/pull/612/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MIERUNE) | `∅ <ø> (∅)` | | | [Backend](https://app.codecov.io/gh/MIERUNE/plateau-gis-converter/pull/612/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MIERUNE) | `62.51% <0.00%> (-0.44%)` | :arrow_down: | | [Libraries](https://app.codecov.io/gh/MIERUNE/plateau-gis-converter/pull/612/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MIERUNE) | `89.82% <ø> (ø)` | |

:loudspeaker: Thoughts on this report? Let us know!

satoshi7190 commented 1 month ago

@nokonoko1203 変換処理中にオーバーフローがatlas-packerのtexture.rsファイルの161行目で発生しています。 ご確認お願いします。

thread 'pipeline-sink' panicked at /Users/hoge/.cargo/git/checkouts/atlas-packer-0eceddb6ce829bab/c2c3e78/src/texture.rs:161:44:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR nusamai::pipeline::runner > Sink thread panicked with message: attempt to subtract with overflow
 ERROR nusamai                   > Pipeline thread panicked: "Sink thread panicked with message: attempt to subtract with overflow"
 INFO  nusamai                   > Total processing time: 146.0530415s
satoshi7190 commented 1 month ago

@nokonoko1203 変換処理中にオーバーフローがatlas-packerのtexture.rsファイルの161行目で発生しています。 ご確認お願いします。

thread 'pipeline-sink' panicked at /Users/hoge/.cargo/git/checkouts/atlas-packer-0eceddb6ce829bab/c2c3e78/src/texture.rs:161:44:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR nusamai::pipeline::runner > Sink thread panicked with message: attempt to subtract with overflow
 ERROR nusamai                   > Pipeline thread panicked: "Sink thread panicked with message: attempt to subtract with overflow"
 INFO  nusamai                   > Total processing time: 146.0530415s

@nokonoko1203 こちら、クレートの更新をし忘れただけでした。すみません。

satoshi7190 commented 1 month ago

三角形でカットしてる部分が切れ目が見えちゃってるのもあるので、マージンをとってカットするのがよいのかも?(言うのは簡単ですが) image