Model.boolean_merge_solids#

Model.boolean_merge_solids(entitycollectiona, entitycollectionb, opcode, options)#

Performs a Boolean operation on selected solid entities.

Parameters:
  • entitycollectiona (Collection) – The collection containing the solid entities in set A.

  • entitycollectionb (Collection) – The collection containing the solid entities in set B.

  • opcode (int) –

    The code of the Boolean operation to be performed. Valid options are:

    2 - Set A minus set B.

    8 - Set A or set B

    14 - Set A and set B

  • options (int) –

    Specifies how to process internal shared boundaries in resulted solid or solids. Valid values are:

    0 - All boundaries shared between sets A and B are removed.

    1 - Surfaces that were part of the boundary of solids in the set B are kept in the result.

    2 - All shared boundaries are kept in the result.

    3 - All shared boundaries are removed.

Note

Performs the same operation as Model.boolean_solids() when BooleanTolerance is not specified. The Model.boolean_solids() should be used for combination operation of FE solids.

Example#

Subtract solid with ID 20 from solid with ID 10#
import hm
import hm.entities as ent

model = hm.Model()

solid_set_A = hm.Collection(model, ent.Solid, [10])
solid_set_B = hm.Collection(model, ent.Solid, [20])

model.boolean_merge_solids(entitycollectiona=solid_set_A, entitycollectionb=solid_set_B, OpCode=2)