元編程參考文件

CAD 二維構建器

24 個節點

本頁內容 24

二維構建器

函數

Creates an empty session with a fixed, positive modeling tolerance.

簽名
二維構建器(容差: 數字) -> Cad Shape Builder
CadShapeBuilder CadShapeBuilder(double tolerance = 1E-06)

參數

名稱型別預設值說明
容差數字1E-06

返回

CAD 二維構建器Cad Shape Builder
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

新增形狀

函數

Adds a shape by union.

簽名
新增形狀(Cad Shape Builder: Cad Shape Builder, 形狀: Cad Shape)
void Add(CadShapeBuilder Cad Shape Builder, CadShape shape)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
形狀Cad Shape—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

構建形狀

函數

Returns the shape drawn so far.

簽名
構建形狀(Cad Shape Builder: Cad Shape Builder) -> Cad Shape
CadShape Build(CadShapeBuilder Cad Shape Builder)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—

返回

結果Cad Shape
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

清空

函數

Removes everything drawn.

簽名
清空(Cad Shape Builder: Cad Shape Builder)
void Clear(CadShapeBuilder Cad Shape Builder)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

切除形狀

函數

Takes a shape away from everything drawn so far.

簽名
切除形狀(Cad Shape Builder: Cad Shape Builder, 形狀: Cad Shape)
void Cut(CadShapeBuilder Cad Shape Builder, CadShape shape)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
形狀Cad Shape—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

差集塊

函數

Adds the first child of a block less every other: OpenSCAD's difference() { ... } of 2D children.

簽名
差集塊
    Cad Shape Builder: Cad Shape Builder
    子塊: Action<Cad Shape Builder>
