Model.change_edgedensities#
- Model.change_edgedensities(collection, mode, density, refedge)#
Changes the densities of selected surface edges and remeshes the adjacent surfaces, according to the specified mode. This is an automesh function.
- Parameters:
collection (Collection) – The collection containing the input surface entities.
mode (int) –
The method used to assign the density to the surface edges:
1 - Set edge density to the
densityvalue.2 - Increment/decrement the edge density by the
densityvalue. A positive density will increment while a negative density will decrement.3 - Set edge density to be the same as on reference edge
refedge.density (int) – The density value to assign to the surface edges on
collection. Valid withmode1 and 2.refedge (Entity) – The line entity defining the edge used when
mode =3.
Examples#
Set edge density to 10 on edge with ID 208#import hm import hm.entities as ent model = hm.Model model.change_edgedensities( collection=hm.Collection(model, ent.Line, [208]), mode=1, density=10, refedge=None )
Increment by 1 density on edge with ID 208#import hm import hm.entities as ent model = hm.Model model.change_edgedensities( collection=hm.Collection(model, ent.Line, [208]), mode=2, density=1, refedge=None )
Decrement by 2 densities on edges with ID 208 and 209#import hm import hm.entities as ent model = hm.Model model.change_edgedensities( collection=hm.Collection(model, ent.Line, [208, 209]), mode=2, density=-2, refedge=None )
Decrement by 2 densities on edges with ID 208 and 209#import hm import hm.entities as ent model = hm.Model model.change_edgedensities( collection=hm.Collection(model, ent.Line, [229, 222, 219]), mode=3, density=0, refedge=ent.Line(model,211) )