Skip to content

Data Exchange, GLTF - Change export line type to LINE_STRIP#535

Merged
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
Bananaz-ai:CR533
May 17, 2025
Merged

Data Exchange, GLTF - Change export line type to LINE_STRIP#535
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
Bananaz-ai:CR533

Conversation

@elias-bananaz
Copy link
Copy Markdown
Contributor

Description

When exporting to GLTF the edges appear dashed:
image

The Problem

The GLTF writer uses RWGltf_GltfPrimitiveMode_Lines as the type for edges. According to the spec:

GL_LINES: Vertices 0 and 1 are considered a line. Vertices 2 and 3 are considered a line. And so on.

The Solution

Use line strips instead:

GL_LINE_STRIP: The adjacent vertices are considered lines. Thus, if you pass n vertices, you will get n-1 lines.

Result

image

@elias-bananaz elias-bananaz changed the title Coding - fix gltf dashed edges Coding, RWGltf_CafWriter - fix gltf dashed edges May 15, 2025
@dpasukhi dpasukhi linked an issue May 15, 2025 that may be closed by this pull request
@dpasukhi
Copy link
Copy Markdown
Member

de_mesh gltf_write primitives
edge is missing

checknbshapes s -vertex 4 -edge 2
nbshapes s 
Number of shapes in s
 VERTEX    : 4
 EDGE      : 0
 WIRE      : 0
 FACE      : 0
 SHELL     : 0
 SOLID     : 0
 COMPSOLID : 0
 COMPOUND  : 5
 SHAPE     : 9

OK : is GOOD because number of VERTEX entities is equal to number of expected VERTEX entities

Error : is WRONG because number of EDGE entities in shape "s" is 0


@dpasukhi
Copy link
Copy Markdown
Member

dpasukhi commented May 15, 2025

The regression report: https://github.com/Open-Cascade-SAS/OCCT/actions/runs/15046440158/artifacts/3131899454

I assume issue during import, I will ask Marina to check :)

@elias-bananaz
Copy link
Copy Markdown
Contributor Author

The regression report: https://github.com/Open-Cascade-SAS/OCCT/actions/runs/15046440158/artifacts/3131899454

I assume issue during import, I will ask Marina to check :)

Problem was that during reading of gltf, only LINE types were expected. Adding LINE_STRIP there as well fixes this.
I ran that test locally and confirmed it's fixed.

@dpasukhi dpasukhi changed the base branch from IR to master May 15, 2025 18:37
@dpasukhi dpasukhi changed the base branch from master to IR May 15, 2025 18:37
@dpasukhi dpasukhi closed this May 15, 2025
@github-project-automation github-project-automation bot moved this from Todo to Closed in Maintenance May 15, 2025
@dpasukhi dpasukhi reopened this May 15, 2025
@github-project-automation github-project-automation bot moved this from Closed to In Progress in Maintenance May 15, 2025
@dpasukhi
Copy link
Copy Markdown
Member

@dpasukhi
Copy link
Copy Markdown
Member

@elias-bananaz Could you please apply patch? I have no permission to push into your branch.

patch can be download from https://github.com/Open-Cascade-SAS/OCCT/actions/runs/15062416564/artifacts/3137110877

@elias-bananaz
Copy link
Copy Markdown
Contributor Author

@elias-bananaz Could you please apply patch? I have no permission to push into your branch.

patch can be download from https://github.com/Open-Cascade-SAS/OCCT/actions/runs/15062416564/artifacts/3137110877

@dpasukhi Applied the patch

@github-project-automation github-project-automation bot moved this from In Progress to Integration in Maintenance May 16, 2025
@dpasukhi dpasukhi merged commit b29788c into Open-Cascade-SAS:IR May 17, 2025
63 of 66 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance May 17, 2025
@dpasukhi dpasukhi changed the title Coding, RWGltf_CafWriter - fix gltf dashed edges Data Exchange, GLTF - Change export line type to LINE_STRIP May 17, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Data Exchange Import/Export or iterating of the CAD data labels May 17, 2025
@dpasukhi dpasukhi added this to the Release 7.9.1 milestone May 17, 2025
dpasukhi pushed a commit to dpasukhi/OCCT that referenced this pull request May 19, 2025
…ade-SAS#535

GLTF exporter mark edges as a LINE, which is 2 connected points.
OCCT polylines is mostly line strip structure.
Updated GLTF reader to handle new type of lines
@elias-bananaz elias-bananaz deleted the CR533 branch May 20, 2025 07:53
elias-bananaz added a commit to Bananaz-ai/OCCT that referenced this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Data Exchange Import/Export or iterating of the CAD data 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Exported edges in GLTF are dashed instead of continuous

2 participants