MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / extractListOfFaces

Function extractListOfFaces

src/ShapeFactory.cc:1064–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062
1063
1064bool 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
1092NAN_METHOD(ShapeFactory::makeThickSolid)

Callers 1

NAN_METHODFunction · 0.85

Calls 1

extractArgFunction · 0.85

Tested by

no test coverage detected