元编程参考文档

CAD 导出

6 个节点

本页内容 6

写入 3MF

函数

Writes a 3MF package (3D Manufacturing Format, the core specification's model with base materials), the format slicers read colour from: each body one object, a closed mesh tessellated as CadExport.WriteStl tessellates, each triangle in the colour of the face it was cut from, with its alpha. Faces never painted are left in no material and the object takes the slicer's own colour. Unit declares the units of the unchanged coordinates.

签名
写入 3MF
    模型: Cad Model
    路径: 文本
    单位: Length Unit
    质量: Cad Preview Options
void Write3mf(
    CadModel model,
    string path,
    LengthUnit unit = LengthUnit.Millimeter,
    CadPreviewOptions quality)

参数

名称类型默认值说明
模型Cad Model—The bodies; each must be a closed solid, as 3MF requires.
路径文本—Where to write, overwritten if it is there.
单位Length Unit毫米What one model unit is.
质量Cad Preview Options—How finely to tessellate; null for the preview's.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计

写入 DXF

函数

Writes a flat shape as a DXF drawing, as OpenSCAD exports a 2D object: its boundaries as lines, arcs and polylines on one layer, curves other than lines and arcs followed by polylines within the tolerance (the kernel's DxfWriter).

签名
写入 DXF(形状: Cad Shape, 路径: 文本, 容差: 数字)
void WriteDxf(
    CadShape shape,
    string path,
    double tolerance = 1E-06)

参数

名称类型默认值说明
形状Cad Shape—The shape.
路径文本—Where to write, overwritten if it is there.
容差数字1E-06How far polylines standing in for other curves may stray from them.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计

写入 OFF

函数

Writes the bodies as one OFF file (Object File Format, which OpenSCAD reads and writes), tessellated as CadExport.WriteStl tessellates, each body a closed mesh of shared corners, its faces counter-clockwise seen from outside.

签名
写入 OFF(模型: Cad Model, 路径: 文本, 质量: Cad Preview Options)
void WriteOff(
    CadModel model,
    string path,
    CadPreviewOptions quality)

参数

名称类型默认值说明
模型Cad Model—The bodies.
路径文本—Where to write, overwritten if it is there.
质量Cad Preview Options—How finely to tessellate; null for the preview's.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计

写入 STEP

函数

Writes all exact B-reps to STEP, retaining disconnected bodies. Unit declares the units of the unchanged coordinates; it does not rescale them.

签名
写入 STEP
    模型: Cad Model
    路径: 文本
    单位: Length Unit
    容差: 数字
void WriteStep(
    CadModel model,
    string path,
    LengthUnit unit = LengthUnit.Millimeter,
    double tolerance = 1E-06)

参数

名称类型默认值说明
模型Cad Model—
路径文本—
单位Length Unit毫米
容差数字1E-06
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计

写入 STL

函数

Writes an explicitly tessellated binary STL. STL has no unit metadata; choose model units before modeling. With no quality given, the model is tessellated as its preview is, at its own scale: chords within 0.1% of its bounding diagonal, 20° between normals.

签名
写入 STL(模型: Cad Model, 路径: 文本, 质量: Cad Preview Options)
void WriteStl(
    CadModel model,
    string path,
    CadPreviewOptions quality)

参数

名称类型默认值说明
模型Cad Model—
路径文本—
质量Cad Preview Options—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计

写入 SVG

函数

Writes a flat shape as an SVG drawing, as OpenSCAD exports a 2D object: one filled path, even-odd so that holes stay holes, in millimetres with Y running up the page as it does in the model, on a page that is the shape's box. Lines, arcs and Béziers are written exactly - lines as lines, arcs as SVG arcs, curves of degree three or less as Béziers - and other curves as lines within the tolerance. An SVG's coordinates are its page's, so read back (CadImport.ReadShape) the shape stands with its box's lower-left corner at the origin; DXF keeps the model's coordinates.

签名
写入 SVG(形状: Cad Shape, 路径: 文本, 容差: 数字)
void WriteSvg(
    CadShape shape,
    string path,
    double tolerance = 1E-06)

参数

名称类型默认值说明
形状Cad Shape—The shape.
路径文本—Where to write, overwritten if it is there.
容差数字1E-06How far lines standing in for other curves may stray from them.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
CAD 导出
所属包
计算机辅助设计