Esempio n. 1
0
    def unite(self,obj):
        """unite( obj ).

        Function to take the union of the
        mesh object obj with the present object.
        The argument obj can also be a list of objects.
        The present object is updated in-place.
        """

        try:
            if type(obj.obj) == type(self.obj):
                other_obj = obj
        except:
            raise TypeError("Type mismatch for object union")

        self.obj = ocaml.body_union([self.obj,other_obj.obj])
Esempio n. 2
0
    def unite(self,other):
        """unite( obj ).

        Function to take the union of the
        mesh object obj with the present object.
        """
        new_obj = mesh.mesh_obj()                         # create new object
        for other_obj in other.obj:
            for obj in self.obj:
                new_obj.obj.append(ocaml.body_union([obj,other_obj]))

        for i in range(len(self.bbox[0])):           # update bounding box       
            new_obj.bbox[0] = self.bbox[0][:]
            new_obj.bbox[1] = self.bbox[1][:]

#        print new_obj.bbox
        return new_obj