Le Modificateur Booléen

The Boolean Modifier performs operations on meshes that are otherwise too complex to achieve with as few steps by editing meshes manually. The Boolean Modifier uses one of three Boolean operations that can be used to create a single mesh out of two mesh objects:

Différence:Negation
Union:Disjunction
Intersection:Conjunction
../../../_images/modifier_generate_boolean_union_intersect_difference_examples.png

L’Union, l’Intersection et la Difference entre un Cube et une UV Sphere, avec le modificateur appliqué à la Sphere et utilisant le Cube comme cible.

Note

  • The Boolean Modifier works with open and closed volumes.
  • The Boolean Modifier does not work on edges without faces.
  • La topologie cible détermine la nouvelle topologie du maillage modifié.

  • Les normales de face sont prises en compte pour les calculs.

  • Whether faces are marked for smooth or flat for shading does not affect the calculations of this modifier.
  • The line at which this modifier is calculated is delimited by the first tangential contact between faces of the modified mesh and target.

Astuce

C’est un modificateur dynamique en temps réel!

Si vous avez marqué vos objets pour montrer les Arêtes (dans Properties Editor ‣ Object ‣ Display, activez Wire), vous verrez le processus de création des arêtes lorsque vous déplacez vos objets. Selon la topologie du maillage, vous pouvez aussi activer X-Ray et Transparency et voir la topologie se créer en temps réel.

Usage

To use the Boolean Modifier select the desired mesh Object then add a Boolean Modifier. When you add the Boolean Modifier for an object, Blender will need a second object to be the target of the operation. You can use open or closed meshes, as long as they have available face normals for the calculations to take effect. You can add one or more modifiers of this type for an Object but you can only apply one operation for the Boolean Modifier at a time.

Options

../../../_images/modeling_modifiers_generate_booleans.png

Boolean Modifier Options.

Opérations

Opération

Quelle opération booléenne doit être appliquée.

Différence

Le mesh modifié est soustrait du mesh cible.

  • Si le maillage cible a des normales inversées, Blender calculera l’intersection avec le maillage cible.

  • Si le maillage modifié a des normales inversées, Blender va ajouter les deux maillages (Union).

  • Si les deux maillages ont des normales inversées, Blender calculera l’intersection du maillage cible.

Union

Le maillage cible est ajouté au maillage modifié.

  • Si le maillage cible a des normales inversées, Blender calculera l’intersection avec le maillage cible.

  • Si le maillage modifié a des normales inversées, Blender va soustraire le maillage cible.

  • Si les deux maillages ont des normales inversées, Blender calculera l’intersection avec le maillage modifié.

Intersection

Le maillage cible est soustrait du maillage modifié.

  • Si le maillage cible a des normales inversées, Blender va soustraire le maillage cible.

  • Si le maillage modifié a des normales inversées, Blender calculera l’intersection avec le maillage cible.

  • Si les deux maillages ont des normales inversées, Blender va ajouter les deux maillages (Union).

Objet

Le nom de l’objet maillage cible.

Solver
TODO

Matériaux

The Boolean Modifier preserves the Materials of the participant Meshes, including their basic textures and mappings, and the modified mesh will receive its first active material index assigned to its new topology (the first active material).

Below, some examples are shown to exemplify how materials work with the Boolean Modifier; we took the cube as the modified mesh, and the icosphere as the target with one material (white). We added four different indexes to one of the faces of the cube, leaving another basic material in the other faces. The top left image shows how the Boolean Modifier interacts with the materials. The other three images show the three different Boolean operations applied to the modified mesh. In all the images the meshes have normals pointed outwards with the Icosphere as the target, and the Cube being the modified mesh.

../../../_images/modifier_generate_boolean_multi_materials_example_base.png

Cube avec plusieurs Matériaux et Icosphere avec matériau de base.

../../../_images/modifier_generate_boolean_multi_materials_example_union.png

