Model.trim_elements_with_box#

Model.trim_elements_with_box(trim_collection, box_collection, SPC_collector='', DOF_array=hwIntList(), comp_remainder_elem_numb=-1, comp_remainder_area_rate=0.000000, rebuild=False)#

Trims shell elements using solids. Shell elements inside the solids are kept and the elements along any cuts are re-meshed. Solid elements with all nodes inside the box are kept, while all others are deleted.

Parameters:
  • trim_collection (Collection) – The collection containing the element entities to trim.

  • box_collection (Collection) – The collection containing the solid entities to use for trimming.

  • SPC_collector (hwString) – The name of the collector in which the SPCs will be created for constraining cut elements. If this is option is specified, constraints will be created. Otherwise, no constraints are created.

  • DOF_array (hwIntList) – The degrees of freedom that need to be constrained. Valid values are 0 and 1 and should be given in a list of 6 values each corresponding to one DOF. The 0 means not constrained and 1 means constrained.

  • comp_remainder_elem_numb (int) – The minimum number of elements in a component. After box trimming, any component with an element count less than this value is deleted.

  • comp_remainder_area_rate (double) – The limit of shell element area of components. After box trimming, any component with the element area representing less than the specified percentage of its original area is deleted. The valid range of the value is between 0.0 and 100.0.

  • rebuild (bool) –

    Valid values are:

    False - Do not rebuild the elements along the intersection edges.

    True - Rebuild the elements along the intersection edges. If this is given, then the global criteria and parameter file set for rebuild will be used for remeshing.

Example#

Trim the elements of a model using solid ID 1 and constrain the cut edges along all DOFs#
import hm
import hm.entities as ent

model = hm.Model()

element_collection = hm.Collection(model, ent.Element)
solid_collection = hm.Collection(model, ent.Solid, [2])


model.trim_elements_with_box(
    trim_collection=element_collection,
    box_collection=solid_collection,
    SPC_collector="BoxTrimConstraints",
    DOF_array=[1, 1, 1, 1, 1, 1],
)