Files
modeling-app/docs/kcl/loft.md
Nick Cameron e8feb0309b Automatic fixing of deprecations and use non-quoted default planes by default (#5902)
* Automatic fixing of deprecations and use non-quoted default planes by default

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-21 09:39:12 +00:00

498 KiB

title, excerpt, layout
title excerpt layout
loft Create a 3D surface or solid by interpolating between two or more sketches. manual

Create a 3D surface or solid by interpolating between two or more sketches.

The sketches need to closed and on the same plane.

loft(
  sketches: [Sketch],
  vDegree: NonZeroU32,
  bezApproximateRational: bool,
  baseCurveIndex?: integer,
  tolerance?: number,
  tagStart?: TagDeclarator,
  tagEnd?: TagDeclarator,
): Solid

Arguments

Name Type Description Required
sketches [Sketch] Which sketches to loft. Must include at least 2 sketches. Yes
vDegree NonZeroU32 Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. Yes
bezApproximateRational bool Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. Yes
baseCurveIndex integer This can be set to override the automatically determined topological base curve, which is usually the first section encountered. No
tolerance number Tolerance for the loft operation. No
tagStart TagDeclarator A named tag for the face at the start of the loft, i.e. the original sketch No
tagEnd TagDeclarator A named tag for the face at the end of the loft, i.e. the last sketch No

Returns

Solid

Examples

// Loft a square and a triangle.
squareSketch = startSketchOn(XY)
  |> startProfileAt([-100, 200], %)
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

triangleSketch = startSketchOn(offsetPlane(XY, offset = 75))
  |> startProfileAt([0, 125], %)
  |> line(end = [-15, -30])
  |> line(end = [30, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

loft([squareSketch, triangleSketch])

Rendered example of loft 0

// Loft a square, a circle, and another circle.
squareSketch = startSketchOn(XY)
  |> startProfileAt([-100, 200], %)
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch0 = startSketchOn(offsetPlane(XY, offset = 75))
  |> circle(center = [0, 100], radius = 50)

circleSketch1 = startSketchOn(offsetPlane(XY, offset = 150))
  |> circle(center = [0, 100], radius = 20)

loft([
  squareSketch,
  circleSketch0,
  circleSketch1
])

Rendered example of loft 1

// Loft a square, a circle, and another circle with options.
squareSketch = startSketchOn(XY)
  |> startProfileAt([-100, 200], %)
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch0 = startSketchOn(offsetPlane(XY, offset = 75))
  |> circle(center = [0, 100], radius = 50)

circleSketch1 = startSketchOn(offsetPlane(XY, offset = 150))
  |> circle(center = [0, 100], radius = 20)

loft(
  [
    squareSketch,
    circleSketch0,
    circleSketch1
  ],
  baseCurveIndex = 0,
  bezApproximateRational = false,
  tolerance = 0.000001,
  vDegree = 2,
)

Rendered example of loft 2