Closed rsm-gh closed 1 month ago
This pull request updates the read_step_file
function in DataExchange.py
to consistently return a list of shapes when as_compound=True
, regardless of the number of shapes found in the STEP file. The change ensures that the function's behavior is more consistent and predictable.
classDiagram
class DataExchange {
+read_step_file(filename, as_compound=True, verbosity=True)
}
class step_reader {
+Shape(int)
+IsNull()
}
class list_of_shapes_to_compound {
+list_of_shapes_to_compound(shapes)
}
DataExchange --> step_reader : uses
DataExchange --> list_of_shapes_to_compound : uses
Change | Details | Files |
---|---|---|
Modify the handling of single shape case to return a list |
|
src/Extend/DataExchange.py |
Simplify the control flow of the function |
|
src/Extend/DataExchange.py |
I included this commit because it makes more sens to always respect the same type of object, but actually when there is only 1 shape, I do not see much difference between the compound and the shape, so I guess that's why you removed it from newer versions (at 7.5 the code seems OK)
When using as_compound=True, the method was returning a shape instead of a compound, if there was only 1 shape to convert.
Summary by Sourcery
Correct the return behavior of the read_step_file function to ensure it returns a list of shapes when as_compound is True, even if there is only one shape.
Bug Fixes: