You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python实现可流形3D文本网格与定制STL生成技术咨询

定制STL生成Python脚本开发问题

通用需求

  • 基于Python开发,尽量无需后端软件
  • 最小化依赖项
  • 生成轻量化模型

具体功能需求

  • 生成规则形状的3D网格
  • 基于不同字体将文本转换为3D网格
  • 将文本网格环绕圆柱
  • 执行布尔运算

已尝试的库及存在的问题

  • sdf库:功能完善,但生成的模型体积过大
  • Trimesh库:表现优秀,已实现结构网格生成、HTML及STL导出,但无后端支持无法执行布尔运算
  • PyMesh库:已停止维护且依赖项繁多

当前PyVista非流形模型问题代码

import numpy as np
import pyvista as pv
RES = 20

vertices = np.array([
        [20.5, -17.5, 0.0],
        [24.39711432, -8.75, 0.0],
        [24.39711432, 8.75, 0.0],
        [20.5, 17.5, 0.0],
        [19.20096189, 8.75, 0.0],
        [19.20096189, -8.75, 0.0],
        [20.5, -17.5, 0.0]])
profile = pv.MultipleLines(vertices)
profile.plot(color='tan')
extruded = profile.extrude_rotate(resolution=RES**2, rotation_axis=(0, 1, 0))#, capping=False)
print(extruded.is_all_triangles)
print(extruded.is_manifold)
print(extruded.extract_geometry().n_open_edges)
extruded.plot_normals()

# Check if all triangles :
extruded = extruded.fill_holes(4*RES)
print(extruded.is_all_triangles)
print(extruded.is_manifold)
print(extruded.extract_geometry().n_open_edges)
extruded.plot_normals()

extruded.plot(color='tan')

下一步计划

为模型添加环绕文本。

内容的提问来源于stack exchange,提问作者Petit Phoenix

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 01:28:22