Part Создать фигуру из полигональной сетки

From FreeCAD Documentation
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page is a translated version of the page Part ShapeFromMesh and the translation is 50% complete.
Outdated translations are marked like this.

Создать фигуру из полигональной сетки

Системное название
Part_ShapeFromMesh‏‎
Расположение в меню
Part → Создание фигуры из полигональной сетки...
Верстаки
Part
Быстрые клавиши
Нет
Представлено в версии
-
См. также
Преобразовать в твердые, Закрепить фигуру, Part PointsFromMesh

Введение

Введение

Эта команда создаёт форму из сетки. Возможности объектов типа сетка внутри FreeCAD ограничены, преобразование их в формы позволяет использовать с ними гораздо больше инструментов (см. так же примечания).

The inverse operation is Mesh FromPartShape from the Mesh Workbench.

Применение

Использование

  1. Выберите полигонально-сеточный объект.
  2. Выберите в верхнем меню Деталь Создание формы из сетки....
  3. Всплывающее меню запросит допуск сшивания формы (значение по умолчанию: 0,1)
  4. Инструмент создаёт из сетки отдельный новый объект - форму.

Ссылки

Программирование

Creating a Shape from a Mesh can be done by using the makeShapeFromMesh method from a Part TopoShape; you need to specify the source mesh and tolerance, and assign the result to a new Part Feature object.

Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.

import FreeCAD as App
import Part

doc = App.newDocument()
mesh = doc.addObject("Mesh::Cube", "Mesh")
mesh.recompute()

solid = doc.addObject("Part::Feature", "Shape")
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.1)

solid.Shape = shape
solid.Placement.Base = App.Vector(15, 0, 0)
solid.purgeTouched()
doc.recompute()