@bitbybit-dev/occt
Version:
Bit By Bit Developers CAD algorithms using OpenCascade Technology kernel. Run in Node and in Browser.
29 lines (28 loc) • 922 B
JavaScript
export class OCCTShapeFix {
constructor(occ, och) {
this.occ = occ;
this.och = och;
}
fixEdgeOrientationsAlongWire(inputs) {
return this.och.edgesService.fixEdgeOrientationsAlongWire(inputs);
}
basicShapeRepair(inputs) {
const shapeFix = new this.occ.ShapeFix_Shape();
shapeFix.Init(inputs.shape);
shapeFix.SetPrecision(inputs.precision);
shapeFix.SetMaxTolerance(inputs.maxTolerance);
shapeFix.SetMinTolerance(inputs.minTolerance);
shapeFix.Perform();
const result = shapeFix.Shape();
shapeFix.delete();
return result;
}
fixSmallEdgeOnWire(inputs) {
const wireFix = new this.occ.ShapeFix_Wire();
wireFix.Load(inputs.shape);
wireFix.FixSmall(inputs.lockvtx, inputs.precsmall);
wireFix.Perform();
const result = wireFix.Wire();
return result;
}
}