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 二維形狀
- 所屬包
- 電腦輔助設計