kcl →
loft
Create a 3D surface or solid by interpolating between two or more sketches.
The sketches need to closed and on the same plane.
loft(sketch_groups: [SketchGroup], data?: LoftData) -> ExtrudeGroup
Examples
// Loft a square and a triangle.
const squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const triangleSketch = startSketchOn(offsetPlane('XY', 75))
|> startProfileAt([0, 125], %)
|> line([-15, -30], %)
|> line([30, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
loft([squareSketch, triangleSketch])
// Loft a square, a circle, and another circle.
const squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle([0, 100], 50, %)
const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|> circle([0, 100], 20, %)
loft([
squareSketch,
circleSketch0,
circleSketch1
])
// Loft a square, a circle, and another circle with options.
const squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle([0, 100], 50, %)
const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|> circle([0, 100], 20, %)
loft([
squareSketch,
circleSketch0,
circleSketch1
], {
// This can be set to override the automatically determined
// topological base curve, which is usually the first section encountered.
baseCurveIndex: 0,
// 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.
bezApproximateRational: false,
// Tolerance for the loft operation.
tolerance: 0.000001,
// 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.
vDegree: 2
})
Arguments
sketch_groups
:[SketchGroup]
(REQUIRED)data
:LoftData
- Data for a loft. (OPTIONAL)
{
// This can be set to override the automatically determined topological base curve, which is usually the first section encountered.
baseCurveIndex: number,
// 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.
bezApproximateRational: bool,
// Tolerance for the loft operation.
tolerance: number,
// 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.
vDegree: number,
}
Returns
ExtrudeGroup
- An extrude group is a collection of extrude surfaces.
{
// Chamfers or fillets on this extrude group.
edgeCuts: [{
// The engine id of the edge to fillet.
edgeId: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edgeId: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The id of the extrusion end cap
endCapId: uuid,
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the plane’s X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the plane’s Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// Chamfers or fillets on this extrude group.
edgeCuts: [{
// The engine id of the edge to fillet.
edgeId: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edgeId: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The id of the extrusion end cap
endCapId: uuid,
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the face’s X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the face’s Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// Tag identifiers that have been declared in this sketch group.
tags: {
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: bool,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: bool,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}],
}