Skip to content

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
mzernova:fix_reading_facets
Jul 16, 2025
Merged

Data Exchange, RWObj_Reader - fix reading facets with empty normals like 'f 1// 2// 3//'#520
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
mzernova:fix_reading_facets

Conversation

@mzernova
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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;
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

[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.

Copilot uses AI. Check for mistakes.
// parse Normal index
if (*thePos == '/')
{
++thePos;
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

[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.

Copilot uses AI. Check for mistakes.
@dpasukhi dpasukhi linked an issue May 13, 2025 that may be closed by this pull request
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.
@dpasukhi dpasukhi force-pushed the fix_reading_facets branch from dc3ed7f to 76c1b3c Compare July 16, 2025 12:18
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.
@dpasukhi dpasukhi force-pushed the fix_reading_facets branch from 76c1b3c to 75a0026 Compare July 16, 2025 12:26
…// 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.
@dpasukhi dpasukhi force-pushed the fix_reading_facets branch from 75a0026 to 468bcd0 Compare July 16, 2025 14:25
@dpasukhi dpasukhi merged commit 468bcd0 into Open-Cascade-SAS:IR Jul 16, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Jul 16, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OBJ file fails to load

4 participants