tests/model: comments: specs only
This commit is contained in:
1 parent
5f7f6005f6
commit
fe7566cbba
37 files changed
+72
-440
No files matched your search
+2
-11
@@ -1,7 +1,5 @@
|
||||
-- model/lwo tests: assimp's LightWave test models (LWO2, LWOB, Modo LXOB) against assimp (meshes per layer and
|
||||
-- surface, polygons, corners, materials, world bounds); layer hierarchy and pivots, UV / colour / normal maps,
|
||||
-- surfaces and image blocks; a hand-built LWO2 (VMAD splits, MORF / SPOT targets, weight maps, lines, points, skipped
|
||||
-- curves, PTCH flag, derived surface, XREF clip); errors; the fuzz no-throw pass. Fixtures: tools/fixtures/lwo.py.
|
||||
-- model/lwo tests: assimp's LightWave models (LWO2, LWOB, LXOB) against assimp, and a hand-built LWO2.
|
||||
-- Fixtures: tools/fixtures/lwo.py.
|
||||
local T = require("@tests/T")
|
||||
local Lwo = require("@rosetta/model/lwo")
|
||||
local MeshOps = require("@rosetta/ops/MeshOps")
|
||||
@@ -25,7 +23,6 @@ local function near(a: number, b: number, eps: number): boolean
|
||||
return math.abs(a - b) <= eps * math.max(1, math.abs(a), math.abs(b))
|
||||
end
|
||||
|
||||
-- assimp's counts: one mesh per (layer, surface), polygons, corners
|
||||
local function counts(scene: any): (number, number, number)
|
||||
local meshes, faces, corners = 0, 0, 0
|
||||
for _, m in scene.meshes do
|
||||
@@ -52,7 +49,6 @@ local function find(name: string): any
|
||||
return nil
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ assimp
|
||||
local checked, scenes = 0, {}
|
||||
for i, c in Cases do
|
||||
local a = c.assimp
|
||||
@@ -77,7 +73,6 @@ for i, c in Cases do
|
||||
end
|
||||
t:check(ok, string.format("%s: world bounds (assimp) %s / %s", c.name, if lo then table.concat(lo, " ") else "-", if hi then table.concat(hi, " ") else "-"))
|
||||
end
|
||||
-- triangulated: the same corners as triangles
|
||||
local tri = decode(c.data)
|
||||
t:check(tri and tri.meshes[1] and tri.meshes[1].primitives[1].mode ~= "polygons", c.name .. ": triangulated by default")
|
||||
checked += 1
|
||||
@@ -86,7 +81,6 @@ for i, c in Cases do
|
||||
end
|
||||
t:note("%d files checked against assimp", checked)
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ details
|
||||
do
|
||||
local c = find("models/LWO2/hierarchy.lwo")
|
||||
local s = decode(c.data)
|
||||
@@ -159,7 +153,6 @@ do
|
||||
t:check(sb.materials[1].extras.lwo.glos ~= nil, "LWOB glossiness")
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ hand-built LWO2
|
||||
local function be16(n: number): string
|
||||
return string.char(bit32.band(bit32.rshift(n, 8), 255), bit32.band(n, 255))
|
||||
end
|
||||
@@ -278,7 +271,6 @@ do
|
||||
t:check(ux * vy - uy * vx < 0, "hand-built: facing kept (LightWave +z normal -> glTF -z)")
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ errors
|
||||
do
|
||||
local _, e1 = decode("FORM\0\0\0\4LWO3")
|
||||
t:check(e1 and e1.code == Err.UNSUPPORTED, "LWO3: " .. tostring(e1))
|
||||
@@ -295,7 +287,6 @@ do
|
||||
t:eq(Lwo.sniff(Bytes.reader(buffer.fromstring("FORM\0\0\0\4AIFF"))), 0, "sniff AIFF")
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ fuzz
|
||||
do
|
||||
local samples = { quadFile() }
|
||||
for _, c in Cases do
|
||||
|
||||
Reference in new issue
Block a user