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

Method fixShape

src/Base.cc:263–286  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

261// }
262//}
263bool 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
288NAN_METHOD(Base::fixShape)
289{

Callers 1

NAN_METHODFunction · 0.45

Calls 3

ShapeMethod · 0.80
InitMethod · 0.45
setShapeMethod · 0.45

Tested by

no test coverage detected