Skip to main content

Intersect

Intersect makes the curve where two sets of faces meet: the section of a body cut by a face, or the seam between two surfaces. The faces stay as they are; the result is a curve to sweep along, to set a plane on, or to measure.

In the viewport​

  1. Open the Curves menu on the toolbar and click Intersect. The dialog opens with the First row armed (blue border).
  2. Click the faces of the first side. A click on a face takes that face, of a solid or of a surface; a surface that is a single face, such as an extruded line, is taken whole, as its row in the timeline takes any surface. Once First holds a pick, Second is armed.
  3. Click the faces of the other side. As soon as both rows hold a pick, the curve previews in blue.
  4. Click Apply. The timeline gains an Intersection Curve row and the statement is written to the file.
The Intersect dialog with a face picked in each row
  1. 1
    First
    The first set of faces. Each row takes several picks: faces of solids and of surfaces, and whole surfaces. Click a chip’s ✕ to drop it; click a picked face again to take it back off.
  2. 2
    Second
    The faces the first set is cut with. Click a row to arm it before picking for it; the armed row wears the blue border.
  3. 3
    Apply
    Writes intersect(first, second). Both rows need a pick. Exit closes the dialog without writing anything.

If the two sides do not cross, the dialog says so instead of drawing a preview: faces that only touch along an edge, or lie on top of each other, have no intersection curve.

A pipe standing through the sloped face of a block, with the pipe's wall in First and the slope in Second:

The ellipse where a pipe crosses a chamfer

The code behind it

The dialog names a picked face with a selector of its own; any face selection works in its place, as the slope's does here.

pipe.part.js
import { sketch, extrude, chamfer, select, circle, intersect } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';
import { edge, face } from 'fluidcad/filters';

// A block with its top edge on the +X side chamfered: the chamfer is a flat
// face sloping at 45°.
sketch('xy', () => {
rect([0, 0], 60, 40).centered();
});
const block = extrude(30);
chamfer(20, select(edge().onPlane(block.endFaces()).farthest('x')));

// A pipe standing up through the slope, kept as a body of its own (.new()):
// the curve is taken between two bodies, not cut into one.
sketch('xy', () => {
circle([20, 0], 16);
});
const pipe = extrude(50).new();

// The curve where the pipe's wall crosses the slope — an ellipse. The first
// argument is the wall; the second the sloped face, named here by the way
// it faces (up and out along +X). Neither body changes.
const seam = intersect(pipe.sideFaces(), select(face().facing([1, 0, 1], 10)));

Picking several faces at once​

  • Double-click a face: the row takes the whole group the face belongs to, such as every side face of an extrude.
  • Right-click a face: a menu lists the groups it belongs to, such as its tangent faces, the faces of its kind connected to it and the faces of the feature that made it. Hover an item to preview it; click it to add those faces to the armed row.

Both work on the faces of a solid and of a surface of several faces. A surface that is a single face is taken whole by a click already.

Editing​

Double-click the Intersection Curve row in the timeline. The view rolls back to just before the statement and the dialog reopens with each row on its argument as written, as Current: … chips, and the faces they name lit up. Pick in a row to change it. Where the row names faces or surfaces, the first pick adds to them and a chip's ✕ takes one off; anything else in the row (a plane(), an expression) is replaced by the pick. Apply rewrites only the row you changed; the other argument is written back exactly as it was.

What it is for​

The curve is construction geometry. A sweep along it adds material where the two sides meet, here a bead round the foot of the pipe. The sweep hides the curve, which later statements can still read.

A bead swept along the curve where the pipe meets the slope

The code behind it
pipe.part.js
import { sketch, extrude, chamfer, select, circle, intersect, plane, sweep } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';
import { edge, face } from 'fluidcad/filters';

sketch('xy', () => {
rect([0, 0], 60, 40).centered();
});
const block = extrude(30);
chamfer(20, select(edge().onPlane(block.endFaces()).farthest('x')));

sketch('xy', () => {
circle([20, 0], 16);
});
const pipe = extrude(50).new();

const seam = intersect(pipe.sideFaces(), select(face().facing([1, 0, 1], 10)));

// A Ø4 circle on a plane square to the curve at its start...
const bead = sketch(plane(seam.edges(0), 'start'), () => {
circle([0, 0], 4);
});
// ...swept once around it: a bead where the pipe meets the slope. The sweep
// hides the curve, which later statements can still read.
sweep(seam, bead).new();

In code​

import { intersect } from 'fluidcad/core';

const ic = intersect(first, second);
ArgumentTakes
firstA face selection (faces of solids or of surfaces), a surface, a solid (all its faces), or a list of those: intersect([a, b], c)
secondThe same, or one plane() on its own, taken as infinite

Written outside a sketch, intersect is this tool. Inside a sketch() callback it is the sketch tool that sections the sketch plane: see Intersect in a sketch.

A plane as the second argument​

A plane() cuts as far as the faces go, whatever size its quad is drawn at. The dialog does not pick planes yet: write the plane in code. Editing such a statement from the timeline keeps the plane as written while you change the first row.

A cylinder's wall cut by a tilted plane

The code behind it
tube.part.js
import { sketch, circle, extrude, intersect, plane } from 'fluidcad/core';

sketch('xy', () => {
circle([0, 0], 40);
});
const body = extrude(60);

// A plane() as the second argument is taken as infinite: the cut runs all
// the way round the wall, whatever size the plane's quad is drawn at. A
// plane can only be the second argument, on its own.
const ic = intersect(body.sideFaces(), plane('xy', { offset: 30, rotateX: 30 }));

One curve per chain​

The result holds one curve for each connected run of intersection edges. A plane through a cylinder's wall gives one closed curve; a rod passing through a pipe gives two, one where it enters and one where it leaves; two surfaces that cross and end give an open curve whose ends lie on their rims. Each is a curve of its own in the Shapes panel, Curve 1, Curve 2 and so on, and a dialog that takes curves picks it on its own: see Picking a curve.

ic.edges() // every edge, curve after curve, each in the order it runs
ic.edges(0) // one edge
ic.start() // where the first curve starts
ic.end() // where it ends

The order does not depend on the kernel: curves come by the face of the first argument each starts on, then by their start point, so ic.edges(1) names the same edge after an upstream dimension changes.

A cut that is a circle or an ellipse reads as one to the edge filters (edge().circle()), even where the kernel stores it as a spline.

Errors​

SituationMessage
The two sides only touch, along an edge or tangentially, or lie on each otherintersect: the two selections do not cross.
A face is in both argumentsintersect: the <kind> face at (x, y, z) is in both selections.
An argument holds edges, a curve or a sketchintersect: the first selection is an edge selection; it needs faces.
A plane() as the first argument, or inside a listintersect: a plane can only be the second argument, given on its own.
The curves branch, as where two equal cylinders crossintersect: the intersection branches at (x, y, z): 4 of its edges meet there.
Fewer than two arguments outside a sketchintersect: outside a sketch, give the two sets of faces to intersect: intersect(first, second).

Limitations​

  • Datum planes (the origin planes, plane() quads) cannot be picked in the dialog; write them in code.
  • A sweep along a closed curve that does not lie in a plane, such as the saddle where two pipes cross, can fail in the sweep. A curve that lies in a plane, like the ellipses above, and an open curve sweep.

See also​