Description of the component
The ShapeDiverGeometryImport component is a way to let online users upload a CAD file that can be used as an input to the Grasshopper definition. There are two ways to import geometry using this component:
- By giving a URL to the URI input parameter (possible locally in Grasshopper and in the online viewer)
- By double-clicking on the button generated by the component, after the file is uploaded to the platform (possible only in the online viewer). The button opens a dialog allowing online users to upload their local files.
In Grasshopper, the component can only be tested using the option 1, both with public online URLs and with files stored locally (using the path of the file on the local machine).
The files must be hosted in a publicly accessible online location that allows downloading. Read more about how to store files online and use them in the ShapeDiver viewer.
The component outputs a list of geometry objects extracted from the imported file.
Double-clicking on this component opens a dialog box with the options to set a maximum file size for the parameter and to enable different file types.
Supported file formats
At the moment, the ShapeDiver plugin can import two file types:
- OBJ (MIME type: application/wavefront-obj) - 3D meshes
- DXF (MIME type: application/dxf) - 2D drawings
For the DXF format, the following entities are supported (other entities will be ignored):
Let us know through the forum if you need to import more geometry formats.
Example 1: mesh processing
One possible application for importing geometry is to offer a web applet that lets users upload their own files and run them through an online algorithm, therefore providing an Algorithm as a Service. Consider below a basic example definition that lets users upload meshes with a number of holes and simply fills all the holes to output a watertight mesh.
Once online, this definition includes a text box for users to link external CAD files and see the algorithm's results in the 3D viewer. The final definition also includes an export component for downloading the closed output mesh.
Example 2: upload floor plans
A great use case in the field of architectural product configurators is to allow users to upload floor plans (in the DXF 2D file format, for example) as an input for architectural products.
- Component name: ShapediverGeometryImport
- Default Nickname: SDGeometryImport
|URI||U||The default URI to import the image from if no file is uploaded.||
|Object||O||The imported geometry object(s).||
|Material||M||The imported material definition. Not implemented yet.||
- Double-click on the component to define which file types are accepted by the component and a maximum size for the uploaded files.