Skip to content

feat: geometry template #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 5, 2025
Merged

feat: geometry template #19

merged 6 commits into from
Apr 5, 2025

Conversation

HideBa
Copy link
Owner

@HideBa HideBa commented Apr 5, 2025

This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Introduced advanced support for geometry templates and instance encoding to enhance 3D data representation.
  • Refactor

    • Simplified the data schema by removing outdated mappings and integrating precise vertex and transformation support.
  • Tests

    • Expanded testing to ensure consistent and accurate round-trip processing of geometry templates and instances.
  • Chore

    • Updated ignore settings to exclude auxiliary directories from version control.

Copy link

coderabbitai bot commented Apr 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes update the FlatCityBuf schema and corresponding Rust code to support geometry templates and instance encoding. New fields in the Header and CityObject tables, along with added tables and structs (such as GeometryInstance, TransformationMatrix, and DoubleVertex), redefine how geometric data is handled. Several enums and mapping tables have been removed from one schema file and reintroduced with modifications in another, while serialization and deserialization routines are enhanced to process these new elements. Additional tests and minor formatting adjustments complete the update.

Changes

File / Group Change Summary
.cursor/rules/memory/specification.md Added new "Geometry Template and Instance Encoding" section with definitions for templates, instances, and a 4x4 transformation matrix; improved clarity with examples.
.gitignore New ignore entry for .roo/ has been added.
src/fbs/(feature.fbs, geometry.fbs, header.fbs) In feature.fbs, removed enums (SemanticSurfaceType, GeometryType) and tables (MaterialMapping, TextureMapping), and updated the CityObject table to include geometry_instances; in geometry.fbs, added enums, new tables (e.g., Geometry, SemanticObject), structs (TransformationMatrix), and the GeometryInstance table; in header.fbs, added an include for geometry.fbs, a new struct (DoubleVertex), and new fields (templates, templates_vertices).
src/rust/fcb_core/src/fb/(feature_generated.rs, geometry_generated.rs, header_generated.rs, mod.rs) In feature_generated.rs, removed obsolete mapping structures and added new CityFeature and CityObject definitions with updated methods; geometry_generated.rs introduces various enums, constants, and structs for geometry handling; header_generated.rs adds the DoubleVertex struct and corresponding accessor methods along with updated constants; mod.rs exports the new geometry_generated module.
src/rust/fcb_core/src/(reader/deserializer.rs, reader/geom_decoder.rs, writer/serializer.rs) deserializer.rs: Added decode_geometry_instance and extended decoding for geometry templates and error handling; geom_decoder.rs: Updated imports to include geometry_generated; serializer.rs: Added functions for converting appearance, geometry instances, and template vertices, and refactored feature serialization.
src/rust/fcb_core/tests/e2e.rs Added a new test test_geometry_template_cycle to verify the serialization and deserialization cycle for geometry templates.

Sequence Diagram(s)

Serialization Flow

sequenceDiagram
    participant Writer as FcbWriter
    participant Serializer as Serializer Module
    participant Builder as FlatBufferBuilder
    participant File as Serialized File
    Writer->>Serializer: Process CityFeature & CityObject
    Serializer->>Builder: Call to_geometry_instance & to_templates_vertices
    Builder->>File: Write header with templates and features with geometry instances
Loading

Deserialization Flow

sequenceDiagram
    participant Reader as FcbReader
    participant Deserializer as Deserializer Module
    participant Buffer as FlatBuffer Data
    Reader->>Deserializer: Read header & feature stream
    Deserializer->>Buffer: Retrieve templates and geometry instance fields
    Deserializer->>Reader: Return decoded CityFeature & CityObject
Loading

Possibly related PRs

  • feat: add encoding of texture #14: Adjustments to CityObject and Geometry structures with added fields for geometry instances and texture mappings, sharing a common focus with these changes.

Poem

In a field of code so wide,
I hop and skip with joyful pride.
Templates and instances now take flight,
Geometry shining, pure and bright.
My rabbit heart leaps as changes bloom,
CodeRabbit cheers in every room!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3fa793 and 976de67.

📒 Files selected for processing (13)
  • .cursor/rules/memory/specification.md (11 hunks)
  • .gitignore (1 hunks)
  • src/fbs/feature.fbs (2 hunks)
  • src/fbs/geometry.fbs (1 hunks)
  • src/fbs/header.fbs (3 hunks)
  • src/rust/fcb_core/src/fb/feature_generated.rs (4 hunks)
  • src/rust/fcb_core/src/fb/geometry_generated.rs (1 hunks)
  • src/rust/fcb_core/src/fb/header_generated.rs (10 hunks)
  • src/rust/fcb_core/src/fb/mod.rs (1 hunks)
  • src/rust/fcb_core/src/reader/deserializer.rs (8 hunks)
  • src/rust/fcb_core/src/reader/geom_decoder.rs (1 hunks)
  • src/rust/fcb_core/src/writer/serializer.rs (9 hunks)
  • src/rust/fcb_core/tests/e2e.rs (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

This commit fixes the style issues introduced in ecb8541 according to the output
from Rustfmt.

Details: #19
@HideBa HideBa marked this pull request as ready for review April 5, 2025 08:06
@HideBa HideBa merged commit 423744d into main Apr 5, 2025
2 of 4 checks passed
Copy link
Contributor

deepsource-io bot commented Apr 5, 2025

Here's the code health analysis summary for commits c3fa793..976de67. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Rust LogoRust❌ Failure
❗ 271 occurences introduced
🎯 197 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant