@@ -435,14 +435,18 @@ def rotate_elements(element_id_list: list[ElementId], origin: point_3d, rotation
435435 """
436436
437437def subtract_elements (hard_elements : list [ElementId ], soft_elements : list [ElementId ]) -> list [ElementId ]:
438- """Subtracts a list of "soft" elements from a list of "hard" elements.
438+ """Subtracts the volume of `hard_elements` from `soft_elements` (boolean
439+ difference). Soft elements are cut in place and keep their IDs.
439440
440441 Parameters:
441- hard_elements: The list of "hard" elements.
442- soft_elements: The list of "soft" elements.
442+ hard_elements (list[ElementId]): The cutter elements. Not modified.
443+ soft_elements (list[ElementId]): The elements to be cut. Modified
444+ in place.
443445
444446 Returns:
445- The list of resulting elements.
447+ list[ElementId]: Additional element IDs produced when a soft
448+ element is split into multiple disconnected pieces by the
449+ subtraction. Does not include the IDs from `soft_elements`.
446450 """
447451
448452def check_element_id (element_id : ElementId ) -> bool :
@@ -1179,15 +1183,19 @@ def add_elements_to_detail(element_id_list: list[ElementId], detail: int) -> Non
11791183 """
11801184
11811185def subtract_elements_with_undo (hard_element_id_list : list [ElementId ], soft_element_id_list : list [ElementId ], with_undo : bool ) -> list [ElementId ]:
1182- """Subtracts a list of "soft" elements from a list of "hard" elements with undo functionality.
1186+ """Subtracts the volume of `hard_elements` from `soft_elements` (boolean difference)
1187+ with undo functionality. Soft elements are cut in place and keep their IDs.
11831188
11841189 Parameters:
1185- hard_element_id_list: The list of "hard" elements.
1186- soft_element_id_list: The list of "soft" elements.
1187- with_undo: Indicate whether the operation should be added to the undo stack.
1190+ hard_element_id_list (list[ElementId]): The cutter elements. Not modified.
1191+ soft_element_id_list (list[ElementId]): The elements to be cut. Modified
1192+ in place.
1193+ with_undo (bool): Indicate whether the operation should be added to the undo stack.
11881194
11891195 Returns:
1190- The list of elements resulting from the subtraction.
1196+ list[ElementId]: Additional element IDs produced when a soft
1197+ element is split into multiple disconnected pieces by the
1198+ subtraction. Does not include the IDs from `soft_elements`.
11911199 """
11921200
11931201def create_linear_optimization (element_id_list : list [ElementId ], optimization_number : int , total_length : float , start_cut : float , end_cut : float , saw_kerf : float , is_production_list : bool ) -> ElementId :
0 commit comments