The ShapeDiverDisplayExternalGeometry component displays static meshes stored in a publicly accessible URL without running them through Grasshopper. This is ideal for optimization purposes when the definition needs to display several times the same identical geometry or when you want to enhance the scene of your definition without compromising the performance.
File Settings
In order to be able to use this component, the requirements of your file and the URL where it gets stored are:
- The file must use the binary glTF format. All glTF v2.0 files are compatible (using the .gltf extension), but not all advanced features are supported. You can also export gltf files directly from Rhino using the exporter that is included in the ShapeDiver plugin. Read more about the exporter here.
- The URL must be publicly accessible. You can dynamically change this URL by using our ShapeDiverTextInput component.
- You must add the correct metadata to your URL file with Content-Type = application/octet-stream and if the file is compressed Content-Encoding = gzip.
- Make sure the CORS configuration of the bucket allows access. An example of CORS configuration would be:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3600</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
File storage
We recommend using a service such as Amazon S3 to store your external geometry. Most online storage services don't provide the flexibility to define MIME types and CORS configurations. Read more about it here.
Geometry Placeholder
The geometry placeholder gets displayed in the Rhinoceros viewport as a visual guide to position and orient the external geometry in the ShapeDiver viewer. Ideally, this geometry should be the same one that is stored in the URL so that you can accurately know how the final result will look in the ShapeDiver viewer.
Delete Placeholders
If your GH file size is over the limit of your ShapeDiver Plan (Check the limits here), you can bring down your file size by deleting the placeholders as they are not used to compute your definition.
Materials
The material input is defined by the ShapeDiverSimpleMaterial or the ShapeDiverMaterial component. If your external geometry has texture coordinates, the material will be applied accordingly.
Transformations
If you require to display your external geometry in an specific position or several positions of your scene, or you need to scale, rotate or do other kind of transformations, you can attach those transformations to your file URL via Grasshopper with our XFormExtGeo C# script. Each transformation will create a new object in your scene so don't forget to Compound your transformations if you want all of them to be applied to a single object.
Download this Example
You can download the Grasshopper definition of this example here and use our XFormExtGeo C# script to transform your external geometry.
Test your External Geometry URL
If you want to test if your URL has the right settings, paste it in the next demo model and see if you get the expected result (Be aware that the original scale of the next demo model is 1.8 units high so if your model is way bigger it may not be displayed in the viewer):
Comments
0 comments
Article is closed for comments.