元编程参考文档

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 二维构建器
所属包
计算机辅助设计