在 Sketchup 中创建面和边对象的最快方法

发布于 2024-09-11 17:12:42 字数 737 浏览 7 评论 0原文

我必须在 Google Sketchup 中渲染几千个多边形的网格。我发现随着模型中面数的增加,add_face 往往会变得更慢。我相信这是由于 Sketchup 在幕后运行的一些边缘检测算法造成的。希望应该有某种方法来抑制 Sketchup 正在进行的边缘检测或其他处理,直到所有面都添加到模型中。

我发现 add_faces_from_meshfill_from_mesh 速度更快,但最终得到的网格由 Surface 实例而不是 Face 组成我正在寻找的 code> 和 Edge 对象。

那么,在 Sketchup 中生成由 FaceEdge 对象组成的模型的最快方法是什么?有没有办法从 Surface 对象生成 EdgeFace 对象?

更新:我刚刚在此处读到使用 Model::start_transactionModel::commit_transaction 可以用来加快速度,但我发现改进并不是很显着。我还能做些什么吗?

I have to render a mesh of a few thousand polygons in Google Sketchup. I find that add_face tends to get slower as the number of faces in the model increases. I believe this to be due to some edge detection algorithm that Sketchup is running behind the scenes. Hopefully, there should be some way to suppress this edge detection or other processing that Sketchup is doing till all faces have been added to the model.

I found add_faces_from_mesh and fill_from_mesh to be much faster but I end up with a mesh consisting of Surface instances instead of the Face and Edge objects I am looking for.

So, what is the fastest way to generate a model consisting of Face and Edge objects in Sketchup? Is there a way to generate Edge and Face objects from a Surface object?

Update: I just read here that using Model::start_transaction and Model::commit_transaction can be used to speed things up but I found that the improvements are not very significant. Anything else I can do?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜空下最亮的亮点 2024-09-18 17:12:42

我找到了add_faces_from_mesh并且
fill_from_mesh 速度要快得多,但我
最终得到一个由以下组成的网格
Surface 实例而不是 Face
和我正在寻找的 Edge 对象。

调用 add_faces_from_meshfill_from_mesh 并将 smooth_flags 参数显式设置为零,可以正确构造 FaceEdge对象。 Sketchup 文档声称 smooth_flags默认为零...我的试验表明不然。

I found add_faces_from_mesh and
fill_from_mesh to be much faster but I
end up with a mesh consisting of
Surface instances instead of the Face
and Edge objects I am looking for.

Calling add_faces_from_mesh or fill_from_mesh with the smooth_flags parameter explicitly set to zero correctly constructs Face and Edge objects. Sketchup Documentation claims that smooth_flags defaults to zero... my trials show otherwise.

不寐倦长更 2024-09-18 17:12:42

只是为了澄清 - add_faces_from_meshfill_from_mesh 确实添加了边和面 - 但是,默认行为是创建具有柔软平滑边缘的网格。当您有一组通过软边连接的面时,它们将被 SketchUp 视为表面,并且当您选择它们​​时,实体信息窗口将显示“表面”。
然而 - 在内部它仍然只是一组边和面 - SketchUp 没有 Surface 实体。

至于 Model::start_transaction - 您必须为第二个 disable_ui 参数指定 true 才能看到任何速度增益。但正如您所注意到的,SU 添加实体的速度非常慢 - 添加的实体集合越多,它的速度就越慢。添加实体的绝对最快方法是 fill_from_mesh

Just to clarify - add_faces_from_mesh and fill_from_mesh do add Edges and Faces - however, the default behaviour is to create a mesh with soft and smooth edges. When you have a set of Faces connected by Soft edges they will be treated as a surface by SketchUp and Entity Info window will say "Surface" when you select them.
However - internally it's still just a set of edges and faces - SketchUp has no Surface entity.

As for Model::start_transaction - you must specify true for the second disable_ui argument in order to see any speed gains. But as you have noticed, SU is very slow to add entities - the more there is in the entities collection you add to the slower it gets. The absolute fastest way to add entities is fill_from_mesh.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文