Model.solid_split_by_tool#
- Model.solid_split_by_tool(solid_collection, tool_type, line_collection=Collection(), plane_base=hwTriple(0.0, 0.0, 0.0), plane_normal=hwTriple(0.0, 0.0, 0.0), split_positions=hwDoubleList(), surf_collection=Collection(), sweep_direction=hwTriple(0.0, 0.0, 0.0), sweep_distance=0.0, extend_trimmer=0)#
Splits solid geometry using various tool types.
- Parameters:
solid_collection (Collection) – The collection containing the solid entities to split.
tool_type (hwString) –
Specifies the tool used to split the solids. Valid values are:
bounding_lines - Input lines are used to construct surfaces, which are used to split solids.
plane - An infinite plane is used to split solids.
surfaces - Surfaces are used for splitting.
sweep_lines - Lines are swept in a direction, either to cover all the solids or for a given distance to form surfaces, which are then used to split solids.
line_collection (Collection) – The collection containing the input line entities, when
tool_type="bounding_lines"ortool_type="sweep_lines".plane_base (hwTriple) – The plane base coordinates when
tool_type="plane".plane_normal (hwTriple) – The hwTriple object defining the plane normal components. User can also supply a Python list of three doubles.
split_positions (hwDoubleList) – When
tool_type="plane"or whenextend_trimmer=1, the trimmer might cut the solids at several sections. This optionally specifies the sections to use for trimming, by giving a point location on each section.surf_collection (Collection) – The collection containing the trimming surface entities, when
tool_type="surfaces".sweep_direction (hwTriple) – The sweep direction vector coordinates when
tool_type="sweep_lines".sweep_distance (double) – The optional limited sweep distance when
tool_type="sweep_lines".extend_trimmer (unsigned int) –
Specifies the behavior of extending the trimming surface when
tool_type="bounding_lines",tool_type="surfaces", ortool_type="sweep_lines". Valid values are:0 - Do not extend.
1 - Extend. (default)
Examples#
Split the solid with ID 2 with the line with ID 574 , by sweep the line in the z-direction and then extend the result surface to trim the whole solid#import hm import hm.entities as ent model = hm.Model() model.solid_split_by_tool( solid_collection=hm.Collection(model, ent.Solid, [2]), tool_type="sweep_lines", line_collection=hm.Collection(model, ent.Line, [574]), sweep_direction=[0.0, 0.0, 1.0], extend_trimmer=1, )
Split the solid with ID 2 with a surface that is first formed by the lines with IDs 32 and 37 , and then extended to cover the whole solid#import hm import hm.entities as ent model = hm.Model() model.solid_split_by_tool( solid_collection=hm.Collection(model, ent.Solid, [2]), tool_type="bounding_lines", line_collection=hm.Collection(model, ent.Line, [32, 37]), extend_trimmer=1, )
Split the solid with ID 2 with a surface that is first formed by the lines with IDs 32 and 37 , at 2 sections that are located at points (0.4, -0.8, 0.0) and (0.5, -0.1, -0.7) , and then extended to cover the whole solid#import hm import hm.entities as ent model = hm.Model() model.solid_split_by_tool( solid_collection=hm.Collection(model, ent.Solid, [2]), tool_type="bounding_lines", line_collection=hm.Collection(model, ent.Line, [32, 37]), extend_trimmer=1, split_positions=[0.4, -0.8, 0.0, 0.5, -0.01, -0.07], )