| 1062 | |
| 1063 | |
| 1064 | bool extractListOfFaces(v8::Local<v8::Value> value, TopTools_ListOfShape& faces) |
| 1065 | { |
| 1066 | if (value->IsArray()) { |
| 1067 | v8::Local<v8::Array> arr = v8::Local<v8::Array>::Cast(value); |
| 1068 | int length = arr->Length(); |
| 1069 | for (int i = 0; i < length; i++) { |
| 1070 | |
| 1071 | auto elementI = Nan::Get(arr,i).ToLocalChecked(); |
| 1072 | Face* pFace = 0; |
| 1073 | if (extractArg(elementI, pFace)) { |
| 1074 | faces.Append(pFace->face()); |
| 1075 | } |
| 1076 | } |
| 1077 | } |
| 1078 | else { |
| 1079 | // could be a single face |
| 1080 | Face* pFace = 0; |
| 1081 | if (!extractArg(value, pFace)) { |
| 1082 | return false; |
| 1083 | } |
| 1084 | faces.Append(pFace->face()); |
| 1085 | } |
| 1086 | |
| 1087 | |
| 1088 | return faces.Extent() > 0; |
| 1089 | } |
| 1090 | |
| 1091 | |
| 1092 | NAN_METHOD(ShapeFactory::makeThickSolid) |
no test coverage detected