Model.linecreateoffsetalongcurvature#
- Model.linecreateoffsetalongcurvature(line_list, start_offset, end_offset, link_type, flags)#
Creates a line by offsetting the input lines in
line_listalong their curvature direction. The input lines must form a connected line; otherwise an error is given. The first line in theline_listdetermines the direction of the combined line, hence the start point, from which the offsetting starts. If the opposite direction for the combined line is desired, the corresponding value of the flags must be set.If the offset value is negative, the direction opposite to curvature direction is used for offset.
In the case where there is a discontinuity in the curvature direction at some point between the input lines, a link is inserted if
link_typeis chosen to be 2. However, if the change in the curvature direction is 180 degrees, then no link is inserted and the offset continues without any jump. In this case, after the discontinuity point, the offset follows the opposite direction of the curvature direction.- Parameters:
line_list (EntityList) – The entity list of lines to be offset. Input lines must form a connected line when combined.
start_offset (double) – The offset distance at the start of the combined line.
end_offset (double) – The offset distance at the end of the combined line.
link_type (int) –
The type of link that is inserted between offset lines in the case where there is a discontinuity (other that 180 degrees) in the direction of the curvature. Valid values are:
0 - The offset direction is interpolated on both sides of the discontinuity to allow a smooth transition. In this case, along the interpolation region, the offset direction is going to be different than the curvature direction. Amplified fluctuations, which would occur in the offset because of little ripples in the input curve, are smoothed out with this option.
1 - A straight line segment is inserted as a link between offset of input lines, if there is a jump in offset direction at points where input lines meet.
2 - No link is inserted, if there is a jump in offset direction at points where input lines meet. In this case, the offset lines might become disconnected.
flags (int) –
Flags that indicate different modes for the offset.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2). Valid Bit options are:
Bit0
Delete original lines after drag. Valid values are:
0 - Keep original lines after drag.
1 - Delete original lines after drag. Applies only to free lines (not surface edges).
Bit1
The direction of the combined line compared to the direction of the first line in the
line_list. Valid values are:0 - The direction of the combined line is the same as the direction of the first line in the
line_list.1 - The direction of the combined line is opposite to the direction of the first line in the
line_list.Bit2
Specifies how line entities are organized into components. Valid values are:
0 - Line is created in the current component, which is the default value.
1 - Line is created in the most common input lines component.
Show Bit value calculator
Radio Button Table Option Name Value Delete original lines after drag (Bit0) The direction of the combined line compared to the direction of the first line in the line_list (Bit1) Specifies how line entities are organized into components (Bit2) Calculated argument value: 0
Example#
Create an offset line by drag lines with IDs 4 and 5 by an amount of 3.2 units at start and 5.0 at end#import hm import hm.entities as ent model = hm.Model() model.linecreateoffsetalongcurvature( line_list=[ent.Line(model, 4), ent.Line(model, 5)], start_offset=3.2, end_offset=5.0, link_type=0, flags=0, )