Union : le premier matériau actif du Cube est ajouté à la nouvelle topologie.

../../../_images/modifier_generate_boolean_multi_materials_example_difference_.png

Difference : l’Icosphère a été soustrait du Cube.

../../../_images/modifier_generate_boolean_multi_materials_example_intersect_.png

Intersection: le maillage résultant a été copié et tourné de 180°.

The only exception is the difference operation when the normals of the target and modified mesh are inverted. In this case, Blender will project the textures in an inverted direction over the target using the center contact of the meshes as a pivot and the resulting mesh will have the modified mesh subtracted from the target. For complex target meshes in some particular cases, you may have to reassign materials to faces because Blender will use the possible projection, and this may result in a sub-optimal texture assignment. You can see this in the last example below.

../../../_images/modifier_generate_boolean_multi_materials_example_inverted_normals_back.png

Avant de la cible avec les matériaux du maillage modifié.

../../../_images/modifier_generate_boolean_multi_materials_example_inverted_normals_front.png

Arrière de la cible avec les matériaux du maillage modifié

UV Mappings

When you map UV Images to your target, Blender will add a map for each of the faces of the target. When you apply the Boolean Modifier, Blender will follow the UV maps already assigned to the faces of the target topology that will be the result of the operation on the modified mesh. Blender will also use the same image mapped to the target faces in the modified mesh.

Avertissement

Selon la façon dont vous avez assigné les textures aux faces pendant l’unwrap uv , et la complexité de vos maillages, l’opération booléenne peut générer des UV imparfaits pour les nouvelles faces.

Ci-dessous nous avons quatre images, une sphère UV mappée avec une grille test teintée en bleu et une autre face teintée en mauve, une face du cube teintée en orange clair et les autres faces utilisant la grille de test normale. La première image montre l’opération au début (difference), et sur sa droite on montre le maillage résultant. Et dans la ligne du dessous nous montrons l’unwrap dans l’UV/image editor de Blender.

../../../_images/modifier_generate_boolean_uv_boolean_difference_operation_op_start.png

Une Sphère UV et un Cube avec différents UV Maps.

../../../_images/modifier_generate_boolean_uv_boolean_difference_operation_applied.png

Opération Difference appliquée.

../../../_images/modifier_generate_boolean_uv_map_face_modified_mesh.png

Faces du maillage modifié mappées.

../../../_images/modifier_generate_boolean_uv_map_face_modified_mesh_new_topology.png

Nouvelle topologie mappée et faces UV assignées.

Autres Modificateurs

The Boolean Modifier calculation is performed using the target modified mesh topology and dimensions. Other modifiers added to the modified mesh are bypassed. This means that if a target is using another modifier, like Subdivision Surface, the resulting topology for the modified mesh will take into account the subdivision of the target; but for the modified mesh, the basic topology is used anyway (see examples).

If you add Subdivision Surface to the modified mesh with a Boolean Modifier, Blender will visually add the subdivision for the modified mesh, but not for its calculations; it will only take into account its basic mesh topology. If you want to have a Subdivision Surface modifier added to the modified mesh, you have to apply the Subdivision Surface to the Boolean modified mesh before applying the Boolean operation.

The Boolean Modifier can be added together with other modifiers in the modified mesh, but depending on the modifier, the calculations cannot be done and/or the modifier cannot execute. When the modifier cannot execute, it will show the message "Cannot execute boolean operation", and when the modifier cannot be applied to the mesh, Blender will show the message "Modifier is disabled, Skipping Apply.". In this case, you either have to remove some modifiers or apply the necessary ones.

The most common case is when you add or copy a Boolean Modifier to use the modified mesh in conjunction with another target later; Blender will place the warning in the subsequent Boolean Modifiers in the stack depending on the operation, because you may be creating concurrent Boolean operations for the same modified mesh, which in most cases is impossible to execute depending on the chosen target. In this case, you can apply the first Boolean Modifier of the stack for the target and then use the other Boolean Modifier(s) in the stack for subsequent operations.

