Skip to content

Commit 6cafe85

Browse files
committed
Fix: LandXML parser, extra triangulation check fix
1 parent 2d30d02 commit 6cafe85

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: .changeset/proud-coins-swim.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"landxml": patch
3+
---
4+
5+
Bugfix parsing landxml's without extra triangulated faces

Diff for: src/private/parse-xml.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const parseXML = async (xmlString: string): Promise<ParsedSurface[]> => {
3838

3939
faces = (surface.Definition.Faces.F as any[]).reduce((faceList, face: any) => {
4040
const { attr, content } = face;
41-
if (attr.i === "1") return faceList;
41+
if (attr?.i === "1") return faceList;
4242
const [a, b, c] = content.split(" ").map((v: string) => pointIdMap[v]);
4343
if ([a, b, c].filter((v) => typeof v === "undefined").length > 0) {
4444
throw `Invalid LandXML. A face is referencing a point that doesn't exist. Face is referencing points: ${content}`;

0 commit comments

Comments
 (0)