mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: model reconstruction
This commit is contained in:
1 parent
610c75d274
commit
6b9bf76da2
4 files changed
+525
-22
No files matched your search
+30
-13
@@ -233,20 +233,37 @@ class SCPGStream {
|
||||
return { vertices, indices };
|
||||
});
|
||||
|
||||
// writeFileSync(
|
||||
// 'test.txt',
|
||||
// polygonGroups
|
||||
// .map((i) =>
|
||||
// i.vertices
|
||||
// .map(
|
||||
// (e) =>
|
||||
// `${VertexType[e.type].padEnd(16, ' ')} ${e.value
|
||||
// .map((j) => j.toString(10).padStart(25, ' '))
|
||||
// .join(' ')}`,
|
||||
// )
|
||||
// .join('\n'),
|
||||
// )
|
||||
// .join('\n\n'),
|
||||
// );
|
||||
|
||||
// writeFileSync(
|
||||
// 'test.json',
|
||||
|
||||
// )
|
||||
|
||||
writeFileSync(
|
||||
'test.txt',
|
||||
polygonGroups
|
||||
.map((i) =>
|
||||
i.vertices
|
||||
.map(
|
||||
(e) =>
|
||||
`${VertexType[e.type].padEnd(16, ' ')} ${e.value
|
||||
.map((j) => j.toString(10).padStart(32, ' '))
|
||||
.join(' ')}`,
|
||||
)
|
||||
.join('\n'),
|
||||
)
|
||||
.join('\n\n'),
|
||||
'test.json',
|
||||
JSON.stringify(
|
||||
polygonGroups.map((group) => ({
|
||||
vertices: group.vertices
|
||||
.filter(({ type }) => type === VertexType.VERTEX)
|
||||
.map(({ value }) => value),
|
||||
indices: group.indices,
|
||||
})),
|
||||
),
|
||||
);
|
||||
|
||||
return polygonGroups;
|
||||
|
||||
Reference in new issue
Block a user