Model.solidcreatedragsurfalongline#
- Model.solidcreatedragsurfalongline(surfs_collection, lines_list, method, options, comp_mode, node_entity, ref_plane_normal, ref_plane_base)#
Creates one or more solids by dragging one ore more surfaces along a drag line. Lines in the line list are combined into a single line L, called the drag line. The direction of the drag line is determined by choosing its start point, S, as the closest end of the line to the input surface vertices.
The arguments
node_entity,ref_plane_normalandref_plane_basedetermine how the input lines and surfaces are transformed before drag.The reconfiguration of the geometries before the drag is done as follows. Let P be the point referred by the
node_entity, N be the normal and B be theref_plane_baseof theref_plane_normaland T be the tangent vector of drag line at S. First, input surfaces are translated by the direction vector PB. If Bit4 of the options is not set, the surfaces are rotated by the rotation from vector N to vector T. Also, the drag line is translated by the direction vector SB. The drag is applied to these surfaces by line L. So, if P is selected on an input surface, the new location of P is going to be at B. Moreover, if P is one of the vertex points of the input surfaces, one gets an exact geometric copy of the drag line at B, no matter which drag method is chosen. This is because, prior to drag, P is moved to B and B moves on drag line since it coincides with the start point of the drag line L.If
node_entityis not given, it is chosen as the same point as S, the start of the drag line. This means, with the default value ofnode_entity, the drag line is not transformed.If the reference plane is not given, their default values are B at P and N=T. This means, with the default value of transformation plane, the input surfaces are not transformed prior to drag.
Note
The location of P is not important, if fixed frame method is chosen with no transformation plane, since each point on the section surface traces an exact geometric copy of the drag line in fixed frame method.
- Parameters:
surfs_collection (Collection) – The collection containing the surface entities to drag.
lines_list (EntityList) –
A list containing the line entity objects that will be used to form the drag lines.
The first line in this list determines the direction of the drag, which is also shown to the user on the screen. If the drag line has corners, then the new solids are split at those locations.
method (int) –
Parameter specifying the method of how the drag is performed. Valid options are:
0 - Fixed frame.
1 - Follow the drag line only along its tangent direction.
2 - Follow the drag line along its Frenet frame.
options (int) –
Flags that indicate different modes for the drag.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4). Valid Bit options are:
Bit0
Offset both free and internal edges of surfaces. Valid values are:
0 - Only free edges of surfaces are offset.
1 - Both free and internal edges are offset, thus creating separate solids from surfaces separated by manifold edges.
Bit1
Create only boundary surfaces. Valid values are:
0 - Create solid entities.
1 - Create only the boundary of solids.
Bit2 Drag along the opposite direction of the drag line. Valid values are:
0 - Drag along the direction of the drag line.
1 - Drag along the opposite direction of the drag line.
Bit3
Use the deafult values of the reference plane. Valid values are:
0 - Use the
ref_plane_normalandref_plane_base.1 - Do not use the
ref_plane_normalandref_plane_base. Instead, use its default values.Bit4
Use only the base point of the reference plane for transformation. Valid values are:
0 - Use the whole
ref_plane_normalandref_plane_basefor transformation if it is given.1 - Use only the base point of the reference plane, set the normal as the tangent of the drag line at drag start point.
Show Bit value calculator
Radio Button Table Option Name Value Offset both free and internal edges of surfaces (Bit0) Create only boundary surfaces (Bit1) Drag along the opposite direction of the drag line (Bit2) Use the default values of the reference plane inputs (Bit3) Use only the base point of the reference plane for transformation (Bit4) Calculated argument value: 0 comp_mode (int) –
Parameter specifying how entities are organized into components:
0 - Solids are created in the current component and boundary surfaces are moved to the same component.
1 - Solids are created in the current component, but surfaces remain in their original component.
2 - Solids are created in the same component as the selected surfaces. The result is not predictable, if the surfaces are originally in different components.
node_entity (Entity) – The object describing the node entity which is used as a reference point while determining the way the surfaces are transformed prior to drag. This is an optional argument and in cases that should not be uses a
Nonevalue should be provided.ref_plane_normal (hwTriple) – The hwTriple object defining the plane normal components to determine the initial reference frame. User can also supply a Python list of three doubles. This is an optional argument and in cases that should not be uses a
Nonevalue should be provided.ref_plane_base (hwTriple) – The hwTriple object defining the base point components of the plane to determine the initial reference frame. User can also supply a Python list of three doubles. This is an optional argument and in cases that should not be uses a
Nonevalue should be provided.
Examples#
Assume that you want to drag section - surfaces with IDs 39 401 and 388, along the line that is formed by combine lines with IDs 37 and 25 use fixed frame method. Assume that you want to drag along the direction opposite to the direction of line with ID 37, and want to drag both free and internal edges. Moreover, you want the results solids to be in the component of the surfaces. Then ,options = 1 + 4 = 5, andcomp_mode = 2. If you do not want to use any reference plane, use the follow functions to create dragged solids. As a result one side of the solids will be the input section surfaces, while the opposite side will be an exact translated copy of that section surface, and vertices of the section surface will trace an exact translated copy of the drag-lines broken at possible vertex points#import hm import hm.entities as ent model = hm.Model() model.solidcreatedragsurfalongline( surfs_collection=hm.Collection(model, ent.Surface, [39, 401, 388]), lines_list=[ent.Line(model, 37), ent.Line(model, 25)], method=0, options=5, comp_mode=2, node_entity=None, ref_plane_normal=None, ref_plane_base=None, )
Assume that you want to drag section - surfaces with IDs 39 401 and 388, along the line that is formed by combine lines with IDs 37 and 25 use fixed frame method. Assume that you want to drag along the direction opposite to the direction of line with ID 37 , and want to drag both free and internal edges. Moreover, you want the results solids to be in the component of the surfaces. Then,options = 1 + 4 = 5, andcomp_mode = 2. If you do not want to use any reference plane, use the follow functions to create dragged solids . As a result one side of the solids will be the input section surfaces, while the opposite side will be an exact translated copy of that section surface, and vertices of the section surface will trace an exact translated copy of the drag-lines broken at possible vertex points. In addition, in this example if you now want to use a reference node with ID 12, which happens to lie on one of the section surfaces, and a reference plane. The solid created will be in such a way that the new location of the point on which node with ID 12 located, will be at the base point (2678.0 -737.7 548.1) of the reference plane.#import hm import hm.entities as ent model = hm.Model() model.solidcreatedragsurfalongline( surfs_collection=hm.Collection(model, ent.Surface, [39, 401, 388]), lines_list=[ent.Line(model, 37), ent.Line(model, 25)], method=0, options=5, comp_mode=2, node_entity=None, ref_plane_normal=[1.0, 1.0, 1.0], ref_plane_base=[2678.0, -737.7, 548.1], )