Model.change_edgedensities_advanced#

Model.change_edgedensities_advanced(edges_collection, density, mode=1, layers=0)#

Changes the edge density with remesh/modification of only the given layers of elements of the surfaces attached to the edge whose density is manipulated. Provide the line collection, along with the density value corresponding to the mode chosen, with the number of layers to remesh for the edge connected surfaces.

Parameters:
  • edges_collection (Collection) – The collection containing the input line entities.

  • density (int) – The new density value to be set for the selected lines/edges.

  • mode (int) –

    The method used to assign the density to the surface edges:

    1 - Sets edge density to the density value (default).

    2 - Increments/decrements to the edge density by the density value. A positive density causes an increment while a negative density causes a decrement.

  • layers (int) – The number of layers to remesh for the surfaces attached to the edge. Default is 0, as in the whole surface is remeshed.

Examples#

Set the edge density to 12 on edge with ID 21117#
import hm
import hm.entities as ent

model = hm.Model()

model.change_edgedensities_advanced(
    edges_collection=hm.Collection(model, ent.Line, [21117]),
    density=12,
    mode=1,
    layers=3,
)
Increment by 1 the density on edge with ID 21117#
import hm
import hm.entities as ent

model = hm.Model()

model.change_edgedensities_advanced(
    edges_collection=hm.Collection(model, ent.Line, [21117]),
    density=1,
    mode=2,
    layers=3,
)
Decrement by 2 the densities on edges with IDs 21117 and 21101#
import hm
import hm.entities as ent

model = hm.Model()

model.change_edgedensities_advanced(
    edges_collection=hm.Collection(model, ent.Line, [21117, 2111]),
    density=-2,
    mode=2,
    layers=3,
)