(
        self, entities, delete_first: bool = True, delete_other: bool = True
    )
return [Dummy(*ent[0])]
Boolean intersection, see
        https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity
        and tool_entity are called object and tool in gmsh documentation.
Boolean intersection, see
        https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity
        and tool_entity are called object and tool in gmsh documentation.
Boolean intersection see https : // gmsh . info / doc / texinfo / gmsh . html#Boolean - operations input_entity and tool_entity are called object and tool in gmsh documentation .
def boolean_intersection(
        self, entities, delete_first: bool = True, delete_other: bool = True
    ):
        """Boolean intersection, see
        https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity
        and tool_entity are called object and tool in gmsh documentation.
        """
        entities = [e if isinstance(e, list) else [e] for e in entities]

        ent = [e.dim_tag for e in entities[0]]
        # form subsequent intersections
        # https://gitlab.onelab.info/gmsh/gmsh/-/issues/999
        for e in entities[1:]:
            out, _ = gmsh.model.occ.intersect(
                ent,
                [ee.dim_tag for ee in e],
                removeObject=delete_first,
                removeTool=delete_other,
            )
            if len(out) == 0:
                raise RuntimeError("Empty intersection.")
            if not _all_equal(out):
                raise RuntimeError(
                    f"Expected all-equal elements, but got dim_tags {out}"
                )
            ent = [out[0]]

        # remove entities from SIZE_QUEUE if necessary
        all_entities = []
        if delete_first:
            all_entities += entities[0]
        if delete_other:
            for e in entities[1:]:
                all_entities += e
        for s in self._SIZE_QUEUE:
            if s[0] in all_entities:
                warnings.warn(
                    f"Specified mesh size for {s[0]} "
                    "discarded in Boolean intersection operation."
                )
        self._SIZE_QUEUE = [s for s in self._SIZE_QUEUE if s[0] not in all_entities]

        return [Dummy(*ent[0])]
def boolean_intersection ( self , entities , delete_first : bool = True , delete_other : bool = True ) : entities = [ e if isinstance ( e , list ) else [ e ] for e in entities ] ent = [ e . dim_tag for e in entities [ 0 ] ] # form subsequent intersections # https://gitlab.onelab.info/gmsh/gmsh/-/issues/999 for e in entities [ 1 : ] : out , _ = gmsh . model . occ . intersect ( ent , [ ee . dim_tag for ee in e ] , removeObject = delete_first , removeTool = delete_other , ) if len ( out ) == 0 : raise RuntimeError ( "Empty intersection." ) if not _all_equal ( out ) : raise RuntimeError ( f"Expected all-equal elements, but got dim_tags {out}" ) ent = [ out [ 0 ] ] # remove entities from SIZE_QUEUE if necessary all_entities = [ ] if delete_first : all_entities += entities [ 0 ] if delete_other : for e in entities [ 1 : ] : all_entities += e for s in self . _SIZE_QUEUE : if s [ 0 ] in all_entities : warnings . warn ( f"Specified mesh size for {s[0]} " "discarded in Boolean intersection operation." ) self . _SIZE_QUEUE = [ s for s in self . _SIZE_QUEUE if s [ 0 ] not in all_entities ] return [ Dummy ( * ent [ 0 ] ) ]