Skip to content

Commit

Permalink
Add support for holes in makeFace
Browse files Browse the repository at this point in the history
  • Loading branch information
sgenoud committed Jan 8, 2024
1 parent 4a4532b commit 2c8bc6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/replicad/src/shapeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,12 @@ export const assembleWire = (listOfEdges: (Edge | Wire)[]): Wire => {
return wire;
};

export const makeFace = (wire: Wire): Face => {
export const makeFace = (wire: Wire, holes?: Wire[]): Face => {
const oc = getOC();
const faceBuilder = new oc.BRepBuilderAPI_MakeFace_15(wire.wrapped, false);
holes?.forEach((hole) => {
faceBuilder.Add(hole.wrapped);
});
if (!faceBuilder.IsDone()) {
faceBuilder.delete();
throw new Error("Failed to build the face. Your wire might be non planar.");
Expand Down

0 comments on commit 2c8bc6a

Please sign in to comment.