Part BooleanFragments/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "«Standard» и «Split» различаются действием инструмента на рёбра, оболочки и составные тела: если «Split»...")
(Created page with "Компаундная структура в режимах «Standard» и «Split» следует компаундной структуре на входе. То есть,...")
Line 31: Line 31:
«Standard» и «Split» различаются действием инструмента на рёбра, оболочки и составные тела: если «Split», они разделяются; если «Standard», они остаются вместе (получают дополнительные сегменты).
«Standard» и «Split» различаются действием инструмента на рёбра, оболочки и составные тела: если «Split», они разделяются; если «Standard», они остаются вместе (получают дополнительные сегменты).


Компаундная структура в режимах «Standard» и «Split» следует компаундной структуре на входе. То есть, если вы обработаете два компаунда, каждый из которых содержит сферу, как в примере выше, результат также будет содержать два компаунда, каждый из которых содержит куски изначально входившей в них сферы. Это значит, что общий кусок будет повторен в результате дважды. Только если обе входные сферы не входят в компаунды, результат будет содержать общий кусок единожды.
Compounding structure in "Standard" and "Split" modes follows the compounding structure of inputs. That is, if you feed in two compounds, each containing a sphere like on example above, the result will also contain two compounds, each containing the pieces of the originally contained sphere. That means, the common piece will be repeated twice in the result. Only if the input spheres are both not in compounds, the result will contain the common piece once.


In "CompSolid" mode, the solids are joined into a compsolid (compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid"). The output is a non-nested compound of compsolids
In "CompSolid" mode, the solids are joined into a compsolid (compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid"). The output is a non-nested compound of compsolids

Revision as of 05:21, 25 October 2020

Part BooleanFragments

Системное название
Part BooleanFragments
Расположение в меню
Деталь → Разделить → Boolean Fragments
Верстаки
Part
Быстрые клавиши
Нет
Представлено в версии
0.17.8053
См. также
Part Slice, Part XOR, Join features, Part Boolean

Описание

Инструмент для вычисления всех фрагментов, которые могут возникнуть в результате применения логических операций между входными фигурами. Например, для двух пересекающихся сфер создаются три неперекрывающихся, но соприкасающихся твердых тела.

(на картинке выше части были впоследствии раздвинуты вручную, чтобы показать разрез)

Итоговая форма всегда является компаундом. Состав компаунда зависит от типов входных фигур и режима работы. Это означает, что вы не сразу получаете доступ к отдельным частям результата - части остаются сгруппированными вместе. Отдельные части могут быть извлечены путем применения разбивки соединения (Draft Downgrade).

У инструмента три режима: "Standard", "Split", and "CompSolid".

«Standard» и «Split» различаются действием инструмента на рёбра, оболочки и составные тела: если «Split», они разделяются; если «Standard», они остаются вместе (получают дополнительные сегменты).

Компаундная структура в режимах «Standard» и «Split» следует компаундной структуре на входе. То есть, если вы обработаете два компаунда, каждый из которых содержит сферу, как в примере выше, результат также будет содержать два компаунда, каждый из которых содержит куски изначально входившей в них сферы. Это значит, что общий кусок будет повторен в результате дважды. Только если обе входные сферы не входят в компаунды, результат будет содержать общий кусок единожды.

In "CompSolid" mode, the solids are joined into a compsolid (compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid"). The output is a non-nested compound of compsolids

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

  1. Select objects to be intersected.
    The order of selection is not important, since the action of the tool is symmetric. It is enough to select one sub-shape of each object (e.g., faces). You can also select a compound containing all the shapes to be connected, e.g. Draft Array.
  2. Invoke the Part BooleanFragments command several ways:
    • Pressing the button in the toolbar
    • Using the Part → Split → Boolean Fragments entry in the Part menu

A Boolean Fragments parametric object is created. Original objects are hidden, and the result of intersection is shown in 3D view.

Свойства

Boolean Fragments

  • ДанныеObjects: List of objects to be intersected. Generally, at least two objects are needed, but a single compound containing the shapes to intersect will do as well. (as of FreeCAD v0.17.8053, this property is not displayed in property editor, and can only be accessed via Python).
  • ДанныеMode: "Standard", "Split", or "CompSolid". "Standard" is default. Standard and Split differ by the action of the tool on aggregation type shapes: if Split, those are separated; otherwise they are kept together (get extra segments).
  • ДанныеTolerance: "fuzziness" value. This is an extra tolerance to apply when searching for intersections, in addition to tolerances stored in the input shapes.

Implementation details

Boolean Fragments tool in "Standard mode" is OpenCascade's General Fuse Operator (GFA). It accepts a combination of probably all shape types, and the logic of output is quite convoluted. See OpenCascade user guide: Boolean operations.

For "Split" and "CompSolid" modes, extra post-processing is done by FreeCAD.

Scripting

The tool can by used in macros and from the python console by using the following function:

BOPTools.SplitFeatures.makeBooleanFragments(name)
  • Creates an empty BooleanFragments feature. The 'Objects' property must be assigned explicitly, afterwards.
  • Returns the newly created object.

BooleanFragments can also be applied to plain shapes, without the need to have a document object, via:

import BOPTools.SplitAPI
BOPTools.SplitAPI.booleanFragments(list_of_shapes, mode, tolerance = 0.0)

# OR, for Standard mode:

list_of_shapes = [App.ActiveDocument.Sphere.Shape, App.ActiveDocument.Sphere001.Shape]
pieces, map = list_of_shapes[0].generalFuse(list_of_shapes[1:], tolerance)
# pieces receives a compound of shapes; map receives a list of lists of shapes, defining list_of_shapes <--> pieces correspondence

This can be useful for making custom Python scripted features.


Пример:

import BOPTools.SplitFeatures
j = BOPTools.SplitFeatures.makeBooleanFragments(name= 'BooleanFragments')
j.Objects = FreeCADGui.Selection.getSelection()

Инструмент сам реализован на Python, см. /Mod/Part/BOPTools/SplitFeatures.py там, где установлен FreeCAD.

Примечания

Инструмент появился в FreeCAD v0.17.8053. FreeCAD необходимо скомпилировать с OCC 6.9.0 или новее, иначе инструмент будет недоступен.