Model.midmesh_extract#
- Model.midmesh_extract(collection, CombineNonManifoldEdgesDistance=0.0, CombineNonManifoldEdgesFactor=0.500000, DefeatureOpeningsFactor=0.500000, DefeatureOpeningsWidth=0.0, DefeatureRibsWidth=0.0, DefeatureRibsWidthFactor=0.500000, DestinationComponent='Midmesh', DestinationComponentName='Midmesh', ExtractionSize=2.0, FlattenConnections=0, IgnoreFlatEdges=0, MidlineTrimFilletsFactor=0.500000, MinimumSize=2.0, StepOffsetMode='Automatic', SuppressProximityEdgesDistance=0.0, SuppressProximityEdgesFactor=0.500000, SuppressProximityFilletsFactor=0.500000, TargetElementSize=2.0, DestinationComponentPrefix='Midmesh_', DestinationPart='', Method='Casting', MeshType='Mixed')#
Extracts the midmesh of an input geometry.
- Parameters:
collection (Collection) – The collection containing the input geometry entities. Valid entities are solids, surfaces, components and elements.
CombineNonManifoldEdgesDistance (double) – If two non-manifold/sharp edges are in proximity with another edge within the distance given for this argument, they will be merged together at the mid-location.
CombineNonManifoldEdgesFactor (double) –
Triggers the same option as
CombineNonManifoldEdgesDistance, but the distance is expressed as a factor ofMinimumSize.A value of
CombineNonManifoldEdgesFactor=1.0means theCombineNonManifoldEdgesDistanceis same asMinimumSize. A value ofCombineNonManifoldEdgesFactor=0.5means theCombineNonManifoldEdgesDistanceis half ofMinimumSize. Default valueDefeatureOpeningsFactor=0.5, with range [0.0, 1.0].DefeatureOpeningsFactor (double) –
Triggers the same option as
DefeatureOpeningsWidth, but the distance is expressed as a factor ofMinimumSize.A value of
DefeatureOpeningsFactor=1.0meansDefeatureOpeningsWidthis same asMinimumSize. A value ofDefeatureOpeningsFactor=0.5means theDefeatureOpeningsWidthis half ofMinimumSize. Default value :python:` DefeatureOpeningsFactor=0.5`, with range [0.0, 1.0].DefeatureOpeningsWidth (double) – If a hole/opening is of lesser width than the given value, it will be closed.
DefeatureRibsWidth (double) – If a rib’s width is lesser than the given value, it will be removed.
DefeatureRibsWidthFactor (double) –
Triggers the same option as
DefeatureRibsWidth, but the distance is expressed as a factor ofMinimumSize.A value of 1.0 means
DefeatureRibsWidthis same asMinimumSize. A value ofDefeatureRibsWidthFactor=0.5means theDefeatureOpeningsWidthis half ofMinimumSize. Default valueDefeatureRibsWidthFactor=0.5, with range [0.0, 1.0].DestinationComponent (hwString) –
Original - For each input geometry, the generated midmesh is organized back into the input components.
Original.# - For each input geometry, the generated midmeshes are organized into new “Orignal.#” components.
Current - All generated midmeshes go to the current component.
DestinationComponentName (hwString) – The prefix to be used for the new shell element components created for the output mesh. Default is
DestinationComponentName=Midmesh.ExtractionSize (double) – The size at which the midmesh is extracted. Default
ExtractionSize=2.0.FlattenConnections (int) –
Flag about the flattening of connections. Valid values are:
0 - The default Y shaped connections are retained (default)
1 - The output will be flattened at the connections. Y shaped connections are flattened to T-shape. Stepped geometry (One side continuous surface, and opposite side steps) will be captured as continuous surface there by deviating from middle.
IgnoreFlatEdges (int) –
Flag about removing flat bottom edges. Valid values are:
0 - No specific treatment done to remove flat bottom edges
1 - Flat bottom edges are not retained in the output
MidlineTrimFilletsFactor (double) –
If a fillet edge is in proximity with another fillet edge within the threshold distance calculated from this factor, a trim line is added in between these two fillet edges. The threshold distance is calculated as
MinimumSizetimesMidlineTrimFilletsFactor. The fillet edges then may undergo suppression based onSuppressProximityFilletsFactor.A value of
MidlineTrimFilletsFactor=1.0means the distance threshold used for trimming a mid-line for proximate fillet edges is same as theMinimumSize. A value ofMidlineTrimFilletsFactor=0.5means it is half of MinimumSize.Default
MidlineTrimFilletsFactor=0.5, with range [0.0, 1.0].MinimumSize (double) –
The value used for defeaturing the topology based on the factors
SupressProximityEdgesFactor,CombineNonManifoldEdgesFactorandDefeatureOpeningsFactor. It is recommended to set this value the same as the minimum allowable element length for your final target mesh.Default value is the value of
ExtractionSizeargument.StepOffsetMode (hwString) –
This option allows finer control of how stepped geometry (one side continuous surface, and opposite side steps) is captured. This option is valid only when
FlattenConnections=1. This option also deprecatesFlattenConnections=2. For the sake of backwards compatibility, ifFlattenConnections=2is defined,StepOffsetModeis ignored.Valid values are:
Automatic - Steps of different thickness across a common base surface are automatically offset to a uniform distance from the base surface (default).
MidEverywhere - Each step will be placed in the middle.
MidThinnest - All steps that share a common base are moved to the middle of the thinnest step.
MidThickest - All steps that share a common base are moved to the middle of the thickest step. This might place parts of the midmesh outside the solid.
SuppressProximityEdgesDistance (double) – If a manifold edge is in proximity with another edge within the distance given for this argument, it will be suppressed. Sharp edges are not considered for this operation. If the edge is a fillet edge, and a different value is given for
SuppressProximityFilletFactor, that value will be given priority.SuppressProximityEdgesFactor (double) –
Triggers the same option as
SuppressProximityEdgesDistance, but the distance is expressed as a factor ofMinimumSize.A value of
SuppressProximityEdgesFactor=1.0means theSuppressProximityEdgesDistanceis same asMinimumSize. A value ofSuppressProximityEdgesFactor=0.5means theSuppressProximityEdgesDistanceis half ofMinimumSize.Default value
SuppressProximityEdgesFactor=0.5, with range [0.0, 1.0].SuppressProximityFilletsFactor (double) –
If a fillet edge is in proximity with another fillet/non-manifold/sharp edge within the threshold distance calculated from this factor, it will be suppressed. The threshold distance is calculated as
MinimumSizetimesSuppressProximityFilletsFactor.A value of
SuppressProximityFilletsFactor=1.0means the distance threshold used for suppressing proximate fillet edges is same asMinimumSize. A value ofSuppressProximityFilletsFactor=0.5means it is half ofMinimumSize.Default value
SuppressProximityFilletsFactor=0.5, with range [0.0, 1.0].TargetElementSize (double) –
This value is used for fine tuning certain internal computations to go well with the expectations according to the final target element size. It affects the suppression of flat edges, and edges in proximity.
Default value is the value of
ExtractionSizeargument.DestinationComponentPrefix (hwString) – Prepends the created midmesh components’ name with string value. (Default value “Midmesh_”)
DestinationPart (hwString) –
Current - All generated midmeshes go to the current part.
Original - All generated midmeshes go to the original part.
New - All generated midmeshes go to the new component under a new part hierarchy.
Method (hwString) –
The internal method used for midmesh extraction. Valid values are:
Casting (default)
Extrusion - Employs certain specific cleanup routines for extruded models.
MeshType (hwString) –
The type of the mesh. Valid values are:
tria
quad
mixed
R-tria
quadonly
Example#
Extract the midmesh of all solids present in the model with target element size as 2.0 with SuppressProximityEdgesFactor and CombineNonManifoldEdgesFactor as 0.5#import hm import hm.entities as ent model = hm.Model() solids_collection = hm.Collection(model, ent.Solid) model.midmesh_extract( collection=solids_collection, ExtractionSize=2.0, SuppressProximityEdgesFactor=0.5, CombineNonManifoldEdgesFactor=0.5, )