**boolean_operation#

Description#

This command is used to perform boolean operation between meshes (union, intersection or difference). It uses the GNU Triangular Surface library (GTS) plugin for operations on mesh skins. For volume meshes, INRIA remeshing plugins are required (see **yams_ghs3d).

Syntax#

The command has the following syntax:

**boolean_operation \(~\,\) *operation operation-type \(~\,\) *file1 geof-filename \(~\,\) *file2 geof-filename \(~\,\) *output_file gts-output-filename \(~\,\) [ *keep_1st nset ] \(~\,\) [ *keep_2nd nset ] \(~\,\) [ *dist_crit distance ] \(~\,\) [ *surface_crit value ] \(~\,\) [ *refinement func(x,y,z) ] \(~\,\) [ *absolu ] \(~\,\) [ *tolerance tol ] \(~\,\) [ *min_size min ] \(~\,\) [ *max_size max ] \(~\,\) [ *gradation grad ] \(~\,\) [ *optim_style opt ] \(~\,\) [ *options yams-command-line-options ]

Many keywords correspond to the yams syntax and one should refer to the manual. The operation order is file1 OPERATION file2. For a complete description of the syntax see **yams_ghs3d documentation.

*operation operation-type

must be intersection, union or difference.

*output_file

file name containing GTS output after the boolean operation.

*keep_1st

this will preserve the topology of specified nset the in first mesh.

*keep_2nd

this will preserve the topology of specified nset the in second mesh.

*dist_crit

merge vertexes closer than the specified distance.

*surface_crit

eliminate degenerate triangles with relative surface areas smaller than the specified value.

Example#

****mesher
 ***mesh difference
  **boolean_operation_ghs3d
   *operation difference
   *file1 cube.geof
   *file2 volume.geof
   *output_file difference.gts
   *options        -m 100 -FEM
   *optim_style 1
   *keep_2nd skin
****return
../../_images/boolean_operation_fig.svg

Note

The “difference” operation requires the subtracted mesh to be slightly bigger than the other one. Therefore, it may be necessary to “thicken” it slightly, using e.g. **thicken_bset (see thicken_bset ) or **porcupine (see porcupine).