Model.hmmeshspin#

Model.hmmeshspin(quads)#

Within the automeshing module, generates quad or tria elements using a surfaceless algorithm. Can only be used together with model.surfacemode(mode=3) and one of the Model.surfacecreatespinlinewithoffsetangle() or Model.surfacecreatespinnodeswithoffsetangle() function.

Parameters:

quads (int) – If nonzero, specifies that the created elements should be quads.

Example#

Spinnig line with ID 4 forty-five degrees about the given axis to identify a region approximating a surface of revolution, and without actually making a surface, creates 150 elements (15 on the line and 10 on the spin)#
import hm
import hm.entities as ent

model = hm.Model()

model.surfacemode(mode=3)
line1 = ent.Line(model, 4)

model.surfacecreatespinlinewithoffsetangle(
    collection=hm.Collection([line1]),
    rotation_plane_normal=[0.6757, 0.0, 0.0],
    rotation_plane_base=[860.0, 0.0, 332.0],
    start_angle=0.0,
    end_angle=45.0,
    options=0,
)
model.set_meshedgeparams(
    edge_index=0,
    elem_density=15.0,
    alg_type=0,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)
model.set_meshedgeparams(
    edge_index=1,
    elem_density=10.0,
    alg_type=0,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)
model.set_meshedgeparams(
    edge_index=2,
    elem_density=15.0,
    alg_type=0,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)
model.set_meshedgeparams(
    edge_index=3,
    elem_density=10.0,
    alg_type=0,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)
model.hmmeshspin(quads=1)
model.storemeshtodatabase(elemstosurfcomp=0)
model.ameshclearsurface()