void Difference(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

填充孔洞塊

函數

Adds what a block draws without its holes: OpenSCAD's fill() { ... }.

簽名
填充孔洞塊
    Cad Shape Builder: Cad Shape Builder
    子塊: Action<Cad Shape Builder>
void Fill(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

子項

函數

The children added so far, in order, each placed.

簽名
子項(Cad Shape Builder: Cad Shape Builder) -> Cad Shape 陣列
CadShape[] Children(CadShapeBuilder Cad Shape Builder)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—

返回

結果Cad Shape 陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

目前形狀

函數

The shape drawn so far.

簽名
目前形狀(Cad Shape Builder: Cad Shape Builder) -> Cad Shape
CadShape Current(CadShapeBuilder Cad Shape Builder)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—

返回

結果Cad Shape
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

公差

函數

The tolerance used by the session's booleans, in model units.

簽名
公差(Cad Shape Builder: Cad Shape Builder) -> 數字
double Tolerance(CadShapeBuilder Cad Shape Builder)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

凸包塊

函數

Adds the convex hull of everything a block draws: OpenSCAD's hull() { ... } of 2D children (Cad2D.Hull), exact.

簽名
凸包塊
    Cad Shape Builder: Cad Shape Builder
    子塊: Action<Cad Shape Builder>
void Hull(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

求交形狀

函數

Keeps only what everything drawn so far has in common with a shape.

簽名
求交形狀(Cad Shape Builder: Cad Shape Builder, 形狀: Cad Shape)
void Intersect(
    CadShapeBuilder Cad Shape Builder,
    CadShape shape)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
形狀Cad Shape—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

交集塊

函數

Adds what every child of a block has in common: OpenSCAD's intersection() { ... } of 2D children.

簽名
交集塊
    Cad Shape Builder: Cad Shape Builder
    子塊: Action<Cad Shape Builder>
void Intersection(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

閔可夫斯基和塊

函數

Adds the Minkowski sum of everything a block draws, each child added to the next: OpenSCAD's minkowski() { ... } of 2D children (Cad2D.Minkowski).

簽名
閔可夫斯基和塊
    Cad Shape Builder: Cad Shape Builder
    子塊: Action<Cad Shape Builder>
void Minkowski(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

鏡像塊

函數

Adds what a block draws, mirrored in the line through the origin square to a direction: OpenSCAD's mirror([x, y]) { ... }.

簽名
鏡像塊
    Cad Shape Builder: Cad Shape Builder
    法向 X: 數字
    法向 Y: 數字
    子塊: Action<Cad Shape Builder>
void Mirror(
    CadShapeBuilder Cad Shape Builder,
    double normalX,
    double normalY,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
法向 X數字—The mirror line's normal, along X.
法向 Y數字—Along Y.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

圓角偏移塊

函數

Adds what a block draws, grown or shrunk with round corners: OpenSCAD's offset(r) { ... }.

簽名
圓角偏移塊
    Cad Shape Builder: Cad Shape Builder
    半徑: 數字
    子塊: Action<Cad Shape Builder>
void Offset(
    CadShapeBuilder Cad Shape Builder,
    double radius,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
半徑數字—How far: positive grows, negative shrinks.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

尖角偏移塊

函數

Adds what a block draws, grown or shrunk with sharp or cut corners: OpenSCAD's offset(delta, chamfer) { ... }.

簽名
尖角偏移塊
    Cad Shape Builder: Cad Shape Builder
    距離: 數字
    倒角: 真否
    子塊: Action<Cad Shape Builder>
void OffsetDelta(
    CadShapeBuilder Cad Shape Builder,
    double delta,
    bool chamfer,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
距離數字—How far: positive grows, negative shrinks.
倒角真否—Cut the corners across.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

投影塊

函數

Adds the shadow of what a 3D block builds on the XY plane, or with Cut the cut through it at Z = 0: OpenSCAD's projection(cut) { ... } (Cad.Projection).

簽名
投影塊
    Cad Shape Builder: Cad Shape Builder
    截切: 真否
    三維子塊: Action<Cad Builder>
void Projection(
    CadShapeBuilder Cad Shape Builder,
    bool cut,
    Action<CadBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
截切真否—Whether to cut at Z = 0 rather than cast the whole shadow.
三維子塊Action<Cad Builder>—The block, given a 3D session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

調整尺寸塊

函數

Adds what a block draws, scaled about the origin to a size: OpenSCAD's resize([x, y], auto) { ... }.

簽名
調整尺寸塊
    Cad Shape Builder: Cad Shape Builder
    寬度: 數字
    高度: 數字
    自動: 真否
    子塊: Action<Cad Shape Builder>
void Resize(
    CadShapeBuilder Cad Shape Builder,
    double width,
    double height,
    bool auto,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
寬度數字—The new width; zero to leave it.
高度數字—The new height; zero to leave it.
自動真否—Scale a direction given zero with the other.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

旋轉塊

函數

Adds what a block draws, turned about the origin counter-clockwise: OpenSCAD's rotate(a) { ... }, in radians.

簽名
旋轉塊
    Cad Shape Builder: Cad Shape Builder
    角度: 數字
    子塊: Action<Cad Shape Builder>
void Rotate(
    CadShapeBuilder Cad Shape Builder,
    double angle,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
角度數字—How far, in radians.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

縮放塊

函數

Adds what a block draws, scaled about the origin: OpenSCAD's scale([x, y]) { ... }.

簽名
縮放塊
    Cad Shape Builder: Cad Shape Builder
    X 向: 數字
    Y 向: 數字
    子塊: Action<Cad Shape Builder>
void Scale(
    CadShapeBuilder Cad Shape Builder,
    double x,
    double y,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
X 向數字—The factor along X.
Y 向數字—The factor along Y.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

截面塊

函數

Adds the cut through what a 3D block builds at Z = 0: OpenSCAD's projection(cut = true) { ... }.

簽名
截面塊
    Cad Shape Builder: Cad Shape Builder
    三維子塊: Action<Cad Builder>
void Slice(
    CadShapeBuilder Cad Shape Builder,
    Action<CadBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
三維子塊Action<Cad Builder>—The block, given a 3D session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

平移塊

函數

Adds what a block draws, moved: OpenSCAD's translate([x, y]) { ... }.

簽名
平移塊
    Cad Shape Builder: Cad Shape Builder
    X: 數字
    Y: 數字
    子塊: Action<Cad Shape Builder>
void Translate(
    CadShapeBuilder Cad Shape Builder,
    double x,
    double y,
    Action<CadShapeBuilder> children)

參數

名稱型別預設值說明
Cad Shape BuilderCad Shape Builder—
X數字—How far along X.
Y數字—How far along Y.
子塊Action<Cad Shape Builder>—The block, given a flat session of its own.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計

開始二維

函數

Creates an empty flat session from a graph node.

簽名
開始二維(容差: 數字) -> Cad Shape Builder
CadShapeBuilder Begin(double tolerance = 1E-06)

參數

名稱型別預設值說明
容差數字1E-06

返回

結果Cad Shape Builder
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
CAD 二維構建器
所屬包
電腦輔助設計