Model.detach_geom#
- Model.detach_geom(collection0, collection1=Collection(), organize=False)#
Detaches the selected geometry topologically from another selection or from the rest of the model. In mark0, the user gives the selection of geometry which will be detached from other geometries. If
collection1is provided, then the geometry incollection0is detached only from the geometry incollection1. Ifcollection1is not provided, then the geometry incollection0is detached from the rest of the model.Additionally, the boundary surfaces of solids, which are in the input selection, are also organized into solid’s component, if they are found to be in different components. The reorganization of solid boundary surfaces is controlled by the optional argument organize.
- Parameters:
collection0 (Collection) – The collection containing the entities that are going to be detached from other geometries. Valid entity types are surfaces, solids, components, parts and subsystems.
collection1 (Collection) – The collection containing the entities. If this input is provided, entities on
collection0are detached only from the entities oncollection1. Otherwise, entities with mark0 are detached from all the other entities in the model.organize (bool) – Controls the reorganization of solid boundary surfaces. If
organize=True, boundary surfaces of solids oncollection0are reorganized so that they are in the same component as the solid.
Examples#
Detach surfaces and solids in part with uid “ My_part “, from the rest of the model and also to make sure that all the solids in this part are adjusted so their boundary surfaces are also in their solid’s component#import hm import hm.entities as ent model = hm.Model() part_collection = hm.Collection(model, ent.Part, ["My_part"]) model.detach_geom(collection0=part_collection, organize=True)
Detach surfaces with IDs 60, 49, 42, 58, 7 and 11 from surfaces with IDs 52, 38 and 29, while keep the connectivity with the rest of the model#import hm import hm.entities as ent model = hm.Model() model.detach_geom( collection0=hm.Collection(model, ent.Surface, [60, 49, 42, 58.7, 11]), collection1=hm.Collection(model, ent.Surface, [52, 38, 29]), )