需要使用三个。

发布于 2025-02-09 08:52:54 字数 764 浏览 0 评论 0原文

这就是我目前所拥有的。

 return from(fetch(targetUrl.toString(), {headers: { 'responseType': 'application/octet-stream'}, method: 'GET'})).pipe(
            map((surfaceMesh) => {
                this.surfaceMeshes.set(surfaceMeshKey, surfaceMesh);
            }
        )

以前,服务器响应是在JSON提供的,因此一切正常。以前的回应看起来有点像这样。

content_uncompressed = {
            "api_info": f"Visualization REST Server {__version__}",
            "component_id": component_id_int,
            "vertices": vertex_list,
            "faces": trig_faces.tolist(),
            "n_faces": n_trig_faces,
        }

但是,最近,服务器响应已更改为八位字节(对于.glb文件)。因此,当然,不再可用的顶点和脸。我想知道如何使用trix.js(或其他任何东西)的GLTF加载器在返回语句中提取顶点和面部。如果您为我写下代码,这对我来说意义重大,因为我对所有这些都很新。

This is what I have currently.

 return from(fetch(targetUrl.toString(), {headers: { 'responseType': 'application/octet-stream'}, method: 'GET'})).pipe(
            map((surfaceMesh) => {
                this.surfaceMeshes.set(surfaceMeshKey, surfaceMesh);
            }
        )

Previously, the server response was in JSON providing so everything worked perfectly. The previous response looked somewhat like this.

content_uncompressed = {
            "api_info": f"Visualization REST Server {__version__}",
            "component_id": component_id_int,
            "vertices": vertex_list,
            "faces": trig_faces.tolist(),
            "n_faces": n_trig_faces,
        }

However, recently, the server response has been changed to an octet-stream (that kind for .glb file). So of course, the array of vertices and faces are no longer available. I was wondering how do I extract the vertices and faces and put it in two different arrays in my return statement using GLTF Loader of three.js (or anything else). It would mean a lot to me if you write the code down for me as I am very new to all this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文