Skip to content

Commit

Permalink
Update OCC build
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Nov 13, 2023
1 parent 0df40ae commit 262a979
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/jupytercad-extension/src/worker/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function shapeToThree(
while (expl.More()) {
const face = oc.TopoDS.Face_1(expl.Current());
const aLocation = new oc.TopLoc_Location_1();
const myT = oc.BRep_Tool.Triangulation(face, aLocation);
const myT = oc.BRep_Tool.Triangulation(face, aLocation, 0);
if (myT.IsNull()) {
console.error('Encountered Null Face!');
return;
Expand All @@ -87,7 +87,7 @@ export function shapeToThree(
number_of_triangles: 0
};
const pc = new oc.Poly_Connect_2(myT);
const nodes = myT.get().Nodes();
const nodes = myT.get().InternalNodes();

thisFace.vertex_coord = new Array(nodes.Length() * 3);
for (let i = 0; i < nodes.Length(); i++) {
Expand All @@ -105,7 +105,7 @@ export function shapeToThree(
VMin = 0,
VMax = 0;

const UVNodes = myT.get().UVNodes(),
const UVNodes = myT.get().InternalUVNodes(),
UVNodesLength = UVNodes.Length();
thisFace.uv_coord = new Array(UVNodesLength * 2);
for (let i = 0; i < UVNodesLength; i++) {
Expand Down
10 changes: 5 additions & 5 deletions packages/jupytercad-extension/src/worker/occapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function setShapePlacement(
)
);
const loc = new oc.TopLoc_Location_2(trsf);
shape.Location_2(loc);
shape.Location_2(loc, true);
return shape;
}

Expand Down Expand Up @@ -139,7 +139,7 @@ function _Cut(arg: ICut, content: IJCadContent): TopoDS_Shape | undefined {
if (base && tool) {
baseObject[0].visible = false;
toolObject[0].visible = false;
const operator = new oc.BRepAlgoAPI_Cut_3(base.occShape, tool.occShape);
const operator = new oc.BRepAlgoAPI_Cut_3(base.occShape, tool.occShape, new oc.Message_ProgressRange());
if (operator.IsDone()) {
return setShapePlacement(operator.Shape(), Placement);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ function _Fuse(arg: IFuse, content: IJCadContent): TopoDS_Shape | undefined {
}
}
});
const operator = new oc.BRepAlgoAPI_Fuse_3(occShapes[0], occShapes[1]);
const operator = new oc.BRepAlgoAPI_Fuse_3(occShapes[0], occShapes[1], new oc.Message_ProgressRange());
if (operator.IsDone()) {
return setShapePlacement(operator.Shape(), Placement);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ function _Intersection(
}
}
});
const operator = new oc.BRepAlgoAPI_Common_3(occShapes[0], occShapes[1]);
const operator = new oc.BRepAlgoAPI_Common_3(occShapes[0], occShapes[1], new oc.Message_ProgressRange());
if (operator.IsDone()) {
return setShapePlacement(operator.Shape(), Placement);
}
Expand Down Expand Up @@ -266,7 +266,7 @@ function _Extrude(
const mov = new oc.gp_Trsf_1();
mov.SetTranslation_1(dirVec.Multiplied(-LengthRev));
const loc = new oc.TopLoc_Location_2(mov);
baseCopy.Move(loc);
baseCopy.Move(loc, true);
}

if (Solid) {
Expand Down
8 changes: 4 additions & 4 deletions packages/jupytercad-extension/src/worker/occparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class OccParser {
while (expl.More()) {
const face = oc.TopoDS.Face_1(expl.Current());
const aLocation = new oc.TopLoc_Location_1();
const myT = oc.BRep_Tool.Triangulation(face, aLocation);
const myT = oc.BRep_Tool.Triangulation(face, aLocation, 0);
if (myT.IsNull()) {
console.error('Encountered Null Face!');
expl.Next();
Expand All @@ -130,7 +130,7 @@ export class OccParser {
numberOfTriangles: 0
};
const pc = new oc.Poly_Connect_2(myT);
const nodes = myT.get().Nodes();
const nodes = myT.get().InternalNodes();

thisFace.vertexCoord = new Array(nodes.Length() * 3);
for (let i = 0; i < nodes.Length(); i++) {
Expand Down Expand Up @@ -236,7 +236,7 @@ export class OccParser {
}
} else {
const aFace = oc.TopoDS.Face_1(edgeMap.FindFromIndex(iEdge).First_1());
const aPolyTria = oc.BRep_Tool.Triangulation(aFace, aLoc);
const aPolyTria = oc.BRep_Tool.Triangulation(aFace, aLoc, 0);
if (!aLoc.IsIdentity()) {
myTransf = aLoc.Transformation();
}
Expand All @@ -253,7 +253,7 @@ export class OccParser {
theEdge.vertexCoord = new Array(nbNodesInFace * 3);

const indices = aPoly.get().Nodes();
const nodeListOfFace = aPolyTria.get().Nodes();
const nodeListOfFace = aPolyTria.get().InternalNodes();

for (let jj = indices.Lower(); jj <= indices.Upper(); jj++) {
const v = nodeListOfFace.Value(indices.Value(jj));
Expand Down
2 changes: 1 addition & 1 deletion packages/jupytercad-opencascade/build_opencascade.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
const yaml = require('js-yaml');
const path = require('path');

const IMAGE_NAME = 'donalffons/opencascade.js:2.0.0-beta.371bbb0';
const IMAGE_NAME = 'donalffons/opencascade.js:2.0.0-beta.b5ff984';
const OPEN_CASCADE_DIR = 'lib';
const VERSION_FILE_NAME = 'jupytercad.opencascade.version';
const VERSION_FILE_PATH = path.join(OPEN_CASCADE_DIR, VERSION_FILE_NAME);
Expand Down

0 comments on commit 262a979

Please sign in to comment.