Also, if some other modifiers are placed above this modifier and you click on Apply, Blender will warn you with the message "Applied Modifier was not first, results may not be as expected". The best usage scenario for this modifier is to prepare your modified mesh and target to work with the Boolean Modifier.

When the Boolean Modifier is the first of the stack and is applied, the other Modifiers will act over the resulting meshes using the resulting topology and will remain in the modifiers stack.

En dessous on a deux images : une avec le subsurf ajouté à la cible, et une autre avec la topologie résultante.

../../../_images/modifier_generate_boolean_subsurf_added_to_the_target.png

Le Modificateur avec une cible SubSurf.

../../../_images/modifier_generate_boolean_resulting_mesh_subsurf_added_to_the_target.png

La topologie résultante.

Comme vous pouvez voir, le Subsurf ajouté (non appliqué) à la cible a été pris en considération. La topologie de l’Icosphère avec subsurf (niveau 2) a été complètement transférée au maillage modifié.

Astuce

La topologie de la cible détermine la topologie résultante

The target topology determines the results of the Boolean Modifier operation. It means that any modifier added to the target which modifies its topology will affect the resulting mesh of the operation.

Opérations concurrentes

Pour les maillages modifiés, vous pouvez seulement appliquer une opération à la fois, mais vous pouvez utiliser la même cible pour les autres maillages modifiés et utiliser les maillages modifiés comme cible pour d’autres maillages. Donc, vous pouvez copier ou ajouter le même modificateur à la pile de modificateurs le nombre de fois que vous désirez suit le nombre d’opérations dont vous avez besoin, mais faîtes attention, si vous choisissez des cibles concurrentes qui sont, en même temps, des maillages modifiés pointant l’un vers l’autre, vous pouvez amener blender à crasher à cause de boucles fermées!

Conseils

Soyez conscient que d’autres modificateurs et leur position dans la pile pourrait amener ce modificateur à échouer dans certaines circonstances.

Astuce

La meilleure façon de travailler avec ce modificateur quand vous avez besoin de faire beuacoup d’opérations séquentielles du même modificateur est de définir la cible au moment où vous avez besoin d’appliquer les modifications à la topologie.

Normales des Faces

When using the Boolean Modifier, Blender will use the face normal directions to calculate the three Boolean operations. The direction of the normals will define the result of the three available operations. When one of the participants has inverted normals, you are in fact multiplying the operation by -1 and inverting the calculation order. You can, at any time, select your modified mesh, enter Edit Mode and flip the normals to change the behavior of the Boolean Modifier. See Tips: Fixing Mixed Normals below.

Blender ne peut donc pas effectuer une opération booléenne optimale quand une ou plus des normales du maillage des participants qui se touchent ont des normales externes/internes mélangées.

Cela signifie que vous pouvez utiliser les normales du maillage pointant complètement vers l’intérieur ou l’extérieur de vos participants dans l’opération, mais vous ne pouvez pas mixer des normales pointant vers l’intérieur et vers l’extérieur pour les faces de la topologie utilisées pour les calculs. Dans ce cas, blender va autoriser le modificateur et vous pouvez appliquer le modificateur, mais avec des mauvais voire aucun effet. Nous avons fait quelques exemples avec un cube et un icosphère montrant les résultats.

Sur les images ci-dessous, toutes les normales de face pointent vers l’extérieur (normal meshs).

../../../_images/modifier_generate_boolean_normals_pointing_outwards.png

Faces avec normales pointant vers l’extérieur.

../../../_images/modifier_boolean_difference_normals_pointing_outwards.png

Normal Boolean Modifier operation (Difference operation).

Dans les images ci-dessous, toutes les normales des faces sont inversées, en utilisant l’opération intersection

../../../_images/modifier_generate_boolean_normals_pointing_inwards.png

Opération booléenne avec normales inversées.

