void Shape::ApplyWorkplane(Handle json) { Local workplane = json->Get(String::New("workplane"))->ToObject(); if (!workplane->IsNull()) { Local workplane_origin = workplane->Get(String::New("origin"))->ToObject(); double x = ReadDouble(workplane_origin,"x"); double y = ReadDouble(workplane_origin,"y"); double z = ReadDouble(workplane_origin,"z"); Local workplan
| 261 | // } |
| 262 | //} |
| 263 | bool Base::fixShape() |
| 264 | { |
| 265 | |
| 266 | if (this->shape().IsNull()) { |
| 267 | return false; |
| 268 | } |
| 269 | BRepCheck_Analyzer aChecker(this->shape()); |
| 270 | if (!aChecker.IsValid()) { |
| 271 | ShapeFix_ShapeTolerance aSFT; |
| 272 | aSFT.LimitTolerance(this->shape(),Precision::Confusion(),Precision::Confusion()); |
| 273 | |
| 274 | occHandle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(this->shape()); |
| 275 | aSfs->SetPrecision(Precision::Confusion()); |
| 276 | aSfs->Perform(); |
| 277 | const TopoDS_Shape aShape = aSfs->Shape(); |
| 278 | aChecker.Init(aShape, Standard_False); |
| 279 | |
| 280 | if (aChecker.IsValid() /* && this->canSetShape(aShape) */) { |
| 281 | this->setShape(aShape); |
| 282 | } |
| 283 | } |
| 284 | return aChecker.IsValid() ? true : false; |
| 285 | |
| 286 | } |
| 287 | |
| 288 | NAN_METHOD(Base::fixShape) |
| 289 | { |
no test coverage detected