Model.findedges#

Model.findedges(collection, edgetype='free', createlines=False, smoothlines=False, ignorefeatures=False, breakangle=30.0, chainid=UINT_MAX, componentprefix='', componentname='^edges', color='#FF0000')#

Finds and displays element free or T-connected edges as plot elements.

Parameters:
  • collection (Collection) – The collection containing the entities to find edges for. Valid values are components and elements.

  • edgetype (hwString) –

    The type of edges to find:

    free/boundary - Finds boundary edges that are attached to a single element.

    tee/t - Finds T-connected edges that are attached to more than two elements.

  • createlines (bool) – If set to 1 or true, creates free lines instead of plot elements at edges.

  • smoothlines (bool) – If set to 1 or true, smooths the free lines through the nodes. Only effective when createlines=True.

  • ignorefeatures (bool) – If 1 or true, ignores features such as holes when finding free edges.

  • breakangle (double) – The angle specifying when to break the feature line created into multiple line segments when createlines=True. When the angle between adjoining elements along the feature is larger than the specified value, it splits the line into multiple segments.

  • chainid (unsigned int) – If given, groups the edges found into chains and creates plot elements or lines only for the n-th chain. If n is more than the number of chains, creates plot elements or lines for all chains.

  • componentprefix (hwString) – If given, creates plot elements or lines in new components whose name is derived from the parent component of one of the attached elements. The format is “<prefix>_<original_name>_#” where original name is the name of the parent component and # is a numerical suffix that is incremented each time the function is called on the same component.

  • componentname (hwString) – If given, creates or overwrites a component with the given name and creates plot elements or lines there.

  • color (hwString) – Reserved for future development.

Examples#

Check the free edges on all elements contained in the component named fender#
import hm
import hm.entities as ent

model = hm.Model()

comps = hm.Collection(model, ent.Component, "name=fender")

model.findedges(collection=comps, edgetype="free")
Check the T-connected edges on all elements#
import hm
import hm.entities as ent

model = hm.Model()

elems = hm.Collection(model, ent.Element)

model.findedges(collection=elems, edgetype="free")
Check the free edges and create free lines on them, breaking into separate lines on 30-degree angles, ignoring features and with name as ^edges_<original name>_##
import hm
import hm.entities as ent

model = hm.Model()

elems = hm.Collection(model, ent.Element)

model.findedges(
  collection=elems,
  edgetype="free",
  createlines=True,
  breakangle=30.0,
  ignorefeatures=True,
  componentprefix="^edges_")