| 176 | } |
| 177 | |
| 178 | v8::Local<v8::Object> Face::createMesh(double factor, double angle, bool qualityNormals) |
| 179 | { |
| 180 | Nan::EscapableHandleScope scope; |
| 181 | const unsigned argc = 0; |
| 182 | v8::Local<v8::Value> argv[1] = { }; |
| 183 | |
| 184 | v8::Local<v8::Object> theMesh = makeInstance(Mesh::_template); |
| 185 | |
| 186 | Mesh *mesh = Mesh::Unwrap<Mesh>(theMesh); |
| 187 | |
| 188 | const TopoDS_Shape& shape = this->shape(); |
| 189 | |
| 190 | try { |
| 191 | |
| 192 | TopLoc_Location loc; |
| 193 | occHandle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation(this->face(), loc); |
| 194 | if (triangulation.IsNull()) { |
| 195 | BRepMesh_IncrementalMesh MSH(shape,factor,Standard_True,angle,Standard_True); |
| 196 | } |
| 197 | |
| 198 | |
| 199 | // this code assume that the triangulation has been created |
| 200 | // on the parent object |
| 201 | mesh->extractFaceMesh(this->face(), qualityNormals); |
| 202 | mesh->optimize(); |
| 203 | |
| 204 | } CATCH_AND_RETHROW_NO_RETURN("Failed to mesh solid "); |
| 205 | return scope.Escape(theMesh); |
| 206 | } |
| 207 | |
| 208 | |
| 209 | void Face::InitNew(_NAN_METHOD_ARGS) |
no test coverage detected