Model.detectandcreatefeatures#

Model.detectandcreatefeatures(hole2d_detection=0, hole3d_detection=0, fillet_detection=0, flange2d_detection=0, logo_detection=0, surface_collection=Collection(), element_collection=Collection(), hole2d_minradius=0.0, hole2d_maxradius=0.0, hole3d_stephole=0, hole3d_minradius=0.0, hole3d_maxradius=0.0, hole3d_maxdepth=0.0, fillet_minradius=0.0, fillet_maxradius=0.0, flange2d_maxwidth=0.0, logo_maxwidth=0.0, logo_maxheight=0.0, logo_concavityfactor=1.0)#

Detect all feature types within the filter options and create feature entities.

Parameters:
  • hole2d_detection (int) –

    The detection of 2D holes.

    0 - Off

    1 - On

  • hole3d_detection (int) –

    The detection of 3D holes.

    0 - Off

    1 - On

  • fillet_detection (int) –

    The detection of fillets.

    0 - Off

    1 - On

  • flange2d_detection (int) –

    The detection of 2D flanges.

    0 - Off

    1 - On

  • logo_detection (int) –

    The detection of logos.

    0 - Off

    1 - On

  • surface_collection (Collection) – The collection containing the surface entities to detect features (geometry input).

  • element_collection (Collection) – The collection containing the element entities to detect features (FE input).

  • hole2d_minradius (double) – The minimum radius of 2D holes to be detected as a feature.

  • hole2d_maxradius (double) – The maximum radius of 2D holes to be detected as a feature.

  • hole3d_stephole (int) –

    0 - Each barrel is considered as an individual hole. (default)

    1 - The full step hole is considered as a single hole.

  • hole3d_minradius (double) – The minimum radius of a 3D hole to be detected as a feature. (default=0.01)

  • hole3d_maxradius (double) – The maximum radius of a 3D hole to be detected as a feature. (default=20.0)

  • hole3d_maxdepth (double) – The maximum length of a 3D hole to be detected as a feature.

  • fillet_minradius (double) – The minimum radius a fillet to be detected as a feature.

  • fillet_maxradius (double) – The maximum radius of a fillet to be detected as a feature.

  • flange2d_maxwidth (double) – The maximum width of a 2D flange to be detected as a feature.

  • logo_maxwidth (double) – The maximum width of a logo to be detected as a feature.

  • logo_maxheight (double) – The maximum height of the logo to be detected as a feature.

  • logo_concavityfactor (double) – The concavity factor value to be considered during logo detection. (default=1.0)

Example#

Detect 2D holes with minimum radius of 0.02 and maximum radius of 20.0#
import hm
import hm.entities as ent

model = hm.Model()

model.detectandcreatefeatures(
hole2d_detection=1,
surface_collection=hm.Collection(model, ent.Surface),
element_collection=hm.Collection(model, ent.Element),
hole2d_minradius=0.02,
hole2d_maxradius=20.0,
)