Model.geommatchtopology#

Model.geommatchtopology(collection, stitch_tol)#

Fixes gaps between stitched edges and vertices to make the actual geometry of the surfaces consistent with the model topology. It checks the topology of the model for gaps that are larger than a given tolerance between shared, non-manifold or suppressed edges. If the gap is found to be bigger than the tolerance, the surface and edge geometries are morphed parametrically and in 3D, if necessary, to make the gap smaller than the tolerance. In addition, non-essential degenerate edges are removed. This function preserves the original geometric entity ID’s.

Parameters:
  • collection (Collection) – The collection containing the entities to cleanup. Valid entities are solids, surfaces and lines (topological).

  • stitch_tol (double) –

    The tolerance value for gaps. The gap between edges and vertices are targeted to be smaller than this value after the function is run.

    If no tolerance value is given, or a value that is less than or equal to 0.0 is given, the value is taken as the model geometry cleanup tolerance.

Examples#

Fix the gap for the edges and vertices of all the surfaces in the model with the model geometry cleanup tolerance#
import hm
import hm.entities as ent

model = hm.Model()

# Querying the cleanup tolerance from HM database
_, r = hm.hm_getoption("cleanup_tolerance")
model.geommatchtopology(
    collection=hm.Collection(model, ent.Surface), stitch_tol=r.value
)
Fix the gap for the edges and vertices of surfaces with IDs 11 , 12 and 15 so that the gap is smaller than the model cleanup tolerance#
import hm
import hm.entities as ent

model = hm.Model()

# Querying the cleanup tolerance from HM database
_, r = hm.hm_getoption("cleanup_tolerance")
model.geommatchtopology(
    collection=hm.Collection(model, ent.Surface,[11, 12, 15]), stitch_tol=r.value
)
Fix the gap for the edges and vertices of all the surfaces in the model so that the gap is smaller than 0.001#
import hm
import hm.entities as ent

model = hm.Model()

_, r = hm.hm_getoption("cleanup_tolerance")
model.geommatchtopology(
    collection=hm.Collection(model, ent.Surface), stitch_tol=0.001
)