Model.hmmeshspline#

Model.hmmeshspline(quads)#

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

Parameters:

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

Example#

Generate elements with densities of 10 , 11 , 10 , and 10 along the given edges#
import hm
import hm.entities as ent

model = hm.Model()

model.surfacemode(mode=3)
line1 = ent.Line(model, 1)
line2 = ent.Line(model, 2)
line3 = ent.Line(model, 7)
line4 = ent.Line(model, 8)

model.splinesurface(
    collection=hm.Collection([line1, line2, line3, line4]),
    plane_flag=0,
    plane_normal=[1.0, 0.0, 0.0],
    plane_base=[0.0, 0.0, 0.0],
    options=1,
)
model.set_meshedgeparams(
    edge_index=0,
    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=1,
    elem_density=11.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=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=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.hmmeshspline(quads=1)
model.storemeshtodatabase(elemstosurfcomp=0)
model.ameshclearsurface()