@bitbybit-dev/occt
Version:
Bit By Bit Developers CAD algorithms using OpenCascade Technology kernel. Run in Node and in Browser.
44 lines (43 loc) • 1.42 kB
JavaScript
export class OCCReferencedReturns {
constructor(occ) {
this.occ = occ;
}
/**
* Get edge parameter bounds using the new BRep_Tool_GetEdgeParameters helper.
* This replaces the old BRep_Tool.Range_1 pattern.
*/
BRep_Tool_Range_1(edge, p1, p2) {
const result = this.occ.BRep_Tool_GetEdgeParameters(edge);
if (result.IsValid) {
p1.current = result.First;
p2.current = result.Last;
}
}
/**
* Get edge curve using the new GetEdgeCurve helper.
* This replaces the old BRep_Tool.Curve_2 pattern.
*/
BRep_Tool_Curve_2(edge, p1, p2) {
const result = this.occ.BRep_Tool_GetEdgeParameters(edge);
if (result.IsValid) {
p1.current = result.First;
p2.current = result.Last;
// Use the GetEdgeCurve helper to get the actual curve
return this.occ.GetEdgeCurve(edge);
}
return null;
}
/**
* Get face UV bounds using the new GetFaceUVBounds helper.
* This replaces the old BRepTools.UVBounds_1 pattern.
*/
BRepTools_UVBounds_1(face, uMin, uMax, vMin, vMax) {
const result = this.occ.GetFaceUVBounds(face);
if (result.IsValid) {
uMin.current = result.UMin;
uMax.current = result.UMax;
vMin.current = result.VMin;
vMax.current = result.VMax;
}
}
}