Skip to main content

Delete face

Delete face takes faces off a solid or a surface. What becomes of the gap they leave is its mode:

  • Heal, the default: the faces around the gap grow until they close it. A fillet, a chamfer, a hole, a boss or a pocket goes as if it had never been built, and the history before it stays as it is.
  • Cap: each opening is closed by one new face through its rim.
  • Leave open: nothing takes the faces' place. A solid becomes a surface.

The body is changed in place, as a fillet changes it: the statement that made it still names it, and later statements read the body without the faces.

In the viewport​

  1. Open the Surfaces menu on the toolbar and click Delete face. The Delete face dialog opens with the Faces row armed (blue border).
  2. Click the faces to delete. A click takes that face, of a solid or of a surface. To take a whole feature, right-click one of its faces and add one of its groups, or double-click it (see What a click takes).
  3. Choose a Mode: Heal, Cap or Leave open. The line under the tabs says what the chosen one does. As soon as the row holds a face, the preview paints the faces to delete in red, with the caps in green for Cap and the rim left open drawn for Leave open.
  4. Click Apply. The timeline gains a Delete Face row.
The Delete face dialog with the side and the top of a round boss picked and Heal chosen
  1. 1
    Faces
    The faces to delete. Takes several picks, faces of solids and of surfaces; never a whole body. Click a chip’s ✕ to drop it.
  2. 2
    Mode
    What becomes of the gap: Heal grows the faces around it to close it, Cap closes each opening with a new face, Leave open leaves it open.
  3. 3
    Apply
    Writes deleteFace(...faces), with .mode('cap') or .mode('open') for those modes. Exit closes the dialog without writing anything.
  4. 4
    Statement
    The statement Apply will write, updated as you pick.

Faces selected before you click Delete face fill the Faces row. The selection goes in whole or not at all: with an edge or a vertex among it, the row opens empty.

Heal​

Heal needs the whole feature: every face of the fillet, the hole or the boss. The faces around it are grown until they meet, and they only meet once nothing of the feature is left between them. With part of a feature selected, a boss's side without its top, say, they cannot meet and nothing is removed.

In the viewport, a single click takes a single face. Click one face of the feature, then right-click it: the menu lists its groups, such as its tangent faces (all the faces of a fillet) or the faces of the feature that made it, and a click adds one to the row. A double-click takes the face's whole group at once. A hole is one wall face, so a click on it is enough.

A plate with a round boss and a hole, the boss's side and top picked:

BeforeBefore mode

A 60 × 40 plate with a boss of diameter 20 and a hole of diameter 12.

AfterAfter modedeleteFace(boss.sideFaces(), boss.endFaces())

The boss is gone: the plate's top grows back over where it stood. The hole, not selected, stays.

The code behind it

The dialog names faces of a solid with selectors, here the boss's sideFaces() and endFaces(), and gives the boss's statement a variable if it has none. It names the statement Delete Face n.

plate.part.js
import { sketch, extrude, circle, plane, cut, deleteFace } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';

// A 60 x 40 plate, 8 thick.
sketch('xy', () => {
rect([0, 0], 60, 40);
});
extrude(8);

// A round boss on top of it, diameter 20 and 10 high.
sketch(plane('xy', 8), () => {
circle([20, 20], 20);
});
const boss = extrude(10);

// A hole of diameter 12 through the plate.
sketch(plane('xy', 8), () => {
circle([45, 20], 12);
});
cut();

// Heal, the default: the boss's side and its top, the whole of it, taken
// away. The plate's top grows back over the place it stood on; the hole,
// which is not selected, stays.
deleteFace(boss.sideFaces(), boss.endFaces());

When the faces cannot be healed, the dialog says why in orange beside the preview, which still shows the faces in red. Apply writes nothing while it shows. Add the missing faces, or choose another mode, and it goes:

The Delete face dialog with only the side of the boss picked under Heal, and an orange message saying the neighbouring faces cannot be extended to close the gap

A face whose neighbours never meet, such as one flat side of a box, has nothing to heal into. Use Cap or Leave open for it, or remove() the whole body. Heal works on solids only; on a surface, use Leave open.

Cap​

Each opening the faces leave is closed by one new face through its rim. Where the rim is flat, the face lies in its plane; where it is not, a surface is fitted to it. A body stays what it was: a solid stays a solid, a surface a surface.

A post with a domed top, the dome picked:

BeforeBefore mode

A post of radius 15 with a domed top, turned about Z.

AfterAfter modedeleteFace(post.sideFaces(face().sphere())).mode('cap')

