Skip to content

Fix SRF writing logic - #77

Merged
lispandfound merged 8 commits into
mainfrom
srf_writing_fixes
Jul 24, 2026
Merged

Fix SRF writing logic#77
lispandfound merged 8 commits into
mainfrom
srf_writing_fixes

Conversation

@lispandfound

Copy link
Copy Markdown
Contributor

Fixes SRF read-write logic to be more consistent with what the C code expects. Now:

  • Plane header is split after the sixth value (consistent with the SRF read and write routines in EMOD3D).
  • Rust parser now refuses to parse SRFs that are written with all PLANE headers on one line.
  • SRF v1 outputs now also have per-plane POINTS declaration.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates SRF read/write handling to align the Rust implementation with EMOD3D’s expected SRF layout, particularly around PLANE header line breaks and stricter parsing.

Changes:

  • Split PLANE header writing into two lines after the 6th value to match EMOD3D formatting.
  • Tightened SRF parsing by requiring an end-of-line after the 6th PLANE header token (wid), rejecting legacy one-line headers.
  • Updated and expanded fixtures/tests to reflect the new header layout and validate multi-plane parsing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/srf_writer.rs Writes PLANE headers across two lines; updates writer tests/fixtures accordingly.
src/srf_parser.rs Enforces newline after wid in PLANE headers; updates fixtures and adds a V1 multi-plane parsing test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/srf_writer.rs
Comment thread src/srf_parser.rs
Comment thread src/srf_parser.rs Outdated
@lispandfound
lispandfound merged commit aa2e1ec into main Jul 24, 2026
7 checks passed
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.

3 participants