Model.surfacecreateruled#
- Model.surfacecreateruled(line_list, link_coords_array, guide_collection_set, ruled_type, options, comp_mode)#
Creates surfaces by interpolating linearly or smoothly between input lines. Optionally, a list of linking points and/or guiding lines can be provided for better interpolation and shape control. The input lines should be given in the correct order, grouped into ‘levels’ of the ruled surface. For example, referring to the image below, the input line list should first include 3 lines at level 1, then 3 lines at level 2, and then the line at level 3.
- Parameters:
line_list (EntityList) – A list containing the line entity objects as input.
link_coords_array (hwDoubleList) –
The list of x, y, and z coordinates for the optional points which are to be linked by an edge in the ruled surface(s). Link points should be given in pair or points, since each link between input lines is specified by its two end points. When these points are given, the final ruled surfaces include a surface edge that connects these points. Because of that, the pair of points must not skip levels. For instance, in the image below, you cannot skip level 2 by connecting a point at level 1 with a point at level 3. If such a skip is detected, the corresponding pair of points is ignored. One point may be linked to multiple points at a level above or below it, which results in creation of ‘triangular’ surfaces.
guide_collection_set (CollectionSet) – The set of collections containing possibly multiple type of entities.
ruled_type (int) –
0 - Smooth interpoloation
1 - Linear interpoloation
options (int) –
Flags that indicate different modes for surface creation.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3). Valid Bit options are:
Bit0
Merge or split surfaces at shared input lines. Valid values are:
0 - Merge surfaces at shared input lines
1 - Split surfaces at shared input lines
Bit1
Create open-ended or closed ring ruled surfaces. Valid values are:
0 - Create open-ended ruled surfaces
1 - Create a closed ring ruled surfaces
Bit2
Create surfaces stiched to solids. Valid values are:
0 - Do not create surfaces stitched to solids
1 - Create surfaces stitched to solids
Bit3 Allow stiching across components. Valid values are:
0 - Allow stitching across components
1 - Do not allow stitching across components
Show Bit value calculator
Radio Button Table Option Name Value Merge or split surfaces at shared input lines (Bit0) Create open-ended or closed ring ruled surfaces (Bit1) Create surfaces stiched to solids (Bit2) Allow stiching across components (Bit3) Calculated argument value: 0 comp_mode (int) –
0 - Surfaces are created in the current component
1 - Surfaces are created in the same component as the selected lines. The result is not predictable if the lines are originally in different components.
Examples#
Refer to the images above , to create linear ruled surfaces between lines with IDs 56 , 52 , 53 , 58 , 57 , 59 and 51 , without use any guide lines or linked points#import hm import hm.entities as ent model = hm.Model() line1 = ent.Line(model, 56) line2 = ent.Line(model, 52) line3 = ent.Line(model, 53) line4 = ent.Line(model, 58) line5 = ent.Line(model, 57) line6 = ent.Line(model, 59) line7 = ent.Line(model, 51) collection_set = hm.CollectionSet(model) model.surfacecreateruled( line_list=[line1, line2, line3, line4, line5, line6, line7], link_coords_array=None, guide_collection_set=collection_set, ruled_type=1, options=0, comp_mode=0, )
Create smooth ruled surfaces interpolate lines with IDs 56 , 52 , 53 , 58 , 57 , 59 and 51 with the following conditions : ruled surface will be in the input lines component ; split at the input lines ; links point P1 = ( 2.3 , 4.5 , 6.0 ) and point P2 = ( 12.3 , 2.25 , 36.30 ) , use the guide line with ID 44#import hm import hm.entities as ent model = hm.Model() line1 = ent.Line(model, 56) line2 = ent.Line(model, 52) line3 = ent.Line(model, 53) line4 = ent.Line(model, 58) line5 = ent.Line(model, 57) line6 = ent.Line(model, 59) line7 = ent.Line(model, 51) line_collection = hm.Collection(model, ent.Line, [44]) collection_set = hm.CollectionSet(model) collection_set.set(line_collection) model.surfacecreateruled( line_list=[line1, line2, line3, line4, line5, line6, line7], link_coords_array=[2.3, 4.5, 6.0, 12.3, 2.25, 36.30], guide_collection_set=collection_set, ruled_type=0, options=3, comp_mode=1, )

