Model.morphsculptmesh3#
- Model.morphsculptmesh3(e_collection, s_collection, t_collection, n_collection, tool, t_vec, t_line_list, t_node_list, t_plane_normal, t_plane_base, xbase, ybase, zbase, tsize, offset, path, p_line_list, p_node_list, p_xyz, s_vec, push, remesh, solver, con, comp, mode)#
Sculpts the elements on the first collection according to the various parameters. Sculpting is treated as a morph and can be undone and redone.
Note that you must always create all collections, lists, vectors, and the plane before
Model.morphsculptmesh3(), even if they are not used. Make sure the vectors and the plane are non-zero.- Parameters:
e_collection (Collection) – The collection containing the element entities to be sculpted.
s_collection (Collection) – The collection containing the surface entities defining the sculpting tool (
tool=5).t_collection (Collection) – The collection containing the element entities defining the sculpting tool (
tool=6).n_collection (Collection) – The collection containing the fixed node entities. If using a finite element solver, the stretching of the mesh will occur between the nodes which are sculpted (from elements in
e_collection) and the fixed nodes.tool (int) –
Flag for sculpting tool. Valid values are:
0 - ball
1 - cone
2 - cylinder
3 - line from line list
4 - plane
5 - surfaces
6 - mesh
7 - line from nodes
t_vec (hwTriple) – The hwTriple object defining the vector components for the orientation vector for cylinder tool (
tool=2).t_line_list (EntityList) – The list of line entities for line tool (
tool=3).t_node_list (EntityList) – The list of node entities for node tool (
tool=3) and line sculpting tool (tool=7).t_plane_normal (hwTriple) – The hwTriple object defining the plane normal components of plane for plane tool (
tool=4). User can also supply a Python list of three doubles.t_plane_base (hwTriple) – The hwTriple object defining the base point components of the plane of plane for plane tool (
tool=4). User can also supply a Python list of three doubles.xbase (double) – X-coordinate of reference point for positioning line, surface, and mesh tools (
toolis 3, 5, and 6).ybase (double) – Y-coordinate of reference point for positioning line, surface, and mesh tools (
toolis 3, 5, and 6).zbase (double) – Z-coordinate of reference point for positioning line, surface, and mesh tools (
toolis 3, 5, and 6).tsize (double) –
Depending on the
toolmode, thetsizecan define:Radius for ball and cylinder tools
Angle for cone tool
Taper angle for line, surface, and mesh tools
offset (double) – Amount of offset for tool in sculpting direction.
path (int) –
0 - Along node list - smooth (using
p_node_list)1 - Along line list (using
p_line_listandp_node_list)2 - Along list of coordinates - smooth (using
p_xyzandp_nxyz)p_line_list (EntityList) – The list of line entities for path.
p_node_list (EntityList) – The list of node list for path.
p_xyz (hwDoubleList) – The list of doubles. The format for this alist is that the first three doubles are the x, y, and z coordinates of the first point along the path, the next three doubles are the xyz coordinates of the second point along the path, and so forth.
s_vec (hwTriple) – The hwTriple object defining the vector components for the vector for the sculpting direction.
push (int) –
0 - Pull
1 - Push
remesh (int) –
0 - Do not remesh
1 - Remesh (not supported)
2 - Interactive mode
3 - Interactive mode with remesh (not supported)
solver (int) –
0 - Use mesh compression to determine mesh stretching
1 - Use linear analysis to determine mesh stretching (Optistruct). Automatically generate properties and materials for the affected elements.
2 - Use nonlinear analysis to determine mesh stretching (Radioss). Automatically generate properties and materials for the affected elements.
3 - Use linear analysis (as 1 above) but use existing properties and materials
4 - Use nonlinear analysis (as 2 above) but use existing properties and materials
con (int) –
0 - Do not use constraints
1 - Use constraints
comp (double) –
0.0 - 1.0 - If using fractional compression, this is the maximum amount of mesh compression allowed per element (1.0 allows full compression and elements may become flat, 0.5 allows 50% compression).
> 0.0 - If using distance-based compression, this is the distance, in model units, from the tool through which all compression will be applied.
Not used when sculpting using a finite element solver.
mode (int) –
0 - Sculpt along vector using fractional compression
1 - Sculpt along vector using distance-based compression
2 - To sculpt normal to mesh using fractional compression
3 - To sculpt normal to mesh using distance-based compression
4 - To sculpt with smoothed normals using fractional compression
5 - To sculpt with smoothed normals using distance-based compression
6 - To sculpt with cfd corners for normals using fractional compression
7 - To sculpt with cfd corners for normals using distance-based compression
Note that sculpting normal to the mesh requires that shell elements be included in the affected elements. If solid elements are covered with a layer of shell elements then the solid elements will be sculpted as well.
Example#
Sculpt all elements use a ball of size 5.0 normal to the mesh use linear analysis and automatic properties#import hm import hm.entities as ent model = hm.Model() elems_collection = hm.Collection(model, ent.Element) surfs_sculpt_collection = hm.Collection(model, ent.Surface, populate=False) elems_sculpt_collection = hm.Collection(model, ent.Element, populate=False) nodes_fixed_collection = hm.Collection(model, ent.Node, [12, 13, 14, 15]) model.morphsculptmesh3( e_collection=elems_collection, s_collection=surfs_sculpt_collection, t_collection=elems_sculpt_collection, n_collection=nodes_fixed_collection, tool=0, t_vec=[1.0, 0.0, 0.0], t_line_list=ent.Line.getentitylist(), t_node_list=ent.Node.getentitylist(), t_plane_normal=[1.0, 0.0, 0.0], t_plane_base=[1.0, 0.0, 0.0], xbase=0.0, ybase=0.0, zbase=0.0, tsize=5.0, offset=0.0, path=1, p_line_list=[ent.Line(model, 12)], p_node_list=ent.Node.getentitylist(), p_xyz=None, s_vec=[16.9220, -3.7030, -25.1660], push=1, remesh=0, solver=1, con=1, comp=0, mode=2, )