元编程参考文档

CAD 建模

79 个节点

本页内容 79

面积

函数

Sums body surface areas in square model units, including interior faces of unfused groups.

签名
面积(模型: Cad Model) -> 数字
double Area(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

装配

函数

Collects two models as separate assembly bodies. Its group is both.

签名
装配 -> Cad Model
    第一个: Cad Model
    第二个: Cad Model
    名称: 文本
CadModel Assemble(
    CadModel first,
    CadModel second,
    string name = "")

参数

名称类型默认值说明
第一个Cad Model—One model.
第二个Cad Model—The other.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

实体

函数

Returns each body as an independently owned model for assembly manipulation.

签名
实体(模型: Cad Model) -> Cad Model 数组
CadModel[] Bodies(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果Cad Model 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

包围盒

函数

Returns combined bounds of trimmed geometry, or BoundingBox.Empty for an empty model.

签名
包围盒(模型: Cad Model) -> Bounding Box
BoundingBox Bounds(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果Bounding Box
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

长方体

函数

Box with a minimum corner at the origin, or centered on it when requested. Dimensions must exceed tolerance. Its groups: the whole box, and its sides "top", "bottom", "left", "right", "front" and "back", facing +Z, -Z, -X, +X, -Y and +Y.

签名
长方体 -> Cad Model
    宽度: 数字
    深度: 数字
    高度: 数字
    居中: 真否
    容差: 数字
    名称: 文本
CadModel Box(
    double width,
    double depth,
    double height,
    bool centered = false,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
宽度数字—Along X.
深度数字—Along Y.
高度数字—Along Z.
居中真否FalseCentered on the origin rather than cornered on it.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

封口

函数

Caps planar openings. Closed solids pass through unchanged; an open body that cannot be capped reports failure. Its groups: everything it gave, and "caps", the faces it closed the openings with.

签名
封口(模型: Cad Model, 容差: 数字, 名称: 文本) -> Cad Model
CadModel Cap(
    CadModel model,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The open bodies.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

倒角

函数

在一个实体上对文字描述所选取的边倒斜角,在其相交的两个面上各退回同一距离。

签名
倒角 -> Cad Model
    模型: Cad Model
    边: 文本
    距离: 数字
    容差: 数字
    名称: 文本
CadModel Chamfer(
    CadModel model,
    string edges,
    double distance,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
边文本—哪些边,用文字描述:例如 "edges parallel to Z"(平行于 Z 的边)、"vertical edges"(竖直的边)、"circular edges"(圆形的边)、"edges of the top face"(顶面的边)、"all edges except concave edges"(除凹边外的所有边)。
距离数字—每条边在其两个面上各退回的距离,模型单位。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

着色

函数

重载 1/2

签名
着色(模型: Cad Model, 颜色: 颜色, 名称: 文本) -> Cad Model
CadModel Color(
    CadModel model,
    ColorElement color,
    string name = "")

Paints every face of the bodies, OpenSCAD's color(c): a face keeps its colour through whatever is done to it after - a union keeps each solid's colours, a cut face takes the colour of the cutter it came from, as OpenSCAD's preview shows them, and the faces a fillet or a shell makes take the colour most of the body is. A colour painted over another replaces it, as OpenSCAD's outer color() does. The colours go out to STEP and 3MF (Parametric.CadExport) and show in the 3D view. Its group is everything it painted.

参数

名称类型默认值说明
模型Cad Model—The bodies.
颜色颜色—The colour, its alpha how opaque.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model

重载 2/2

签名
按名称着色 -> Cad Model
    模型: Cad Model
    颜色: 文本
    不透明度: 数字
    名称: 文本
CadModel Color(
    CadModel model,
    string color,
    double alpha = 1,
    string name = "")

Paints every face of the bodies a colour written as OpenSCAD writes one: color("red"), color("#ff8000"), color("SteelBlue", 0.5) (see Cad.ColorOf and Cad.Color).

参数

名称类型默认值说明
模型Cad Model—The bodies.
颜色文本—颜色的名称,如 CSS 和 OpenSCAD 所称,例如 "red"、"SteelBlue";或十六进制代码 "#rgb"、"#rgba"、"#rrggbb"、"#rrggbbaa"。
不透明度数字1How opaque, from 0 to 1, times any alpha the text gives.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

颜色

函数

A colour written as OpenSCAD writes one: a name CSS and OpenSCAD both know, case aside ("red", "SteelBlue"), or a hex code "#rgb", "#rgba", "#rrggbb" or "#rrggbbaa".

签名
颜色(颜色: 文本, 不透明度: 数字) -> 颜色
ColorElement ColorOf(string color, double alpha = 1)

参数

名称类型默认值说明
颜色文本—颜色的名称,如 CSS 和 OpenSCAD 所称,例如 "red"、"SteelBlue";或十六进制代码 "#rgb"、"#rgba"、"#rrggbb"、"#rrggbbaa"。
不透明度数字1How opaque, from 0 to 1, times any alpha the text gives.

返回

结果颜色
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

RGB 颜色

函数

A colour from its red, green and blue, each from 0 to 1, as OpenSCAD's color([r, g, b, a]) gives one.

签名
RGB 颜色(红: 数字, 绿: 数字, 蓝: 数字, 不透明度: 数字) -> 颜色
ColorElement ColorRgb(
    double red,
    double green,
    double blue,
    double alpha = 1)

参数

名称类型默认值说明
红数字—Red, from 0 to 1.
绿数字—Green, from 0 to 1.
蓝数字—Blue, from 0 to 1.
不透明度数字1How opaque, from 0 to 1.

返回

结果颜色
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

模型颜色

函数

The colours a model's faces are painted, each once, in the order its bodies and faces first show them; empty for a model none of whose faces is painted.

签名
模型颜色(模型: Cad Model) -> 颜色数组
ColorElement[] Colors(CadModel model)

参数

名称类型默认值说明
模型Cad Model—The bodies.

返回

结果颜色数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

圆锥体

函数

Capped cone with its base at Z=0 and apex on positive Z. Its groups: the whole cone, "bottom", its flat base, and "side", its slope.

签名
圆锥体 -> Cad Model
    半径: 数字
    高度: 数字
    容差: 数字
    名称: 文本
CadModel Cone(
    double radius,
    double height,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
半径数字—Its base's radius.
高度数字—Its height, along Z.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

包含点

函数

Tests whether a point is contained by any solid in the model.

签名
包含点 -> 真否
    模型: Cad Model
    点: Point3d
    严格在内部: 真否
    容差: 数字
bool Contains(
    CadModel model,
    Point3d point,
    bool strictlyInside = false,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—
点Point3d—
严格在内部真否False
容差数字1E-06

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

圆柱体

函数

Capped cylinder along positive Z, base at Z=0 or centered in height. Its groups: the whole cylinder, "top" and "bottom", its flat ends, and "side", its round face.

签名
圆柱体 -> Cad Model
    半径: 数字
    高度: 数字
    居中: 真否
    容差: 数字
    名称: 文本
CadModel Cylinder(
    double radius,
    double height,
    bool centered = false,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
半径数字—Its radius.
高度数字—Its height, along Z.
居中真否FalseCentered on the origin in height rather than standing on it.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

差集

函数

Subtracts the union of every cutter body from the union of subject bodies. All disconnected output pieces are preserved. Its groups: everything it gave, "seams", the edges it made where the cut meets the subject, and "cut", the faces the cutters left - a hole's walls, a slot's floor.

签名
差集 -> Cad Model
    主体: Cad Model
    切割体: Cad Model 数组
    容差: 数字
    名称: 文本
CadModel Difference(
    CadModel subject,
    CadModel[] cutters,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
主体Cad Model—What is cut.
切割体Cad Model 数组—What cuts it.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

拔模

函数

将文字描述在实体上选取的平面绕其与中性面的交线倾斜一个角度(弧度)——模具的拔模:正角度使零件离开中性面处变窄。

签名
拔模 -> Cad Model
    模型: Cad Model
    面: 文本
    角度: 数字
    中性面: Plane
    容差: 数字
    名称: 文本
CadModel Draft(
    CadModel model,
    string faces,
    double angle,
    Plane neutralPlane,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
面文本—哪些面,用文字描述:例如 "the front face"(前面)、"faces facing front and faces facing back"(朝前的面与朝后的面)。
角度数字—每个面倾斜的角度,弧度。
中性面Plane—面保持不动之处所在的平面;其法向即零件出模的方向。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

边

函数

每个形体上文字描述所选取的边的精确曲线——未指定时为全部——按形体与边的顺序:同样的文字交给圆角或倒角时将处理的边,可先在此查看。

签名
边(模型: Cad Model, 哪些边: 文本) -> Curve 数组
Curve[] Edges(CadModel model, string which = "all edges")

参数

名称类型默认值说明
模型Cad Model—模型,可含任意多个形体。
哪些边文本all edges哪些边,用文字描述:例如 "edges parallel to Z"(平行于 Z 的边)、"vertical edges"(竖直的边)、"circular edges"(圆形的边)、"edges of the top face"(顶面的边)、"all edges except concave edges"(除凹边外的所有边)。

返回

结果Curve 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

空模型

函数

A successful collection with no bodies; identity for union and difference tools.

签名
空模型() -> Cad Model
CadModel Empty()

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

求值

函数

Explicitly evaluates a graph value so its diagnostic result can be inspected in a node.

签名
求值(模型: Cad Model) -> Cad Evaluation
CadEvaluation Evaluate(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果Cad Evaluation
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

拉伸

函数

Extrudes a copied planar profile with optional hole loops. Capped closed profiles produce solids; uncapped profiles produce sheets. Its groups: the whole extrusion, "start", the cap where the profile was, "end", the cap it was carried to, and "sides", every other face - the holes' walls among them.

签名
拉伸 -> Cad Model
    轮廓: Curve
    方向: Vector3d
    封闭端面: 真否
    孔洞: Curve 数组
    容差: 数字
    名称: 文本
CadModel Extrude(
    Curve profile,
    Vector3d direction,
    bool capped = true,
    Curve[] holes,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
轮廓Curve—The closed or open profile, in a plane.
方向Vector3d—Which way, and how far.
封闭端面真否TrueWhether a closed profile's ends are capped into a solid.
孔洞Curve 数组—Closed loops inside the profile, cut through.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

拉伸面

函数

将文字描述在实体上选取的那一个面沿其外法线推拉一段距离:向外为加料,负距离为切入。

签名
拉伸面 -> Cad Model
    模型: Cad Model
    面: 文本
    距离: 数字
    容差: 数字
    名称: 文本
CadModel ExtrudeFace(
    CadModel model,
    string face,
    double distance,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
面文本—哪个面,用文字描述:例如 "the top face"(顶面)、"the largest face"(最大的面)。
距离数字—距离,模型单位:向外为加料,负值为切入。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

拉伸区域

函数

Extrudes planar boolean regions, preserving each region's holes. Its groups: the whole extrusion, "start", the caps where the regions were, "end", the caps they were carried to, and "sides", every other face.

签名
拉伸区域 -> Cad Model
    区域: Curve Region 数组
    方向: Vector3d
    容差: 数字
    名称: 文本
CadModel ExtrudeRegions(
    CurveRegion[] regions,
    Vector3d direction,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
区域Curve Region 数组—The regions, in one plane.
方向Vector3d—Which way, and how far.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

面的颜色

函数

The colour each face of one body is painted, by face, or null for a face never painted.

签名
面的颜色(模型: Cad Model, 实体: 整数) -> 可选颜色数组
ColorElement?[] FaceColors(CadModel model, int body = 0)

参数

名称类型默认值说明
模型Cad Model—The bodies.
实体整数0Which body, counted from 0.

返回

结果可选颜色数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

面

函数

每个形体上文字描述所选取的面——未指定时为全部——各为一张独立的片体,按形体与面的顺序,保留其精确曲面、孔与修剪:同样的文字交给抽壳或拔模时将处理的面,可先在此查看。

签名
面(模型: Cad Model, 哪些面: 文本) -> Cad Model 数组
CadModel[] Faces(CadModel model, string which = "all faces")

参数

名称类型默认值说明
模型Cad Model—模型,可含任意多个形体。
哪些面文本all faces哪些面,用文字描述:例如 "the top face"(顶面)、"faces facing up"(朝上的面)、"cylindrical faces"(圆柱面)。

返回

结果Cad Model 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

多面球

函数

OpenSCAD's faceted sphere, sphere(r, $fn = segments): rings of corners at (i + ½)·180°/rings from the top, rings being half the segments rounded up, each ring's first corner over +X; flat polygons close the top and the bottom and flat quadrilaterals join the rings. The exact sphere is Cad.Sphere. Its group is the solid.

签名
多面球 -> Cad Model
    半径: 数字
    分段数: 整数
    容差: 数字
    名称: 文本
CadModel FacetedSphere(
    double radius,
    int segments,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
半径数字—The radius the corners lie on.
分段数整数—The corners round each ring, at least three: OpenSCAD's $fn, or Cad2D.Fragments of the radius.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

圆角

函数

在一个实体上,用给定半径的滚球对文字描述所选取的边倒圆角,例如 "edges parallel to Z"、"edges of the top face"、"convex edges"。与所选边平滑相接的边一并倒圆。

签名
圆角 -> Cad Model
    模型: Cad Model
    边: 文本
    半径: 数字
    容差: 数字
    名称: 文本
CadModel Fillet(
    CadModel model,
    string edges,
    double radius,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
边文本—哪些边,用文字描述:例如 "edges parallel to Z"(平行于 Z 的边)、"vertical edges"(竖直的边)、"circular edges"(圆形的边)、"edges of the top face"(顶面的边)、"all edges except concave edges"(除凹边外的所有边)。
半径数字—滚球的半径,模型单位。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model

备注

Round 26: picked by what they are, or by the groups the operations before gave them, rather than by index (Parametric.CadSelection), so a fillet keeps rounding the same edges after an edit upstream renumbers the body's edges.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

由实体创建

函数

Imports independently owned copies of exact kernel geometry. Subsequent edits to the supplied B-reps cannot change this model.

签名
由实体创建(实体: Brep 数组) -> Cad Model
CadModel FromBreps(params Brep[] breps)

参数

名称类型默认值说明
实体Brep 数组—

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

由曲面创建

函数

Creates an open B-rep from a copied surface. Solid-only operations report failure on open geometry. Its group is the sheet.

签名
由曲面创建(曲面: Surface, 容差: 数字, 名称: 文本) -> Cad Model
CadModel FromSurface(
    Surface surface,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
曲面Surface—The surface.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

圆台

函数

A cone cut off square to its axis, standing on Z = 0 or centred on it - OpenSCAD's cylinder(h, r1, r2, center): its bottom radius and its top radius may differ, either may be zero for a point, and equal they make a cylinder. Given three or more segments it is OpenSCAD's faceted one, a frustum of a regular pyramid with a corner on +X ($fn = segments); otherwise its surfaces are exact. Its groups: the whole frustum, "top" and "bottom", its flat ends, and "side", every other face.

签名
圆台 -> Cad Model
    底面半径: 数字
    顶面半径: 数字
    高度: 数字
    居中: 真否
    分段数: 整数
    容差: 数字
    名称: 文本
CadModel Frustum(
    double bottomRadius,
    double topRadius,
    double height,
    bool centered = false,
    int segments = 0,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
底面半径数字—The radius at Z = 0 (or at the bottom when centred).
顶面半径数字—The radius at the top.
高度数字—Its height, along Z.
居中真否FalseCentred on the origin in height rather than standing on it.
分段数整数0Zero for exact circles, or the number of corners of OpenSCAD's faceted one (at least three).
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

熔合

函数

Set union of two models, retaining disconnected output bodies. Its groups: everything it gave, and "seams", the edges it made where the two cross.

签名
熔合 -> Cad Model
    第一个: Cad Model
    第二个: Cad Model
    容差: 数字
    名称: 文本
CadModel Fuse(
    CadModel first,
    CadModel second,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
第一个Cad Model—One model.
第二个Cad Model—The other.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

编组

函数

Collects models without fusing touching or overlapping bodies. Arrays are copied when the node is created.

签名
编组(模型: Cad Model 数组) -> Cad Model
CadModel Group(params CadModel[] models)

参数

名称类型默认值说明
模型Cad Model 数组—

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

凸包

函数

The convex hull of solids, OpenSCAD's hull(): the smallest convex solid holding them all. Exact where the solids allow it: solids of flat faces give the exact polyhedron of their corners, and solids standing upright between the same two heights - cylinders and prisms side by side, OpenSCAD's rounded plate - give the exact extrusion of the flat hull of their footprint. Other curved solids give the hull of their tessellation, a polyhedron within Chord of the true hull, and the result says so in its warnings. Its group is the hull.

签名
凸包 -> Cad Model
    模型: Cad Model 数组
    弦高: 数字
    容差: 数字
    名称: 文本
CadModel Hull(
    CadModel[] models,
    double chord = 0,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model 数组—The solids.
弦高数字0How far the tessellation of curved solids may stray from them, in model units; zero for a thousandth of the solids' size.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

点的凸包

函数

The convex polyhedron of points: OpenSCAD's hull of points (the corners of tiny cubes, say), exact, its corners the given points. Its group is the hull.

签名
点的凸包(点: Point3d 数组, 容差: 数字, 名称: 文本) -> Cad Model
CadModel HullOfPoints(
    Point3d[] points,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
点Point3d 数组—At least four points not in one plane.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

交集

函数

Intersection of two body sets. Disjoint sets succeed with empty output. Its groups: everything it gave, and "seams", the edges it made where the two cross.

签名
交集 -> Cad Model
    左侧: Cad Model
    右侧: Cad Model
    容差: 数字
    名称: 文本
CadModel Intersection(
    CadModel left,
    CadModel right,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
左侧Cad Model—One set.
右侧Cad Model—The other.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

合并

函数

Joins coincident naked edges of open B-reps; does not boolean fuse overlapping solids. Its group is everything it gave.

签名
合并(模型: Cad Model 数组, 容差: 数字, 名称: 文本) -> Cad Model
CadModel Join(
    CadModel[] models,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model 数组—The sheets.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

线性阵列

函数

Copies the model count times, including the original at index zero, without fusing bodies. A zero count returns empty. Each copy keeps the groups of what it copies, so "Boss top" is the top of every copy; its own group is all the copies.

签名
线性阵列 -> Cad Model
    模型: Cad Model
    数量: 整数
    步长: Vector3d
    名称: 文本
CadModel LinearArray(
    CadModel model,
    int count,
    Vector3d step,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
数量整数—How many, the original among them.
步长Vector3d—How far each copy is from the one before.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

线性拉伸

函数

A flat shape carried up the Z axis into a solid, OpenSCAD's linear_extrude(height, center, twist, scale): as it rises the shape turns about the Z axis by up to Twist and is scaled about it along X and Y up to Scale X and Scale Y, turned first and then scaled. Without a twist the solid is exact; a twist's sides are fitted to the tolerance, since no exact surface makes them. Its groups: the whole extrusion, "start", the caps at the bottom, "end", the caps at the top, and "sides", every other face.

签名
线性拉伸 -> Cad Model
    形状: Cad Shape
    高度: 数字
    居中: 真否
    扭转: 数字
    X 向缩放: 数字
    Y 向缩放: 数字
    容差: 数字
    名称: 文本
CadModel LinearExtrude(
    CadShape shape,
    double height,
    bool centered = false,
    double twist = 0,
    double scaleX = 1,
    double scaleY = 1,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
形状Cad Shape—The shape, in the XY plane.
高度数字—How high, in model units.
居中真否FalseCentred on Z = 0 in height rather than standing on it.
扭转数字0How far the top is turned, in radians, counter-clockwise seen from +Z.
X 向缩放数字1The top's scale along X: 1 keeps the shape's size, 0 (with Scale Y) closes it at a point.
Y 向缩放数字1The top's scale along Y.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model

备注

OpenSCAD's twist is in degrees and turns clockwise seen from above; here it is in radians and counter-clockwise, so OpenSCAD's twist = 90 is -π/2. OpenSCAD's slices only set how finely its mesh follows the twist and have nothing to set here. Both scales zero close each region at an apex on the axis, a pyramid or a cone.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

放样

函数

Lofts ordered, copied cross-sections. Sections must have compatible topology and orientation. Its group is the loft.

签名
放样 -> Cad Model
    截面: Curve 数组
    封闭端面: 真否
    类型: Loft Type
    容差: 数字
    名称: 文本
CadModel Loft(
    Curve[] sections,
    bool capped = true,
    LoftType type = LoftType.Normal,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
截面Curve 数组—The sections, in order.
封闭端面真否TrueWhether closed end sections are capped into a solid.
类型Loft Type正常How the surface runs between the sections.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

闵可夫斯基和

函数

The Minkowski sum of solids, OpenSCAD's minkowski(): every point of one added to every point of the next. Exact where an exact sum is a solid the kernel makes. A solid plus a ball - OpenSCAD's rounded cube - is the solid offset by the radius with its outside edges rounded by it, checked against the definition at points all over it. Two solids standing upright between two heights, a cube and a cylinder, are the extrusion of the flat sum of their cross-sections. Two polyhedra give their exact polyhedral sum. Other curved solids are tessellated within Chord first, as OpenSCAD facets every curved solid, and the result says so in its warnings. Its group is the sum.

签名
闵可夫斯基和 -> Cad Model
    模型: Cad Model 数组
    弦高: 数字
    容差: 数字
    名称: 文本
CadModel Minkowski(
    CadModel[] models,
    double chord = 0,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model 数组—The solids, summed in turn.
弦高数字0How far the tessellation of curved solids may stray from them, in model units; zero for a thousandth of their size.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

镜像

函数

Mirrors in a plane. Its group is everything it mirrored.

签名
镜像(模型: Cad Model, 平面: Plane, 名称: 文本) -> Cad Model
CadModel Mirror(CadModel model, Plane plane, string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
平面Plane—The mirror's plane.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

移动面

函数

将文字描述在实体上选取的那一个平面按 X、Y、Z 移动,周围的面随之调整:把一面墙加厚,或把一级台阶抬高。

签名
移动面 -> Cad Model
    模型: Cad Model
    面: 文本
    X: 数字
    Y: 数字
    Z: 数字
    容差: 数字
    名称: 文本
CadModel MoveFace(
    CadModel model,
    string face,
    double x,
    double y,
    double z,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
面文本—哪个面,用文字描述:例如 "the right face"(右面)、"the top face"(顶面)。
X数字—沿 X 移动的距离,模型单位。
Y数字—沿 Y 移动的距离。
Z数字—沿 Z 移动的距离。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

偏移

函数

Offsets a single closed solid without changing its topology. Unsupported topology changes produce a failed evaluation. Its group is everything it gave.

签名
偏移 -> Cad Model
    模型: Cad Model
    距离: 数字
    容差: 数字
    名称: 文本
CadModel Offset(
    CadModel model,
    double distance,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The solid, one body.
距离数字—How far, outward, in the model's units.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

定向

函数

Orients a model between local frames without scaling. Its group is everything it moved.

签名
定向 -> Cad Model
    模型: Cad Model
    起点: Plane
    终点: Plane
    名称: 文本
CadModel Orient(
    CadModel model,
    Plane from,
    Plane to,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
起点Plane—The frame they are in.
终点Plane—The frame they go to.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

选取边

函数

从列表中选择哪些边,而不必书写:得到圆角或倒角的引脚所读的那段文字。填写"其中"时,在某个组的边之中选取,或选取某些面的边。

签名
选取边(哪些边: Cad Edges, 其中: 文本) -> 文本
string PickEdges(CadEdges which = CadEdges.All, string of = "")

参数

名称类型默认值说明
哪些边Cad Edges所有边要选取的边。
其中文本—在什么之中:组的名称,例如 "Boss top";或选取面的文字,例如 "the top face",即围成这些面的边。留空则为整个实体。

返回

边文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

选取面

函数

从列表中选择哪些面,而不必书写:得到圆角、抽壳或拔模的引脚所读的那段文字。填写"其中"时,在某个组的面之中选取,或选取某些边所围的面。

签名
选取面(哪些面: Cad Faces, 其中: 文本) -> 文本
string PickFaces(CadFaces which = CadFaces.Top, string of = "")

参数

名称类型默认值说明
哪些面Cad Faces顶面要选取的面。
其中文本—在什么之中:组的名称,例如 "Boss";或选取边的文字,例如 "circular edges",即这些边所围的面。留空则为整个实体。

返回

面文本

备注

Round 26's review, and Charles's answer to it: the words that pick are English and are not translated, being what a group's name is written among, so somebody working in another language chooses from a list here, which the editor shows in their language, and wires the result where the words would be typed. What comes out is those same words, so the two can be mixed: "Boss top" typed into Of, or this node's result joined to typed words downstream.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

管道

函数

Pipe along a copied rail. Zero thickness makes a solid pipe; positive thickness makes a hollow pipe. Its group is the pipe.

签名
管道 -> Cad Model
    导轨: Curve
    半径: 数字
    封闭端面: 真否
    厚度: 数字
    容差: 数字
    名称: 文本
CadModel Pipe(
    Curve rail,
    double radius,
    bool capped = true,
    double thickness = 0,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
导轨Curve—The pipe's path.
半径数字—Its outer radius.
封闭端面真否TrueWhether its ends are capped.
厚度数字0Its wall's thickness; zero for a solid rod.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

平面

函数

Creates a planar trimmed sheet from a closed boundary and optional hole loops. Its group is the sheet.

签名
平面 -> Cad Model
    边界: Curve
    孔洞: Curve 数组
    容差: 数字
    名称: 文本
CadModel PlanarFace(
    Curve boundary,
    Curve[] holes,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
边界Curve—The closed boundary.
孔洞Curve 数组—Closed loops inside it, cut out.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

环形阵列

函数

Copies around the world Z axis without fusing bodies. Full circles exclude a duplicate endpoint; partial arcs also use angle/count spacing. Each copy keeps the groups of what it copies; its own group is all the copies.

签名
环形阵列 -> Cad Model
    模型: Cad Model
    数量: 整数
    角度: 数字
    名称: 文本
CadModel PolarArray(
    CadModel model,
    int count,
    double angle = 6.283185307179586,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
数量整数—How many, the original among them.
角度数字6.283185307179586The angle the copies spread over, in radians.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

多面体

函数

A closed solid of flat faces through points, OpenSCAD's polyhedron(points, faces): each face a list of indices into the points. A face whose points lie in one plane is one exact planar face, of any number of sides; one whose points do not is cut into triangles, as OpenSCAD cuts it. The faces must close round a volume, each edge shared by two of them. OpenSCAD lists each face's points clockwise seen from outside; faces listed the other way round throughout are read too, and the solid turned outward. Its group is the solid.

签名
多面体 -> Cad Model
    点: Point3d 数组
    面: 整数数组数组
    容差: 数字
    名称: 文本
CadModel Polyhedron(
    Point3d[] points,
    int[][] faces,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
点Point3d 数组—The corners.
面整数数组数组—The faces, each a list of at least three indices into Points.
容差数字1E-06The model's tolerance, in its units: how far a face's points may stray from its plane and still be one flat face.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

投影曲线

函数

Projects a curve in a direction onto all trimmed faces, retaining all resulting pieces.

签名
投影曲线 -> Curve 数组
    模型: Cad Model
    曲线: Curve
    方向: Vector3d
    容差: 数字
Curve[] ProjectCurve(
    CadModel model,
    Curve curve,
    Vector3d direction,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—
曲线Curve—
方向Vector3d—
容差数字1E-06

返回

结果Curve 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

投影

函数

The shadow of solids on the XY plane, OpenSCAD's projection(): everything a line parallel to Z through it would meet, as a flat shape; with Cut, the cut through them at Z = 0 instead, OpenSCAD's projection(cut = true) (Cad.Slice). The shadow's edges are the solids' own edges and the curves along which their faces turn from facing up to facing down, carried straight down: exact where those are lines and arcs - a box however it is turned, a cylinder lying down, a sphere, a torus with its hole - and fitted within the tolerance where the faces are freeform.

签名
投影(模型: Cad Model, 截切: 真否, 容差: 数字) -> Cad Shape
CadShape Projection(
    CadModel model,
    bool cut = false,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—The solids.
截切真否FalseWhether to cut at Z = 0 rather than cast the whole shadow.
容差数字1E-06The model's tolerance, in its units.

返回

结果Cad Shape

备注

Every edge and silhouette curve, carried down, cuts the plane into faces; a face is in the shadow when the solids lie over (or under) a point well inside it.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

拉回曲线

函数

Pulls a curve onto trimmed B-rep faces by closest point.

签名
拉回曲线(模型: Cad Model, 曲线: Curve, 容差: 数字) -> Curve 数组
Curve[] PullCurve(
    CadModel model,
    Curve curve,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—
曲线Curve—
容差数字1E-06

返回

结果Curve 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

调整尺寸

函数

A solid scaled about the origin to a size, OpenSCAD's resize([x, y, z], 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. The sizes are read off the evaluated bodies' box. Its group is everything it scaled.

签名
调整尺寸 -> Cad Model
    模型: Cad Model
    X 尺寸: 数字
    Y 尺寸: 数字
    Z 尺寸: 数字
    自动: 真否
    名称: 文本
CadModel Resize(
    CadModel model,
    double x,
    double y,
    double z,
    bool auto = false,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
X 尺寸数字—The new size along X; zero to leave it.
Y 尺寸数字—The new size along Y; zero to leave it.
Z 尺寸数字—The new size along Z; zero to leave it.
自动真否FalseScale the directions given zero with the others.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

旋转成形

函数

Revolves a copied profile about a line. Angle is radians; cap behavior follows the profile and kernel. Its groups: the whole revolution, "caps", the flat faces closing a turn short of a whole one, and "sides", every face the profile swept.

签名
旋转成形 -> Cad Model
    轮廓: Curve
    轴起点: Point3d
    轴方向: Vector3d
    角度: 数字
    容差: 数字
    名称: 文本
CadModel Revolve(
    Curve profile,
    Point3d axisStart,
    Vector3d axisDirection,
    double angle = 6.283185307179586,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
轮廓Curve—The profile.
轴起点Point3d—A point on the axis.
轴方向Vector3d—The axis's direction.
角度数字6.283185307179586How far round, in radians.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

旋转

函数

Rotates around an axis through the supplied center, in radians. Its group is everything it turned.

签名
旋转 -> Cad Model
    模型: Cad Model
    角度: 数字
    轴: Vector3d
    中心: Point3d
    名称: 文本
CadModel Rotate(
    CadModel model,
    double angle,
    Vector3d axis,
    Point3d center,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
角度数字—The angle, in radians.
轴Vector3d—The axis's direction.
中心Point3d—A point on the axis.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

旋转拉伸

函数

A flat shape turned about the Z axis into a solid, OpenSCAD's rotate_extrude(angle): the shape's X becomes the distance from the axis and its Y the height, so the shape stands in the XZ plane, and it turns from there counter-clockwise seen from +Z. The solid is exact. Its groups: the whole revolution, "caps", the flat faces closing a turn short of a whole one, and "sides", every face the shape swept.

签名
旋转拉伸 -> Cad Model
    形状: Cad Shape
    角度: 数字
    容差: 数字
    名称: 文本
CadModel RotateExtrude(
    CadShape shape,
    double angle = 6.283185307179586,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
形状Cad Shape—The shape, in the XY plane, on one side of the Y axis.
角度数字6.283185307179586How far round, in radians, counter-clockwise, or clockwise when negative: a whole turn by default.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model

备注

As in OpenSCAD the shape must lie on one side of the Y axis, which becomes the Z axis; it may touch it along an edge. OpenSCAD's angle is in degrees; here it is in radians. A negative angle turns the other way, clockwise from the XZ plane, as OpenSCAD's does.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

按 XYZ 旋转

函数

A solid turned about the X, Y and Z axes in that order, each through the origin - OpenSCAD's rotate([x, y, z]), whose angles are in degrees where these are in radians. Its group is everything it turned.

签名
按 XYZ 旋转 -> Cad Model
    模型: Cad Model
    绕 X: 数字
    绕 Y: 数字
    绕 Z: 数字
    名称: 文本
CadModel RotateXyz(
    CadModel model,
    double x,
    double y,
    double z,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
绕 X数字—The turn about X, first, in radians.
绕 Y数字—The turn about Y, second.
绕 Z数字—The turn about Z, last.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

直纹

函数

Creates an open ruled surface B-rep between copied curves. Its group is the sheet.

签名
直纹 -> Cad Model
    第一个: Curve
    第二个: Curve
    容差: 数字
    名称: 文本
CadModel Ruled(
    Curve first,
    Curve second,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
第一个Curve—One edge of the sheet.
第二个Curve—The other.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

缩放

函数

Scales about the origin. Factors may be negative for reflection but cannot be zero. Its group is everything it scaled.

签名
缩放 -> Cad Model
    模型: Cad Model
    X: 数字
    Y: 数字
    Z: 数字
    名称: 文本
CadModel Scale(
    CadModel model,
    double x,
    double y,
    double z,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
X数字—The factor along X.
Y数字—The factor along Y.
Z数字—The factor along Z.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

截面

函数

Returns independently owned section curves through all bodies.

签名
截面(模型: Cad Model, 平面: Plane, 容差: 数字) -> Curve 数组
Curve[] Section(
    CadModel model,
    Plane plane,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—
平面Plane—
容差数字1E-06

返回

结果Curve 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

选取

函数

给实体上的一组选取起名,就像操作为它所做出的部分命名一样:文字所选取的面或边(可以用实体的描述和它的组,例如 "edges of Boss top"、"vertical edges of Plate")成为以这个名称命名的组,之后的操作像读取其他组一样读取它(例如 "Boss rim")。实体的几何不变。

签名
选取(模型: Cad Model, 名称: 文本, 选取文字: 文本) -> Cad Model
CadModel Select(CadModel model, string name, string pick)

参数

名称类型默认值说明
模型Cad Model—实体。
名称文本—组的名称,例如 "Boss rim"。实体上已有的组名会被拒绝。
选取文字文本—选取它的面或边的文字,例如 "edges of Boss top"。

返回

结果Cad Model

备注

Round 26 (Charles): "The 'Bookkeep' can still be used to provide a generic set of operations and thus named as Select, which just adds new names to existing selections." The words are read when the group is, not before, and what they picked follows the solid's history as any group's members do. A name already a group on the solid is refused.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

抽壳

函数

将一个实体掏空为给定厚度的壁,文字描述所选取的面留作开口:"the top face" 得到一个开口的盒子。留空则保留所有面,在内部掏空。

签名
抽壳 -> Cad Model
    模型: Cad Model
    开口面: 文本
    厚度: 数字
    容差: 数字
    名称: 文本
CadModel Shell(
    CadModel model,
    string openFaces,
    double thickness,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—实体,单个形体。
开口面文本—留作开口的面,用文字描述:例如 "the top face"(顶面)、"faces facing up"(朝上的面);留空则不开口。
厚度数字—壁厚,自外向内。
容差数字1E-06模型的容差,模型单位。
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

截取截面

函数

The cut through a solid at a height, as a flat shape in the XY plane - OpenSCAD's projection(cut = true) of the solid moved down by Z. Bodies that overlap are cut together, as one.

签名
截取截面(模型: Cad Model, 高度: 数字, 容差: 数字) -> Cad Shape
CadShape Slice(
    CadModel model,
    double z = 0,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—The solids.
高度数字0The height of the cut.
容差数字1E-06The model's tolerance, in its units.

返回

结果Cad Shape
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

快照

函数

Evaluates and detaches construction history, preserving exact geometry.

签名
快照(模型: Cad Model) -> Cad Model
CadModel Snapshot(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

球体

函数

Sphere centered at the origin. Its group is the sphere.

签名
球体(半径: 数字, 容差: 数字, 名称: 文本) -> Cad Model
CadModel Sphere(
    double radius,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
半径数字—Its radius.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

分割

函数

Splits every body by a plane, retaining both sides and all disconnected pieces. Its groups: everything it gave, and "seams", the edges it made along the plane.

签名
分割 -> Cad Model
    模型: Cad Model
    平面: Plane
    容差: 数字
    名称: 文本
CadModel Split(
    CadModel model,
    Plane plane,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
平面Plane—The plane that splits them.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

减去

函数

Subtracts one cutter model, including all of its bodies, from a subject model. Its groups: everything it gave, "seams", the edges it made where the cut meets the subject, and "cut", the faces the cutter left.

签名
减去 -> Cad Model
    主体: Cad Model
    切割体: Cad Model
    容差: 数字
    名称: 文本
CadModel Subtract(
    CadModel subject,
    CadModel cutter,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
主体Cad Model—What is cut.
切割体Cad Model—What cuts it.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

高度图

函数

A heightmap read from a file as a solid, OpenSCAD's surface(file, center, invert): a text file of heights, one row of numbers a line along X, the lines along Y, blank lines and lines starting with # skipped; or an image, each pixel's grey (its luminance, 0.2126 R + 0.7152 G + 0.0722 B) a height from 0 to 100, the top row of the image furthest along Y. See Cad.SurfaceFromHeights for the solid.

签名
高度图 -> Cad Model
    文件: 文本
    居中: 真否
    反转: 真否
    平滑: 真否
    容差: 数字
    名称: 文本
CadModel Surface(
    string file,
    bool centered = false,
    bool invert = false,
    bool smooth = false,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
文件文本—The text file (.dat or any other extension) or image (.png, .jpg, .bmp, .webp).
居中真否FalseCentred on the origin in X and Y.
反转真否FalseFor an image, its heights turned upside down as OpenSCAD 2021.01 turns them, from 100/255 at black down to -99.6 at white; no effect on a text file.
平滑真否FalseThe top an exact bicubic surface through the heights, rather than OpenSCAD's triangles.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

由高度生成高度图

函数

A heightmap as a solid, OpenSCAD's surface() of numbers given here: height heights[y][x] over the point (x, y), one unit apart, closed by upright sides and a flat bottom at the lower of 0 and one unit under the lowest height, as OpenSCAD closes it (smooth, one unit under the lowest point of the top, which can dip between heights). As OpenSCAD draws it, each square between four heights is four triangles meeting over its middle at their mean height, and triangles lying in one plane are one face. Smooth, the top is instead an exact bicubic B-spline surface through every height, the sides flat faces under its edges.

签名
由高度生成高度图 -> Cad Model
    高度: 数字数组数组
    居中: 真否
    平滑: 真否
    容差: 数字
    名称: 文本
CadModel SurfaceFromHeights(
    double[][] heights,
    bool centered = false,
    bool smooth = false,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
高度数字数组数组—The heights, a row for each Y, each as long as the first; at least two by two.
居中真否FalseCentred on the origin in X and Y.
平滑真否FalseThe top an exact bicubic surface through the heights, rather than OpenSCAD's triangles.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

扫掠

函数

Sweeps a copied profile along one rail; freeform sweeps are fitted to tolerance. Its group is the sweep.

签名
扫掠 -> Cad Model
    导轨: Curve
    轮廓: Curve
    封闭端面: 真否
    容差: 数字
    名称: 文本
CadModel Sweep(
    Curve rail,
    Curve profile,
    bool capped = true,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
导轨Curve—The path.
轮廓Curve—The section carried along it.
封闭端面真否TrueWhether a closed profile's ends are capped into a solid.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

双轨扫掠

函数

Sweeps a copied profile between two rails. Its group is the sweep.

签名
双轨扫掠 -> Cad Model
    导轨 1: Curve
    导轨 2: Curve
    轮廓: Curve
    封闭端面: 真否
    容差: 数字
    名称: 文本
CadModel SweepTwoRails(
    Curve rail1,
    Curve rail2,
    Curve profile,
    bool capped = true,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
导轨 1Curve—One rail.
导轨 2Curve—The other.
轮廓Curve—The section carried between them.
封闭端面真否TrueWhether a closed profile's ends are capped into a solid.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

加厚

函数

Thickens a single open surface B-rep into a solid. Its group is everything it gave.

签名
加厚 -> Cad Model
    模型: Cad Model
    厚度: 数字
    容差: 数字
    名称: 文本
CadModel Thicken(
    CadModel model,
    double thickness,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The sheet, one body.
厚度数字—How thick, in the model's units.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

转为网格

函数

Tessellates exact bodies with shared face-boundary vertices, preserving solid topology for collision and analysis. Separate bodies remain separate components; chord tolerance and normal angle control approximation. Output geometry is independently owned.

签名
转为网格(模型: Cad Model, 弦高公差: 数字, 角度: 数字) -> Mesh
Mesh ToMesh(
    CadModel model,
    double chordTolerance = 0.01,
    double angle = 0.15)

参数

名称类型默认值说明
模型Cad Model—
弦高公差数字0.01
角度数字0.15

返回

结果Mesh
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

圆环体

函数

Ring torus around the Z axis. Major radius must exceed minor radius. Its group is the torus.

签名
圆环体 -> Cad Model
    主半径: 数字
    次半径: 数字
    容差: 数字
    名称: 文本
CadModel Torus(
    double majorRadius,
    double minorRadius,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
主半径数字—From the axis to the tube's middle.
次半径数字—The tube's radius.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

变换后

函数

Applies a finite, invertible affine transform to every body. Transform composition uses column vectors: A*B applies B first. Its group is everything it moved.

签名
变换后 -> Cad Model
    模型: Cad Model
    变换: Transform
    名称: 文本
CadModel Transformed(
    CadModel model,
    Transform transform,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
变换Transform—The transform.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

平移

函数

Translates every body by a vector in model units. Its group is everything it moved.

签名
平移 -> Cad Model
    模型: Cad Model
    X: 数字
    Y: 数字
    Z: 数字
    名称: 文本
CadModel Translate(
    CadModel model,
    double x,
    double y,
    double z,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
X数字—How far along X.
Y数字—How far along Y.
Z数字—How far along Z.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

修剪

函数

Trims bodies to one side of a plane. Behind means opposite the plane normal. Its groups: everything it gave, and "seams", the edges it made along the plane.

签名
修剪 -> Cad Model
    模型: Cad Model
    平面: Plane
    保留部分: Cutter Side
    容差: 数字
    名称: 文本
CadModel Trim(
    CadModel model,
    Plane plane,
    CutterSide keep = CutterSide.Behind,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model—The bodies.
平面Plane—The plane that trims them.
保留部分Cutter Side后方Which side is kept.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

并集

函数

Unites all bodies as a set. Disjoint bodies are retained, and an empty list produces an empty model. Its groups: everything it gave, and "seams", the edges it made where the bodies cross.

签名
并集(模型: Cad Model 数组, 容差: 数字, 名称: 文本) -> Cad Model
CadModel Union(
    CadModel[] models,
    double tolerance = 1E-06,
    string name = "")

参数

名称类型默认值说明
模型Cad Model 数组—The models.
容差数字1E-06The model's tolerance, in its units.
名称文本—它的组叫什么;留空则用操作的种类,例如 "Box"。组名为这个名称加上部分,例如 "Boss top"。

返回

结果Cad Model
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计

体积

函数

Sums signed solid volumes, in cubic model units. Grouped overlapping bodies are counted separately; union them first for set volume.

签名
体积(模型: Cad Model) -> 数字
double Volume(CadModel model)

参数

名称类型默认值说明
模型Cad Model—

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
CAD 建模
所属包
计算机辅助设计