English Version
The new version 0.8.0, scheduled for release on August 6, will include file upload support! Currently, only PNG, SVG, and STL formats are supported.
To meet the customization needs of general users, certain limitations have been implemented in the current version:
- Source code developers must create a variable name for a file before others can upload files:
- For example, you must first define
fileName = "default.png";
before others can usefileName
to upload a file.
- Limit default file names:
-
Currently, the parametric model generator includes
default.png
,default.svg
, anddefault.stl
as built-in files for source code developers. Developers must use these three file names when uploading source code for the system to recognize them. -
This means developers cannot upload custom default files. Once the parametric model generator supports a multi-file system, this limitation will be lifted.
Usage Examples:
- PNG files:
The file name in the source code must be default.png
:
yourFileName = "default.png";
scale([0.1, 0.1, 0.1])
surface(file = yourFileName, center = true, invert = true);
- SVG files:
The file name in the source code must be default.svg
:
yourFileName = "default.svg";
scale(0.5, 0.5, 0.5)
linear_extrude(10)
import(file=yourFileName, center = true);
- STL files:
The file name in the source code must be default.stl
:
yourFileName = "default.stl";
import(yourFileName);
中文版
0.8.0新版本计划在8月6号稍晚时发布,此版本支持了文件上传功能。目前只支持png、svg、stl文件上传。
为了满足普通用户定制的需要,当前版本的实现做了一定的限制:
- 源码编写者必须创建一个文件的变量名才能让其他人上传文件:
- 例如,必须先定义
fileName = "default.png";
,然后其他用户才能使用fileName
上传文件。
- 限制默认文件名:
-
目前,参数化模型生成器内置了
default.png
、default.svg
、default.stl
三个文件供源码开发者使用。开发者上传源码时,必须使用这三个文件名,系统才能识别。 -
这意味着源码开发者不能上传自定义的默认文件。待参数化模型生成器实现了多文件系统支持后,这一限制将被取消。
使用方式示例如下
- PNG文件
源码文件中文件名必须是default.png
yourFileName = "default.png";
scale([0.1, 0.1, 0.1])
surface(file = yourFileName, center = true, invert = true);
- SVG文件
源码文件中文件名必须是default.svg
yourFileName = "default.svg";
scale(0.5, 0.5, 0.5)
linear_extrude(10)
import(file=yourFileName, center = true);
- STL文件
源码文件中文件名必须是default.stl
yourFileName = "default.stl";
import(yourFileName);