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

Method _boolean

src/ShapeFactory.cc:1022–1045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020
1021
1022void ShapeFactory::_boolean(_NAN_METHOD_ARGS, BOPAlgo_Operation op) {
1023
1024 if (!IsInstanceOf<Solid>(info[0]) || !IsInstanceOf<Solid>(info[1])) {
1025 return Nan::ThrowError("Wrong arguments for boolean operation : expecting two solids");
1026 }
1027
1028 Solid* pSolid1 = Nan::ObjectWrap::Unwrap<Solid>(Nan::To<v8::Object>(info[0]).ToLocalChecked());
1029
1030 Solid* pSolid2 = Nan::ObjectWrap::Unwrap<Solid>(Nan::To<v8::Object>(info[1]).ToLocalChecked());
1031 /*
1032 std::vector<Solid*> other_solids;
1033 for (int i=1; i<info.Length(); i++) {
1034 if(Solid::constructor->HasInstance(info[i])) {
1035 Solid* pSolid2 = Nan::ObjectWrap::Unwrap<Solid>(Nan::To<v8::Object>(info[i]);
1036 other_solids.push_back(pSolid2);
1037 }
1038 }
1039 Handle<Object> compound = ShapeFactory::add(other_solids);
1040 Solid* pSolid2 = Nan::ObjectWrap::Unwrap<Solid>(compound);
1041 */
1042
1043 return ShapeFactory_createBoolean(info, pSolid1, pSolid2, op);
1044
1045}
1046
1047NAN_METHOD(ShapeFactory::fuse)
1048{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected