Математика |
Логические операции в 3D MAX можно можно выполнять только над двумя объектами.
Эти объекты должны пересекаться.
Оболочки исходных объектов ,участывающих в булевских операций называются операндами(operands)
Логические операции |
|
Union | Объединение |
Intersect | Пересечение |
Subtract | Вычитание |
Add | Добавление |
The mesh operations underlying the Boolean Compound Object in 3ds Max are accessible in MAXScript. They appear as operators (+, -, *) that you can apply to any two scene objects that are convertible to meshes. These objects are all GeometryClass objects with the exception of the particle systems.
The operators are:
<node1> + <node2>
Returns the union of node1 and node2
<node1> - <node2>
Returns the subtraction of node2 from node1
<node1> * <node2>
Returns the intersection of node1 and node2
Example:
$foo - $baz
$sphere01 + $sphere02 + $sphere03 + $sphere04
The Boolean operators change the first operand to be the result of the operation and leave the second operand untouched. So, in the first example, the $foo node is changed to an Editable Mesh object containing the result of the difference operation. In the second example, $sphere01 is successively unioned with each of the other spheres - $sphere01 contains the compound result and the other spheres are left standing.
Note
Unlike the Boolean compound object in 3ds Max, this operation destructively modifies the first operand - you cannot retrieve the original first operand after the Boolean operation is performed. You can effectively keep the first operand by using a copy function,
For example
result = (copy $foo) - $baz
will put a modified copy of $foo into the variable result, leaving the original $foo unchanged.
Returns an array of two integers - the face count and the vertex count of the TriMesh on top of the modifier stack.
Constructor
boolObj.createBooleanObject <operand_A> [ <operand_B> <add_method> <mat_method> ]
Creates a Boolean2 object using node <operand_A> and an optional node <operand_B>. <add_method> specifies how <operand_B> is to be used as follows:
1 -
instance(Экземпляр), operand is an instance of the original node.
В операции принимает участие экземпляр второго объекта.
2 -
reference(Ссылка), operand is a reference to original node.
В операции принимает участие ссылка на второй объект.
3 -
copy(скопировать),operand is a copy of original node .
В операции участвует копия второго обекта.Сам Обьект остается при этом без изменения.
4 -
move(Переместить),original node should be deleted .
operand_B пропадает после выполнения операции.
<mat_method> specifies how the materials of the two operands are to be handled as follows:
1 - combines materials without changing them or the ID's
2 - matches ID's to materials, then combines materials
3 - matches materials to ID's, then combines them
4 - discards original material, uses new node's instead
5 - discards new node's material, uses original
Properties
The following properties are available only after the boolean2 object has been created. The values shown for the properties are those for a boolean2 object created from two spheres. The operand transforms are in the local coordinate system of the boolean2 object.
<bool_obj>.Sphere02 SubAnim default: SubAnim:Sphere02
<bool_obj>.Operand_A_Transform SubAnim default: SubAnim:Operand_A_Transform
<bool_obj>.Sphere01 SubAnim default: SubAnim:Sphere01
<bool_obj>.Operand_B_Transform SubAnim default: SubAnim:Operand_B_Transform
boolObj.setOperandB <bool_obj> <operand_B> <add_method> <mat_method>
sets operand B. The values for <add_method> and <mat_method> are describe above.
boolObj.getOperandSel <bool_obj> <integer>
boolObj.setOperandSel <bool_obj> <integer> <boolean>
these methods get and set whether operand_A and operand_B are selected in the Operands list. <integer> = 1 - operand_A, 2 - operand_B
boolObj.getBoolOp <bool_obj>
boolObj.setBoolOp <bool_obj> <integer>
these methods get and set the boolean Operation Type. Valid values are:
1 -
Union(Объединение)-
Результирующий обьект ,полученный объединение двух объектов,содержит все точки двух исходных объектов-орерандов,за исключением общих точек.
2 -
Intersection(Пересечение)
Объект ,полученный в результе операции пересечения ,содержит только те точки ,которые являются общими для
двух исходных объектов.
3 - Subtraction(Вычетания) (A-B)
4 - Subtraction (Вычетания)(B-A)
5 - Cut
boolObj.getBoolCutType <bool_obj>
boolObj.setBoolCutType <bool_obj> <integer>
these methods get and set the boolean Cut Type. The value for this property only has an effect if the Operation Type is Cut. The Cut Types are:
1 - Refine
2 - Split
3 - Remove Inside
4 - Remove Outside
boolObj.getDisplayResult <bool_obj>
boolObj.setDisplayResult <bool_obj> <boolean>
these methods get and set whether Results or Operands are displayed. If true, Result is displayed. If false, Operands are displayed.
boolObj.getShowHiddenOps <bool_obj>
boolObj.setShowHiddenOps <bool_obj> <boolean>
these methods get and set whether Results + Hidden Operands are displayed. If true, Results + Hidden Operands are displayed. If false, the Results or Operands as specified using boolObj.SetDisplayResult() are displayed.
boolObj.getUpdateMode <bool_obj>
boolObj.setUpdateMode <bool_obj> <integer>
these methods get and set the Update mode as follows:
1 - Always
2 - When Rendering
3 - Manually
boolObj.getOptimize <bool_obj>
boolObj.setOptimize <bool_obj> <boolean>
these methods get and set whether vertices are to be welded on the boolean result
Constructor
boolObj.createBooleanObject <operand_A> [ <operand_B> <add_method> <mat_method> ]
Creates
a Boolean2 object using node <operand_A> and an optional node
<operand_B>.
<add_method> specifies how
<operand_B> is to be used as
follows:
1 -
instance(Экземпляр), operand is an instance of the original node.
В операции принимает участие экземпляр второго объекта.
2 -
reference(Ссылка), operand is a reference to original node.
В операции принимает участие ссылка на второй объект.
3 -
copy(скопировать),operand is a copy of original node .
В операции участвует копия второго обекта.Сам Обьект остается при этом без изменения.
4 -
move(Переместить),original node should be deleted .
operand_B пропадает после выполнения операции.
<mat_method> specifies how the materials of the two operands are to be handled as follows:
1 - combines materials without changing them or the ID's
2 - matches ID's to materials, then combines materials
3 - matches materials to ID's, then combines them
4 - discards original material, uses new node's instead
5 - discards new node's material, uses original
Properties
The following properties are available only after the boolean2 object has been created. The values shown for the properties are those for a boolean2 object created from two spheres. The operand transforms are in the local coordinate system of the boolean2 object.
<bool_obj>.Sphere02 SubAnim default: SubAnim:Sphere02
<bool_obj>.Operand_A_Transform SubAnim default: SubAnim:Operand_A_Transform
<bool_obj>.Sphere01 SubAnim default: SubAnim:Sphere01
<bool_obj>.Operand_B_Transform SubAnim default: SubAnim:Operand_B_Transform
boolObj.setOperandB <bool_obj> <operand_B> <add_method> <mat_method>
sets operand B. The values for <add_method> and <mat_method> are describe above.
Скрипт выполняющий
3 -
Subtraction(Вычетания) (A-B)
4 -
move(Переместить),original node should be deleted .
operand_B пропадает после выполнения операции.
и
Исходные объекты |
|
Скрипт выполняющий 3 - Subtraction(Вычетания) (A-B) --Создаем начальные данные Sphere1=Sphere() Sphere2=Sphere() move Sphere1[0,0,0] move Sphere2[0.0,-35.567,0] --Обработка boolObj.createBooleanObject Sphere1 boolObj.SetOperandB Sphere1 Sphere2 4 3 |
|
|
Скрипт выполняющий --Создаем начальные данные Sphere1=Sphere() Sphere2=Sphere() move Sphere1[0,0,0] move Sphere2[0.0,-35.567,0] --Обработка boolObj.createBooleanObject Sphere1 |
Предложениями и замечаниями обращаться по адресу- vova1001@yandex.ru |