Model.move_feature#
- Model.move_feature(collection, NumLayers=2, MappingMethod='auto', Rebuild=1, StitchBoundary=hwIntList(), TransformByMatrix=hwMatrix44(1.0), TransformByNodes=hwIntList())#
Moves a selection of elements and pastes them onto the displayed shell elements at the target location. The neighborhood of the pasted region will be remeshed. If the selected entities are connected to another mesh at the source, they are detached from them. Any holes left behind are patched and remeshed. Doesn’t allow moving elements associated to geometry.
- Parameters:
collection (Collection) – The collection containing the entities to copy. Valid entities are components and elements. The selection may consist of shell or solid elements. Any 1D elements attached to shell elements are automatically included.
NumLayers (int) – The number of layers to remesh. (default=2)
MappingMethod (hwString) –
The method in which the transformed feature’s stitch boundary is mapped on to the target mesh:
auto - Decides the best method among extend, morph and none based on the way the selected feature is connected to the target mesh.(default)
extend - The stitch boundary is extended till it meets the target mesh, or if it already crosses the target mesh, the extended part of the mesh is trimmed out. This is ideal for features that intersects sharply with the target mesh.
morph - The feature is morphed such that the stitch boundary conforms to the target mesh. This is ideal for features that meet the target mesh tangentially.
none - The transformed feature is kept as it is.
Rebuild (int) –
0 - Remesh using size and bias.
1 - Remesh using rebuild. (default)
StitchBoundary (hwIntList) –
The mesh edges that needs to be extended or trimmed from or morphed to the target mesh, and subsequently be stitched with the target mesh. In most cases the function can deduce which mesh edges are to be extended or morphed. But when it comes to features which already cross the target mesh this needs to supplied so that the function knows where to trim from.
This is a list of node IDs of the involved edges. It expects two node IDs per mesh edge. If there are N edges to be supplied, there should be 2N node IDs in this list. For example:
StitchBoundary=[node1_id, node2_id, node2_id, node3_id, node3_id, node4_id]TransformByMatrix (hwMatrix44) – The transformation specified as a 4x4 matrix.
TransformByNodes (hwIntList) – The transformation specified between two systems defined at source and target locations. The system at source is defined by three nodes sn1, sn2 and s3. The origin is defined by the node sn1. The x-axis is defined by the vector from sn1 to sn2. The x-y plane is defined as the plane containing all three nodes sn1, sn2 and sn3. Similarly, the system at target is defined by three nodes tn1, tn2 and tn3.
Example#
Move the elements with IDs 5100 - 5200 along the -y direction with a distance of 1 , and remeshe 2 layers with the rebuild algorithm#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements with IDs 5100-5200 filter_elements = hm.FilterByEnumeration(ent.Element, list(range(5100, 5201))) elements_collection = hm.Collection(model, filter_elements) model.move_feature( collection=elements_collection, NumLayers=2, MappingMethod="morph", Rebuild=1, TransformByMatrix=[0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], )