Paramatric Model Maker V0.8.0 support uploading files!

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:

  1. 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 use fileName to upload a file.
  1. Limit default file names:
  • Currently, the parametric model generator includes default.png, default.svg, and default.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:

  1. 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);

  1. 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);

  1. 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文件上传。

为了满足普通用户定制的需要,当前版本的实现做了一定的限制:

  1. 源码编写者必须创建一个文件的变量名才能让其他人上传文件:
  • 例如,必须先定义 fileName = "default.png";,然后其他用户才能使用 fileName 上传文件。
  1. 限制默认文件名:
  • 目前,参数化模型生成器内置了 default.pngdefault.svgdefault.stl 三个文件供源码开发者使用。开发者上传源码时,必须使用这三个文件名,系统才能识别。

  • 这意味着源码开发者不能上传自定义的默认文件。待参数化模型生成器实现了多文件系统支持后,这一限制将被取消。

使用方式示例如下

  1. PNG文件

源码文件中文件名必须是default.png

yourFileName = "default.png";
scale([0.1, 0.1, 0.1])
  surface(file = yourFileName, center = true, invert = true);

  1. SVG文件

源码文件中文件名必须是default.svg

yourFileName = "default.svg";

scale(0.5, 0.5, 0.5)
linear_extrude(10)
    import(file=yourFileName, center = true);

  1. STL文件

源码文件中文件名必须是default.stl

yourFileName = "default.stl";
import(yourFileName);

6 Likes

This is just great!

I wonder if there’s any way I can upload a script with a predefined PNG/SVG or STL if the user doesn’t upload any from the above control itself? Something like a fallback file.

1 Like

that sounds great, is there a way to include a default PNG/SVG it would make it a nice addition to implement

1 Like

Currently, only three default files we provided can be used as predefined files, like default.png, default.svg, default.stl. In the future, we will support multi files system, so that developers can upload multi scad files and other files as predefined files.

2 Likes

This is a great feature!

What I would ask you to consider is to provide, at least for STL where it’s the most relevant, the dimensions and location the object loaded to.

Afaik this is not supported in Openscad but you could define extra variables and use some external code to supply the script with that information.

That’s important for models that want to alter the STL object. Without that information on the object it requires some complex work on the user side to provide that info in some way.

2 Likes

I don’t know if this is the right thread,
I think that a good improvement will be to le us upload PNG and SVG to the “raw model files section” for our models:

I tried to upload an SVG to give the users other options, rather than default MakerWorld logo, but the file filter does permit image uploads.

Yes, predefined svgs are not supported now, only default.svg can be used when you upload scad. Only users can upload their svg when customize.

Yes I understand that,
I was asking if there will be a chance for us to upload one (or many) svg or png samples in the Model extra files, to give the user a starting point with some alternative images for the parametric models.
I think that this functionality will give us room to improve user experience with parametric models, even when the multi-upload files will be implementented in the parametric model maker.

I did search all the model edit/upload form and did not find any way to upload svg images.

This is what everyone has asked here and the answer has already been published: it is not possible right now but could be in the future.

I apologize if my previous message wasn’t clear.
I was not asking to upload multiple files nor default files into the parametric model.

It is evident from the announcement post that this is a feature that will be implemented in the future which I understood from the beginning.

What I did not explain well is that I was asking wheter uploading SVG or PNG will be supported for file uploads in model edit, as showed in the screenshot from my first post.

I presume what you’re requesting is exactly what explained from @ypy , this possibility will be probably exposed for uploading them together with the .scad file and .stl files functional to the script itself.

I - as a programmer - think that when your script will be executed a copy of the script and all supporting files (.SVG, .PNG, .STL) will be copied to a temporary location and the script executed from there.

This could also be useful for opening a way to multi-.scad-file script allowing everyone to use third party libraries in their scripts.

I hope this will be the evolution of Parametric Model Maker in the near future.

What I was pointing out is that there is no need to develop the full functionality for multiple files, which I am sure will require development and testing and can be a lengthy process to ensure there are no errors.

I was asking if, as a temporary solution, it would be feasible to enable only the upload of SVG and PNG files, even if, for the moment, they won’t be shared with the customizer.

Anyway, arguing is futile. I see that if it’s not planned, it won’t be developed.

As an alternative for such need you can include a link in the description (to github for example). I’d say it is even easier to download that way than using the downloads from the model.

Not arguing at all, just trying to help. Really. :heart:

As a software developer I can say that a “temporary solution” is a baaaaad thing.

By the way, the model upload procedure and the Parametric Model Maker could be developed by two different teams, so anything, also a temporary solution, would require work on both sides with both teams agreing on things.

I really hope in the future Parametric Model Maker could have more advanced functionalities.

Not arguing at all, just trying to help. Really. :heart:

I didn’t mean arguing in a negative way

I was asking if, as a temporary solution, it would be feasible to enable only the upload …

Instant regret when I wrote “temporary solution.” As a software architect, I know that temporary solutions (aka patches) are not a good way to solve problems.

What I meant to ask was if a partial feature could be developed. This feature would not require full integration into the entire data flow of the parametric model maker.

Adding a new extension to a file filter upload is not a big deal. While I don’t know the entire MakerWorld release workflow, I know React well enough to say that this is a small change that can be rolled out quickly, respecting the release schedule.

I’m sure it is not a security problem; you can even upload Python files.

Anyway, I’m digressing again. I made my request, and it has been declined.

I’ll accept that. :man_shrugging:

1 Like

Hey, I’m not affiliate in any way with MakerWorld.

I’m just another user collecting information and discussing them.

Your proposal has not been declined by anyone with decision power.
I really hope they could put it online as soon as possible, but I don’t think this will happen soon.

After a few days of work, I have done a lightbox generator with the new options.
Right now it is a little bit limited until multiple files are allowed, but I think it is a good first version.
https://makerworld.com/en/models/583754#profileId-504900

@ypy I’m really waiting for the new features

1 Like

Very usefull amazing work

This is a great step forward, I’ve been wanting to get more into the customized model game but I’m still at the shallow end of the OpenSCAD learning curve. I love the idea of using MakerWorld as a host for our own generators, so much faster than kicking open the entire app!