Data Exchange, RWObj_Reader - fix reading facets with empty normals like 'f 1// 2// 3//'#520
Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom Jul 16, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes two issues: removing an obsolete header comment in the PPM writer and correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader.
- In Image_AlienPixMap.cxx, the unused header comment is removed.
- In Graphic3d_Aspects.hxx, the default viewer settings comment is updated.
- In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Visualization/TKService/Image/Image_AlienPixMap.cxx | Removed the redundant header comment in PPM file output. |
| src/Visualization/TKService/Graphic3d/Graphic3d_Aspects.hxx | Updated comment to reflect a changed default unit value for OCC 3D viewer settings. |
| src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx | Added condition checks in the OBJ index parsing to handle empty texture and normal indices. |
Files not reviewed (1)
- tests/de_mesh/obj_read/emptynorm: Language not supported
| @@ -301,15 +301,21 @@ void RWObj_Reader::pushIndices(const char* thePos) | |||
| if (*thePos == '/') | |||
| { | |||
| ++thePos; | |||
There was a problem hiding this comment.
[nitpick] Consider adding an inline comment clarifying that this condition checks for the presence of a texture coordinate index when the face definition field is non-empty.
Suggested change
| ++thePos; | |
| ++thePos; | |
| // Check for the presence of a texture coordinate index when the face definition field is non-empty. |
| // parse Normal index | ||
| if (*thePos == '/') | ||
| { | ||
| ++thePos; |
There was a problem hiding this comment.
[nitpick] Consider adding an inline comment explaining that this condition prevents parsing a normal index when the corresponding field is empty.
Suggested change
| ++thePos; | |
| ++thePos; | |
| // Ensure the parser does not attempt to parse a normal index when the field is empty or invalid. |
Closed
dpasukhi
pushed a commit
to mzernova/OCCT
that referenced
this pull request
Jul 16, 2025
…// 3//' (Open-Cascade-SAS#520) Removing an obsolete header comment in the PPM writer Correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader. - In Image_AlienPixMap.cxx, the unused header comment is removed. - In Graphic3d_Aspects.hxx, the default viewer settings comment is updated. - In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
dc3ed7f to
76c1b3c
Compare
dpasukhi
pushed a commit
to mzernova/OCCT
that referenced
this pull request
Jul 16, 2025
…// 3//' (Open-Cascade-SAS#520) Removing an obsolete header comment in the PPM writer Correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader. - In Image_AlienPixMap.cxx, the unused header comment is removed. - In Graphic3d_Aspects.hxx, the default viewer settings comment is updated. - In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
76c1b3c to
75a0026
Compare
…// 3//' (Open-Cascade-SAS#520) Removing an obsolete header comment in the PPM writer Correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader. - In Image_AlienPixMap.cxx, the unused header comment is removed. - In Graphic3d_Aspects.hxx, the default viewer settings comment is updated. - In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
75a0026 to
468bcd0
Compare
dpasukhi
pushed a commit
that referenced
this pull request
Sep 6, 2025
…// 3//' (#520) Removing an obsolete header comment in the PPM writer Correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader. - In Image_AlienPixMap.cxx, the unused header comment is removed. - In Graphic3d_Aspects.hxx, the default viewer settings comment is updated. - In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
dpasukhi
pushed a commit
that referenced
this pull request
Sep 6, 2025
…// 3//' (#520) Removing an obsolete header comment in the PPM writer Correcting the handling of facet indices when normals or texture coordinates are empty in the OBJ reader. - In Image_AlienPixMap.cxx, the unused header comment is removed. - In Graphic3d_Aspects.hxx, the default viewer settings comment is updated. - In RWObj_Reader.cxx, additional checks are added to correctly parse OBJ face definitions with empty texture and normal indices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.