From 600c7e6158dc2fb757d0c52619dfcb330ffaa4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=82=E4=B9=8B=E9=92=B3?= Date: Fri, 24 Jul 2026 09:13:43 +0000 Subject: [PATCH] fix: use [0,1]x[0,1] NURBS domain --- src/foundation/io_gltf.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/foundation/io_gltf.cpp b/src/foundation/io_gltf.cpp index e9fa81c..218315e 100644 --- a/src/foundation/io_gltf.cpp +++ b/src/foundation/io_gltf.cpp @@ -301,13 +301,11 @@ bool write_brep_gltf(const std::string& filepath, const brep::BrepModel& model, std::vector verts; std::vector> tris; - auto [u_min, u_max] = surf.domain_u(); - auto [v_min, v_max] = surf.domain_v(); - + // NURBS domain is [0,1]×[0,1] for (int j = 0; j <= res; ++j) { - double v = v_min + (v_max - v_min) * static_cast(j) / res; + double v = static_cast(j) / res; for (int i = 0; i <= res; ++i) { - double u = u_min + (u_max - u_min) * static_cast(i) / res; + double u = static_cast(i) / res; verts.push_back(surf.evaluate(u, v)); } }