The dome is gone and the post is closed by a flat face across its rim, painted red here.

The code behind it

capFaces() answers the new faces, one per opening. They are faces of their own: a cap is not merged into a flat face beside it.

post.part.js
import { sketch, line, arc, revolve, axis, deleteFace, color } from 'fluidcad/core';
import { face } from 'fluidcad/filters';

// A post of radius 15 with a domed top, turned about Z: a profile up the
// side, over the dome to the axis, and down the axis.
sketch('xz', () => {
line([0, 0], [15, 0]);
line([15, 0], [15, 20]);
arc([15, 20], [0, 28], [0, 9.9375]);
line([0, 28], [0, 0]);
});
const post = revolve(axis('z'));

// Cap: the dome taken away and its opening closed by one new face through
// the rim the dome left. The rim is a flat circle, so the cap is flat.
// capFaces() answers the new face: painted red here.
const flat = deleteFace(post.sideFaces(face().sphere())).mode('cap');
color('red', flat.capFaces());

A through hole's wall leaves two openings and gets two caps. A band of faces between two rims, such as a round fillet on a circular edge, leaves two rims that no single face closes, and is refused: heal it instead, or leave it open and close the gap with Fill.

Leave open​

Nothing replaces the faces. A solid becomes a surface of the faces left, one surface per connected set of them, with those faces exactly as they were. A surface loses the faces, and may fall into several surfaces.

A can, its top picked:

BeforeBefore mode

A can: a circle of diameter 40 extruded 30.

AfterAfter modedeleteFace(can.endFaces()).mode('open')

A surface of the wall and the bottom, open at the top.

The code behind it

boundaryEdges() answers the rim: every edge of the result that bordered a deleted face.

can.part.js
import { sketch, extrude, circle, deleteFace } from 'fluidcad/core';

// A can: a circle of diameter 40 extruded 30.
sketch('xy', () => {
circle([0, 0], 40);
});
const can = extrude(30);

// Leave open: the top taken away and nothing put in its place. The can is
// now a surface of its wall and its bottom, open at the top;
// opened.boundaryEdges() answers the rim.
const opened = deleteFace(can.endFaces()).mode('open');

Back to a solid​

Leave open is how a solid is opened to be worked on as a surface. Fill closes it again: fill the rim the deleted faces left, and the fill joins the opened body, which has no opening left and becomes a solid.

const opened = deleteFace(box.endFaces()).mode('open');
fill(opened.boundaryEdges()); // the box again: one solid

The new top need not be the face it replaces: a guide point domes it, and on a round opening, such as the top of the can above, Tangent continuity makes it a dome that flows out of the wall.

For a hollow part, keep the lid apart with .new() and thicken the opened body and the lid in one statement. A box this time, its top replaced by a dome:

A box closed again by a domed lid, thickened 1 toward the inside

The code behind it

fill(opened.boundaryEdges()) makes the lid on the rim the top left, rising to the point with .guides(…); without it the lid is flat. .new() keeps the lid a surface of its own: without it the lid would join the opened box into a solid, and there would be no surface left to thicken. thicken(-1, [opened, lid]) thickens each of the two on its own, then adds the solids together: one solid, closed again.

box.part.js
import { sketch, extrude, plane, point, deleteFace, fill, thicken } from 'fluidcad/core';
import { fix } from 'fluidcad/constraints';
import { rect } from 'fluidcad/shapes';

// A 40 x 20 box, 10 high.
sketch('xy', () => {
rect([0, 0], 40, 20);
});
const box = extrude(10);

// A point 8 above the middle of its top, for the lid to rise to.
const marks = sketch(plane('xy', 18), () => {
const p = point([20, 10]);
fix(p, [20, 10]);
return { p };
});

// Open the top, fill the rim with a lid domed up to the point, and thicken
// the two 1 toward the inside. .new() keeps the lid a surface of its own;
// without it the lid would join the opened box into a solid, with nothing
// left to thicken. Each is thickened on its own, then the two solids are
// added together: inward they overlap along the rim and fuse into one, a
// closed box again. Outward (a positive thickness) they would only touch
// along the rim, and thicken refuses them.
const opened = deleteFace(box.endFaces()).mode('open');
const lid = fill(opened.boundaryEdges()).guides(marks.geometries.p).new();
thicken(-1, [opened, lid]);

The thickness is negative, toward the inside. The opened box's faces still point out of it, as the solid's did, and the lid faces out as they do. The walls and the lid meet at a sharp edge, the rim: thickened inward, the walls grow into the box and the lid down into it, and the two overlap along the rim and fuse. Thickened outward, the walls grow out and the lid up, and their solids only touch along the rim, which makes no one solid: thicken refuses them (thickened outward they only touch along it). In the Thicken dialog the refusal shows in orange beside the preview, which still draws the two, and Apply writes nothing until you change the sign. See Several surfaces.

