Models Now Support Prompting End Users for Import Files

This is the first of several fascinating enhancements to the OpenSCAD ecosystem that I hope will take it to a new level as a way for Creators to interact with Makers.

Let me explain with an example:



$fn = 30;
import_file_name = "sample_ring.svg"; // [FILE]
model_height = 5;

/* [This Template Only Supports SVG Files] */
linear_extrude(height=model_height) import(import_file_name, center=true);​


The script above prompts the end user to select a file from their computer during customization. Then, the file will be uploaded to our OpenSCAD backend and available to the script with the name provided in the script. To clarify, in this case, we will rename any file the user provides to sample_ring.svg".

Here is a picture of how it looks in the customizer on the site:

​ [ATTACH=JSON]{“data-align”:“none”,“data-size”:“custom”,“height”:“393”,“width”:“754”,“data-attachmentid”:16323}[/ATTACH]

Using this approach, a Creator would be able to build a script using the “surface” command to create lithophanes; using the “import” command, you could combine “maker” provided STLs, SVG, or DXF file with a model produced natively in OpenSCAD.

The above script imports an SVG and allows the user to extrude it into a 3d object with a user-specified height.

Just think about the possibilities.

Feel free to share this information in other forums you may participate in and to share the URL for models.makewithtech.com

Irv

1 Like

Very cool feature! I’ll keep this in mind for future models.