CAD 二维形状
25 个节点
本页内容 25
形状面积
函数A shape's area, in square model units.
形状面积(形状: Cad Shape) -> 数字
double Area(CadShape shape)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — |
返回
| 结果 | 数字 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状包围盒
函数The box round a shape, flat at Z = 0.
形状包围盒(形状: Cad Shape) -> Bounding Box
BoundingBox Bounds(CadShape shape)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — |
返回
| 结果 | Bounding Box |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
圆
函数A disk centred on the origin, an exact circle; or, given three or more segments, OpenSCAD's regular polygon of that many corners on the circle, the first on +X: circle(r, $fn = segments).
圆(半径: 数字, 分段数: 整数) -> Cad Shape
CadShape Circle(double radius, int segments = 0)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 半径 | 数字 | — | Its radius: the corners' distance from the middle when it has segments. |
| 分段数 | 整数 | 0 | Zero for an exact circle, or the number of a polygon's corners (at least three). |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状差集
函数A shape with every cutter taken away, OpenSCAD's difference() of 2D children: the first child less the others.
形状差集 -> Cad Shape
形状: Cad Shape
切除形状: Cad Shape 数组
容差: 数字CadShape Difference(
CadShape shape,
CadShape[] cutters,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | What is cut. |
| 切除形状 | Cad Shape 数组 | — | What cuts it. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
填充孔洞
函数A shape without its holes, OpenSCAD's fill(): each region's outer boundary filled, islands in former holes merged in.
填充孔洞(形状: Cad Shape, 容差: 数字) -> Cad Shape
CadShape Fill(CadShape shape, double tolerance = 1E-06)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
OpenSCAD 分段数
函数How many segments OpenSCAD cuts a circle of a radius into, from its special variables: $fn when it is set, else as many as keep each segment's angle at least Minimum Angle and its length at least Minimum Size, and never fewer than five. Give the count to Cad2D.Circle, Cad.Frustum and the other round operations to reproduce a model that relies on OpenSCAD's facets; leave it out for exact circles.
OpenSCAD 分段数 -> 整数
半径: 数字
$fn: 整数
最小角度 $fa: 数字
最小长度 $fs: 数字int Fragments(
double radius,
int fn = 0,
double minimumAngle = 0.20943951023931953,
double minimumSize = 2)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 半径 | 数字 | — | The circle's radius. |
| $fn | 整数 | 0 | OpenSCAD's $fn: zero when not set. |
| 最小角度 $fa | 数字 | 0.20943951023931953 | OpenSCAD's $fa, in radians: 12° unless set. |
| 最小长度 $fs | 数字 | 2 | OpenSCAD's $fs, in model units: 2 unless set. |
返回
| 结果 | 整数 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
由曲线生成形状
函数The shape closed curves in the XY plane enclose: even-odd by default, as polygon paths are, so curves inside others are holes; nonzero reads which way each curve runs, as font outlines and most SVG paths do; any fills everything inside any curve.
由曲线生成形状 -> Cad Shape
边界: Curve 数组
填充规则: Curve Fill Rule
容差: 数字CadShape FromCurves(
Curve[] boundaries,
CurveFillRule fill = CurveFillRule.EvenOdd,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 边界 | Curve 数组 | — | Closed curves lying in the XY plane. |
| 填充规则 | Curve Fill Rule | Even odd | Which points they enclose. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
由区域生成形状
函数The shape of planar regions in the XY plane - what CadCurves.BooleanRegions and CadText.Regions give - merged where they overlap.
由区域生成形状(区域: Curve Region 数组, 容差: 数字) -> Cad Shape
CadShape FromRegions(
CurveRegion[] regions,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 区域 | Curve Region 数组 | — | The regions, each an outer boundary with holes. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状凸包
函数The convex hull of flat shapes, OpenSCAD's hull() of 2D children: the smallest convex shape holding them all. Exact for lines and arcs - the hull of circles is their arcs and the lines tangent to two of them - and within the tolerance for other curves, which are first followed by tangent arcs.
形状凸包(形状: Cad Shape 数组, 容差: 数字) -> Cad Shape
CadShape Hull(CadShape[] shapes, double tolerance = 1E-06)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape 数组 | — | The shapes. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
备注
Built by turning a direction once round and following, for each, the piece of the shapes furthest along it: a corner, or a stretch of an arc whose outward normal it is; where the furthest piece changes, the hull runs straight from one to the next along the line touching both.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
平面点的凸包
函数The convex hull of points in the XY plane, as a flat shape; their Z is ignored. Fewer than three points not in a line hold no area and give an empty shape.
平面点的凸包(点: Point3d 数组, 容差: 数字) -> Cad Shape
CadShape HullOfPoints(
Point3d[] points,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 点 | Point3d 数组 | — | The points. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状交集
函数What every shape has in common, OpenSCAD's intersection() of 2D children. An empty list gives an empty shape.
形状交集(形状: Cad Shape 数组, 容差: 数字) -> Cad Shape
CadShape Intersection(
CadShape[] shapes,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape 数组 | — | The shapes. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状闵可夫斯基和
函数The Minkowski sum of flat shapes, OpenSCAD's minkowski() of 2D children: every point of one added to every point of the next. Exact where one of two shapes is a circle (the other offset by its radius, as OpenSCAD's rounded rectangle is), or one is made of lines and the other is convex; otherwise the shapes' arcs are followed by lines within the tolerance first.
形状闵可夫斯基和(形状: Cad Shape 数组, 容差: 数字) -> Cad Shape
CadShape Minkowski(CadShape[] shapes, double tolerance = 1E-06)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape 数组 | — | The shapes, summed in turn. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
备注
A shape of lines A plus a convex shape B is A moved by a point of B together with, for each line of A's boundary, the hull of B at its two ends; a shape of lines that is not convex is cut into trapezoids, which are.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
镜像形状
函数A shape mirrored in the line through the origin square to a direction, OpenSCAD's mirror([x, y]): (1, 0) mirrors left to right.
镜像形状 -> Cad Shape
形状: Cad Shape
法向 X: 数字
法向 Y: 数字CadShape Mirror(CadShape shape, double normalX, double normalY)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 法向 X | 数字 | — | The mirror line's normal, along X. |
| 法向 Y | 数字 | — | The mirror line's normal, along Y. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
圆角偏移
函数A shape grown or shrunk by a distance with round corners, OpenSCAD's offset(r): growing, every point within the radius of the shape joins it (its Minkowski sum with a disk); shrinking, every point within the radius of its outside leaves it. Boundaries of lines and arcs give exact lines and arcs; other curves are first followed within the tolerance by tangent-continuous arcs.
圆角偏移(形状: Cad Shape, 半径: 数字, 容差: 数字) -> Cad Shape
CadShape Offset(
CadShape shape,
double radius,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 半径 | 数字 | — | How far, in model units: positive grows, negative shrinks. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
备注
Every boundary is offset whole, exactly: each line and arc moved out (or in) by the distance - an arc tighter than that through its middle and out the other side - with an arc round each corner. Those curves hold every edge of the result but may cross themselves and each other; the plane they cut up is kept face by face where a point inside the face is in the shape or within the distance of it (growing), or in the shape and no nearer its edge than the distance (shrinking). Narrow gaps close and thin parts vanish as they should.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
尖角偏移
函数A shape grown or shrunk by a distance with sharp corners, OpenSCAD's offset(delta, chamfer): every boundary moves out (or in) square to itself, and corners are carried out to where the moved sides meet, or with Chamfer cut straight across. Sides of lines and arcs stay exact; at a corner of an arc the moved sides are met along their tangents.
尖角偏移 -> Cad Shape
形状: Cad Shape
距离: 数字
倒角: 真否
容差: 数字CadShape OffsetDelta(
CadShape shape,
double delta,
bool chamfer = false,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 距离 | 数字 | — | How far, in model units: positive grows, negative shrinks. |
| 倒角 | 真否 | False | Cut the corners across rather than carrying them to a point. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
备注
Every boundary is offset whole, its corners carried out (or cut) on the side the offset opens and joined straight across where the offset sides cross; the plane those curves cut up is kept face by face where they wind round it positively, as Clipper fills a mitred offset, so the loops a concave corner throws out of a growing shape, and the reversed ones of a shrinking shape's vanished parts, are left out.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状轮廓
函数Copies of every boundary of a shape: each region's outer boundary, then its holes.
形状轮廓(形状: Cad Shape) -> Curve 数组
Curve[] Outlines(CadShape shape)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — |
返回
| 结果 | Curve 数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
多边形
函数A polygon through points, OpenSCAD's polygon(points, paths): with no paths, one boundary through every point in order; with paths, one boundary through each list of point indices. The boundaries are filled even-odd, so a path inside another is a hole, and one inside that an island, whichever way each runs; a boundary that crosses itself fills alternately.
多边形 -> Cad Shape
点: Point3d 数组
路径: 整数数组数组
容差: 数字CadShape Polygon(
Point3d[] points,
int[][] paths,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 点 | Point3d 数组 | — | The points; only X and Y are read. |
| 路径 | 整数数组数组 | — | Lists of indices into Points, one a boundary; null for one boundary through every point. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
调整形状尺寸
函数A shape scaled about the origin to a width and height, OpenSCAD's resize([x, y], auto): a size of zero keeps that direction as it is, or, with Auto, scales it by the largest factor of the sizes given, keeping the proportions.
调整形状尺寸 -> Cad Shape
形状: Cad Shape
宽度: 数字
高度: 数字
自动: 真否CadShape Resize(
CadShape shape,
double width,
double height,
bool auto = false)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 宽度 | 数字 | — | The new width along X; zero to leave it. |
| 高度 | 数字 | — | The new height along Y; zero to leave it. |
| 自动 | 真否 | False | Scale the directions given zero with the others. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
旋转形状
函数A shape turned about a point, counter-clockwise seen from +Z, OpenSCAD's rotate(a) about the origin (whose angle is in degrees).
旋转形状 -> Cad Shape
形状: Cad Shape
角度: 数字
中心 X: 数字
中心 Y: 数字CadShape Rotate(
CadShape shape,
double angle,
double centerX = 0,
double centerY = 0)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 角度 | 数字 | — | How far, in radians. |
| 中心 X | 数字 | 0 | The point it turns about, along X. |
| 中心 Y | 数字 | 0 | The point it turns about, along Y. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
缩放形状
函数A shape scaled about the origin, OpenSCAD's scale([x, y]). A negative factor mirrors it.
缩放形状(形状: Cad Shape, X 向: 数字, Y 向: 数字) -> Cad Shape
CadShape Scale(CadShape shape, double x, double y)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| X 向 | 数字 | — | The factor along X. |
| Y 向 | 数字 | — | The factor along Y. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
矩形
函数A rectangle with a corner at the origin, or centred on it: OpenSCAD's square([width, height], center).
矩形(宽度: 数字, 高度: 数字, 居中: 真否) -> Cad Shape
CadShape Square(
double width,
double height,
bool centered = false)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 宽度 | 数字 | — | Along X. |
| 高度 | 数字 | — | Along Y. |
| 居中 | 真否 | False | Centred on the origin rather than cornered on it. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
文字形状
函数Text as a flat shape, OpenSCAD's text(text, size, font, halign, valign): the font's exact outlines, counters as holes, laid out from the origin along +X with lines going down. Size is the em height in model units (OpenSCAD's size is close to the cap height instead). The alignments stand the outline's box on the origin; laid out as is, the text starts at the origin on its first baseline.
文字形状 -> Cad Shape
文字: 文本
字体: Cad Font
字号: 数字
水平对齐: Cad Text Horizontal
垂直对齐: Cad Text Vertical
容差: 数字CadShape Text(
string text,
CadFont font,
double size,
CadTextHorizontal horizontal = CadTextHorizontal.Left,
CadTextVertical vertical = CadTextVertical.Baseline,
double tolerance = 1E-06)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 文字 | 文本 | — | The text; newlines start new lines. |
| 字体 | Cad Font | — | The font, captured beforehand (Parametric.CadFonts). |
| 字号 | 数字 | — | The em height, in model units. |
| 水平对齐 | Cad Text Horizontal | Left | Where the text stands across the origin. |
| 垂直对齐 | Cad Text Vertical | Baseline | Where the text stands up and down the origin. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
变换形状
函数A shape under a transform that keeps the XY plane where it is, OpenSCAD's multmatrix of a 2D child: any invertible mix of moves, turns, scales, mirrors and shears within the plane.
变换形状(形状: Cad Shape, 变换: Transform) -> Cad Shape
CadShape Transformed(CadShape shape, Transform transform)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| 变换 | Transform | — | The transform; it must take the XY plane to itself. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
平移形状
函数A shape moved, OpenSCAD's translate([x, y]).
平移形状(形状: Cad Shape, X: 数字, Y: 数字) -> Cad Shape
CadShape Translate(CadShape shape, double x, double y)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape | — | The shape. |
| X | 数字 | — | How far along X. |
| Y | 数字 | — | How far along Y. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计
形状并集
函数Everything in any of the shapes, OpenSCAD's union() of 2D children. An empty list gives an empty shape.
形状并集(形状: Cad Shape 数组, 容差: 数字) -> Cad Shape
CadShape Union(CadShape[] shapes, double tolerance = 1E-06)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 形状 | Cad Shape 数组 | — | The shapes. |
| 容差 | 数字 | 1E-06 | The model's tolerance, in its units. |
返回
| 结果 | Cad Shape |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- CAD 二维形状
- 所属包
- 计算机辅助设计