Skip to content

Commit 83a504a

Browse files
committed
Refactor nestWrapper to simplify parameters and remove unused distance handling
1 parent 71d0993 commit 83a504a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

libnest2d_js/libnest2d_js.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ std::vector<Point> jsArrayToPointVector(const emscripten::val& jsArray) {
6666
}
6767

6868
// Wrapper function for nest() to handle JavaScript arrays
69-
size_t nestWrapper(ItemList jsItems, const Box& bin, long distance = 1, const NfpConfig& config = NfpConfig()) {
69+
size_t nestWrapper(ItemList jsItems, const Box& bin) {
7070
// Convert JavaScript array to std::vector<Item>
7171
std::vector<Item> items;
7272
auto length = jsItems["length"].as<unsigned>();
@@ -77,14 +77,6 @@ size_t nestWrapper(ItemList jsItems, const Box& bin, long distance = 1, const Nf
7777
items.push_back(item);
7878
}
7979

80-
// Pre-process distance
81-
if (distance <= 0) {
82-
distance = 1;
83-
}
84-
// Create nest config
85-
NestConfig<> nestConfig(config);
86-
87-
// Call the nest function
8880
size_t result = nest(items, bin);
8981

9082
// Copy results back to original JavaScript items

0 commit comments

Comments
 (0)