Skip to main content

Chamfer

Chamfer bevels edges with a flat cut — the angled transition machinists put on every edge a hand or a part will meet.

In the viewport

  1. Click Chamfer on the toolbar. A small panel opens beside the model.
  2. Click the edges to bevel. Ctrl / Shift adds edges, a double-click takes the whole bucket an edge belongs to, and a right-click opens the multi-select menu (tangent chain, same-type edges, the feature's buckets such as Extrude End Edges, Select other).
  3. Type the distance and click Apply.
The Chamfer panel with four edges picked and a distance of 3
  1. 1
    Selection
    The edges to bevel. The count beside the label is how many you have picked; the ✕ on a chip drops that pick, and clicking a picked edge again drops it too.
  2. 2
    The chips
    One per edge, in pick order. A whole bucket of one feature is written as an accessor like e.endEdges(); anything else becomes a select() with an edge filter. Picking a face instead bevels every edge of that face.
  3. 3
    Chamfer type
    Equal distance cuts the same amount on both faces. Two distances takes one value per face, and Distance + angle takes a distance and the angle to cut it at.
  4. 4
    Distance
    How far back the bevel cuts, measured on the face. A number, an expression, or a parameter name.
  5. 5
    Apply
    Writes the statement and adds the timeline row; Exit writes nothing.

From sharp to bevelled

BeforeBefore modeextrude(30)

A 100 × 60 × 30 plate straight out of the extrude, every edge sharp.

AfterAfter modechamfer(3, …)

A 3 × 3 flat cut around the four top edges — the bevel a machinist would break the edge with.

The plate
box.part.js
import { sketch, extrude, line } from 'fluidcad/core';
import { coincident, distance, fix, horizontal, vertical } from "fluidcad/constraints";

// The plate before any bevelling: every edge is sharp.
sketch("xy", () => {
const sg1 = line([-50, -30], [50, -30]);
const sg2 = line([50, -30], [50, 30]);
const sg3 = line([50, 30], [-50, 30]);
const sg4 = line([-50, 30], [-50, -30]);
coincident(sg1.end(), sg2.start());
coincident(sg2.end(), sg3.start());
coincident(sg3.end(), sg4.start());
coincident(sg4.end(), sg1.start());
horizontal(sg1);
vertical(sg2);
horizontal(sg3);
vertical(sg4);
fix(sg1.start(), [-50, -30]);
distance(sg1.start(), sg1.end(), 100);
distance(sg2.start(), sg2.end(), 60);
})

const e = extrude(30)
The complete file
import { sketch, extrude, chamfer } from 'fluidcad/core';
import { line } from 'fluidcad/core';
import { coincident, distance, fix, horizontal, vertical } from "fluidcad/constraints";

sketch("xy", () => {
// Four lines drawn at their intended positions — the coordinates are
// guesses the constraints below turn into an exact 100 x 60 rectangle.
const sg1 = line([-50, -30], [50, -30]);
const sg2 = line([50, -30], [50, 30]);
const sg3 = line([50, 30], [-50, 30]);
const sg4 = line([-50, 30], [-50, -30]);
// Coincident joins the corners into a closed loop
coincident(sg1.end(), sg2.start());
coincident(sg2.end(), sg3.start());
coincident(sg3.end(), sg4.start());
coincident(sg4.end(), sg1.start());
// Horizontal / vertical square the sides up
horizontal(sg1);
vertical(sg2);
horizontal(sg3);
vertical(sg4);
// Fix pins one corner so the profile cannot slide; the two distances
// set the width and height. The sketch is now fully constrained.
fix(sg1.start(), [-50, -30]);
distance(sg1.start(), sg1.end(), 100);
distance(sg2.start(), sg2.end(), 60);
})

// The plate to bevel.
const e = extrude(30)
// A 3 x 3 chamfer on the four top edges.
chamfer(3, e.endEdges())

Asymmetric chamfer

Two distances give an uneven bevel — the first is measured on one face, the second on the other:

Asymmetric chamfer

The code behind it
import { sketch, extrude, chamfer } from 'fluidcad/core';
import { line } from 'fluidcad/core';
import { coincident, distance, fix, horizontal, vertical } from "fluidcad/constraints";

sketch("xy", () => {
const sg1 = line([-50, -30], [50, -30]);
const sg2 = line([50, -30], [50, 30]);
const sg3 = line([50, 30], [-50, 30]);
const sg4 = line([-50, 30], [-50, -30]);
coincident(sg1.end(), sg2.start());
coincident(sg2.end(), sg3.start());
coincident(sg3.end(), sg4.start());
coincident(sg4.end(), sg1.start());
horizontal(sg1);
vertical(sg2);
horizontal(sg3);
vertical(sg4);
fix(sg1.start(), [-50, -30]);
distance(sg1.start(), sg1.end(), 100);
distance(sg2.start(), sg2.end(), 60);
})

const e = extrude(30)
chamfer(3, 5, e.endEdges())

Targeting edges in code

Same conventions as fillet: pass edges after the distance, or chamfer the last selection:

// Direct
chamfer(2, e.sideEdges())

// With select
import { select } from 'fluidcad/core';
import { edge } from 'fluidcad/filters';

select(edge().onPlane("xy", 30))
chamfer(4)

Several edge selections at once:

chamfer(2, e.endEdges(), e.sideEdges())