../../../_images/modifier_generate_boolean_intersection_normals_pointing_inwards.png

Normal Boolean Modifier operation.

Now, let us see what happens when the normal directions are mixed for one of the participants in the Boolean Modifier operation. The images below show face normals mixed, pointed to different directions and the resulting operation, you can see that the modifier has bad effects when applied, leaving faces opened:

../../../_images/modifier_generate_boolean_normals_mixed_inwards_outwards.png

Normales de face mélangées, pointant vers différentes directions.

../../../_images/modifier_generate_boolean_resulting_mesh_normals_mixed.png

Opération résultante laissant les faces ouvertes.

As you can see, the normal directions can be pointing to any of the Mesh sides, but cannot be mixed in opposite directions for the faces of the participants. The Library cannot determine properly what is positive and negative for the operation, so the results will be bad or you will have no effect when using the Boolean Modifier operation.

A quick way to fix this is to use Blender’s Recalculate Normals operation in Edit Mode.

Si vous avez encore quelques vilaines marques noires, vous devrez inverser manuellement les normales.

Vide ou Faces Dupliquées

This modifier does not work when the modified and/or the target mesh uses empty faces in the topology used for calculations. If the modifier faces a situation where you have empty faces mixed with normal faces, the modifier will try, as much as possible, to connect the faces and apply the operation. For situations where you have two concurrent faces at the same position, the modifier will operate on the target mesh using both faces, but the resulting normals will get messed. To avoid duplicated faces, you can remove doubles for the vertices before recalculating the normals outside or inside. The button for remove doubles is located in the Mesh Tools Panel in the 3D View, while in Edit Mode.

Le meilleur scénario d’utilisation pour ce modificateur est quand vous avez nettoyé les maillages avec des faces pointant clairement vers une direction (vers l’intérieur/vers l’extérieur)

Below we show an example of meshes with open faces mixed with normal faces being used to create a new topology. In this example, a difference between the cube and the icosphere is applied, but Blender connected a copy of the icosphere to the Cube mesh, trying to apply what was possible.

../../../_images/modifier_generate_boolean_mesh_with_mixed_empty_faces.png

Maillage avec deux faces vides mélangées avec des faces normales.

../../../_images/modifier_generate_boolean_mesh_with_mixed_empty_faces_result.png

Résultat après application d’une opération Difference.

Volumes Ouverts

Le modificateur booléen vous permet d’utiliser des meshs ouverts ou des volumes non-fermés (pas de faces ouvertes).

When using open meshes or non-closed volumes, the Boolean Modifier will not perform any operation in faces that do not create a new topology filled with faces using the faces of the target.

Dans les images en dessous, on trouve l’opération résultante quand on utilise deux volumes non-fermés avec des faces formant une nouvelle topologie.

../../../_images/modifiers_generate_boolean_complete_face_shape.png

Volumes non fermés formant une nouvelle topologie.

../../../_images/modifier_generate_boolean_resulting_complete_face_shape.png

Opération résultante en utilisant deux volumes ouverts.

Maintenant, voyons ce qui se passe quand nous utilisons des maillages qui sont partiellement ouverts, incomplets, ou des maillages qui ne forment pas une nouvelle topologie.

Comme vous pouvez le voir sur les images ci-dessous, les faces d’un participant dans l’opération booléenne donne au modificateur une information incomplète. Les arêtes résultantes sont embrouillées et il n’y a pas assez d’information pour créer des faces pour le maillage résultant. Cet exemple utilise une UV Sphere smooth shaded coupée en deux. Comme expliqué avant, le shading (smooth/flat) n’affecte pas le calcul du modificateur.

../../../_images/modifiers_boolean_incomplete_face_shape.png

Volumes ouverts qui ne forment pas une nouvelle topologie.

../../../_images/modifier_generate_boolean_resulting_incomplete_face_shape.png

Opération résultante de l’image sur la gauche