In the viewport, open Fill, right-click an edge of the rim and add Boundary Loop. Join closes the box into a solid; choose New for a lid to thicken. The dialog writes the rim as the edges of the extrude, fill(box.endEdges()), which are the same four edges as opened.boundaryEdges(): the lid is the same either way, facing out of the box as its walls do.

What a click takes​

You clickThe row takesWritten as
A face of a solidThat faceA selector, such as boss.sideFaces()
A face of a surfaceThat face, also when the surface is a single faceA selector, such as s.sideFaces(1)
A group from the right-click menu, or a double-clickEvery face of the groupThe faces' selectors
The timeline row of a body, solid or surfaceNothing: Box 1 is not a face — pick faces in the viewport.

A body is never taken whole: deleting all its faces would leave nothing, and is refused. To delete a body, remove() it.

Editing​

Double-click the Delete Face row in the timeline. The view rolls back to just before the statement and the dialog reopens: one chip per face argument, as written, and the Mode as written. A statement that names no faces, and so deletes the select(…) written before it, opens on a Current: last selection chip, the selection lit in the viewport.

A chip's ✕ takes an argument off and a pick adds one after the others; the arguments you leave are written back exactly as they were. Apply rewrites only what you changed: on deleteFace(box.endFaces()).mode('open'), choosing Cap changes .mode('open') to .mode('cap') and nothing else, and choosing Heal takes .mode(…) out. The preview and its messages work as when you create one: a mode that cannot be built says why, and Apply holds. A statement written in a form the dialog cannot hold opens no dialog: a message says why, and you edit it in the source.

In code​

import { deleteFace } from 'fluidcad/core';

deleteFace(boss.sideFaces(), boss.endFaces()); // heal: the boss taken away
deleteFace(select(face().cylinder(12))); // heal: a hole, by a filter
deleteFace(post.sideFaces(face().sphere())).mode('cap'); // the dome closed flat
deleteFace(can.endFaces()).mode('open'); // the can as a surface, open at the top
ArgumentTakes
...facesFaces of solids or of surfaces: selections (select(face()…)), accessors such as e.endFaces(), or lists of those. With none, the select(…) written just before. The faces may belong to several bodies; each body is treated on its own.
Chained methodMeaning
.mode('heal' | 'cap' | 'open')What becomes of the gap. 'heal' is the default and is not written.

A filter picks a whole feature in one go: face().cylinder(12) a hole's wall, face().notPlanar() the fillets of a block.

The result answers what it made:

AccessorHolds
capFaces()The new faces, one per opening, in 'cap' mode; nothing otherwise.
boundaryEdges()The rim, in 'open' mode: every edge of the result that bordered a deleted face; nothing otherwise.

Faces and edges that stay are still those of the feature that made them: after deleteFace(e.endFaces()).mode('open'), e.sideFaces() names the surface's walls. See deleteFace in the API reference.

Errors​

A refusal shows in the dialog in orange beside the preview, and on the row in the timeline:

SituationMessage
Heal cannot close the gap: part of a feature, or a face whose neighbours never meetdeleteFace: the neighbouring faces cannot be extended to close the gap (the selected face, around (20, 5, 5), could not be removed). With several faces it says how many could not be removed and where. Select the whole feature, or use Cap or Leave open.
Heal on a surfacedeleteFace: healing needs a solid. Use Leave open.
No face fits an openingdeleteFace: could not fit a face to the opening (…). Use Leave open and close the rim with Fill, or select fewer faces.
Cap on a band between two rims, such as a round filletdeleteFace: the caps do not close the solid again. Heal it, or leave it open and close the gap with Fill or a loft.
Cap on faces of a surface that reach its edgedeleteFace: the faces reach the edge of the surface, so the gap they leave has no closed rim to cap.
Every face of a bodydeleteFace: that would remove all of the solid from line 4; use remove().
Edges, a sketch or a curvedeleteFace is an edge selection; it needs faces.
A selection that matches no facedeleteFace: the selection holds no faces.
No faces, and no select(…) before itdeleteFace: give the faces to delete.
A mode outside the threedeleteFace: .mode() takes 'heal', 'cap' or 'open'.

See also​

  • After: with Leave open, fill the gap with a new face, or thicken the surface it leaves
  • Selection & Filters: naming the faces to delete by their neighbours